diff --git a/examples/test_vpc_v1_examples.py b/examples/test_vpc_v1_examples.py index 6929e6f..a5054e4 100644 --- a/examples/test_vpc_v1_examples.py +++ b/examples/test_vpc_v1_examples.py @@ -1876,6 +1876,115 @@ def test_create_instance_action_example(self): except ApiException as e: pytest.fail(str(e)) + + @needscredentials + def test_list_instance_cluster_network_attachments_example(self): + """ + list_instance_cluster_network_attachments request example + """ + try: + print('\nlist_instance_cluster_network_attachments() result:') + + # begin-list_instance_cluster_network_attachments + + all_results = [] + pager = InstanceClusterNetworkAttachmentsPager( + client=vpc_service, + instance_id=data['instanceId'], + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + print(json.dumps(all_results, indent=2)) + + # end-list_instance_cluster_network_attachments + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_create_cluster_network_attachment_example(self): + """ + create_cluster_network_attachment request example + """ + try: + print('\ncreate_cluster_network_attachment() result:') + + # begin-create_cluster_network_attachment + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = { + 'name': 'my-instance-network-attachment', + 'auto_delete': False, + } + response = vpc_service.create_cluster_network_attachment( + instance_id=data['instanceId'], + cluster_network_interface=instance_cluster_network_attachment_prototype_cluster_network_interface_model, + name='my-instance-network-attachment', + ) + instance_cluster_network_attachment = response.get_result() + + print(json.dumps(instance_cluster_network_attachment, indent=2)) + + # end-create_cluster_network_attachment + assert instance_cluster_network_attachment is not None + data['instanceClusterNetworkAttachmentId']=instance_cluster_network_attachment['id'] + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_instance_cluster_network_attachment_example(self): + """ + get_instance_cluster_network_attachment request example + """ + try: + print('\nget_instance_cluster_network_attachment() result:') + + # begin-get_instance_cluster_network_attachment + + response = vpc_service.get_instance_cluster_network_attachment( + instance_id=data['instanceId'], + id=data['instanceClusterNetworkAttachmentId'], + ) + instance_cluster_network_attachment = response.get_result() + + print(json.dumps(instance_cluster_network_attachment, indent=2)) + + # end-get_instance_cluster_network_attachment + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_instance_cluster_network_attachment_example(self): + """ + update_instance_cluster_network_attachment request example + """ + try: + print('\nupdate_instance_cluster_network_attachment() result:') + + # begin-update_instance_cluster_network_attachment + + instance_cluster_network_attachment_patch_model = { + 'name': 'my-instance-network-attachment-updated', + } + + response = vpc_service.update_instance_cluster_network_attachment( + instance_id=data['instanceId'], + id=data['instanceClusterNetworkAttachmentId'], + instance_cluster_network_attachment_patch=instance_cluster_network_attachment_patch_model, + ) + instance_cluster_network_attachment = response.get_result() + + print(json.dumps(instance_cluster_network_attachment, indent=2)) + + # end-update_instance_cluster_network_attachment + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials @pytest.mark.skip(reason="mock") def test_create_instance_console_access_token_example(self): @@ -3989,6 +4098,493 @@ def test_get_region_zone_example(self): except ApiException as e: pytest.fail(str(e)) + + @needscredentials + def test_list_cluster_network_profiles_example(self): + """ + list_cluster_network_profiles request example + """ + try: + print('\nlist_cluster_network_profiles() result:') + + # begin-list_cluster_network_profiles + + all_results = [] + pager = ClusterNetworkProfilesPager( + client=vpc_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + print(json.dumps(all_results, indent=2)) + + # end-list_cluster_network_profiles + assert all_results is not None + data['clusterNetworkProfile']=all_results[0]['name'] + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_cluster_network_profile_example(self): + """ + get_cluster_network_profile request example + """ + try: + print('\nget_cluster_network_profile() result:') + + # begin-get_cluster_network_profile + + response = vpc_service.get_cluster_network_profile( + name=data['clusterNetworkProfile'], + ) + cluster_network_profile = response.get_result() + + print(json.dumps(cluster_network_profile, indent=2)) + + # end-get_cluster_network_profile + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_cluster_networks_example(self): + """ + list_cluster_networks request example + """ + try: + print('\nlist_cluster_networks() result:') + + # begin-list_cluster_networks + + all_results = [] + pager = ClusterNetworksPager( + client=vpc_service, + limit=10, + sort='name', + vpc_id=data['vpcID'], + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + print(json.dumps(all_results, indent=2)) + + # end-list_cluster_networks + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_create_cluster_network_example(self): + """ + create_cluster_network request example + """ + try: + print('\ncreate_cluster_network() result:') + + # begin-create_cluster_network + + cluster_network_profile_identity_model = { + 'name': data['clusterNetworkProfile'], + } + + vpc_identity_model = { + 'id': data['vpcID'], + } + + zone_identity_model = { + 'name': data['zone'], + } + + response = vpc_service.create_cluster_network( + profile=cluster_network_profile_identity_model, + vpc=vpc_identity_model, + zone=zone_identity_model, + ) + cluster_network = response.get_result() + + print(json.dumps(cluster_network, indent=2)) + + # end-create_cluster_network + assert cluster_network is not None + data['clusterNetworkId']=cluster_network['id'] + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_cluster_network_interfaces_example(self): + """ + list_cluster_network_interfaces request example + """ + try: + print('\nlist_cluster_network_interfaces() result:') + + # begin-list_cluster_network_interfaces + + all_results = [] + pager = ClusterNetworkInterfacesPager( + client=vpc_service, + cluster_network_id=data['clusterNetworkId'], + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + print(json.dumps(all_results, indent=2)) + + # end-list_cluster_network_interfaces + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_create_cluster_network_interface_example(self): + """ + create_cluster_network_interface request example + """ + try: + print('\ncreate_cluster_network_interface() result:') + + # begin-create_cluster_network_interface + + response = vpc_service.create_cluster_network_interface( + cluster_network_id=data['clusterNetworkId'], + ) + cluster_network_interface = response.get_result() + + print(json.dumps(cluster_network_interface, indent=2)) + + # end-create_cluster_network_interface + assert cluster_network_interface is not None + data['clusterNetworkInterfaceId']=cluster_network_interface['id'] + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_cluster_network_interface_example(self): + """ + get_cluster_network_interface request example + """ + try: + print('\nget_cluster_network_interface() result:') + + # begin-get_cluster_network_interface + + response = vpc_service.get_cluster_network_interface( + cluster_network_id=data['clusterNetworkId'], + id=data['clusterNetworkInterfaceId'], + ) + cluster_network_interface = response.get_result() + + print(json.dumps(cluster_network_interface, indent=2)) + + # end-get_cluster_network_interface + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_cluster_network_interface_example(self): + """ + update_cluster_network_interface request example + """ + try: + print('\nupdate_cluster_network_interface() result:') + + # begin-update_cluster_network_interface + + cluster_network_interface_patch_model = { + 'name': 'my-cluster-network-interface-updated', + } + + response = vpc_service.update_cluster_network_interface( + cluster_network_id=data['clusterNetworkId'], + id=data['clusterNetworkInterfaceId'], + cluster_network_interface_patch=cluster_network_interface_patch_model, + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + cluster_network_interface = response.get_result() + + print(json.dumps(cluster_network_interface, indent=2)) + + # end-update_cluster_network_interface + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_cluster_network_subnets_example(self): + """ + list_cluster_network_subnets request example + """ + try: + print('\nlist_cluster_network_subnets() result:') + + # begin-list_cluster_network_subnets + + all_results = [] + pager = ClusterNetworkSubnetsPager( + client=vpc_service, + cluster_network_id=data['clusterNetworkId'], + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + print(json.dumps(all_results, indent=2)) + + # end-list_cluster_network_subnets + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_create_cluster_network_subnet_example(self): + """ + create_cluster_network_subnet request example + """ + try: + print('\ncreate_cluster_network_subnet() result:') + + # begin-create_cluster_network_subnet + + cluster_network_subnet_prototype_model = { + 'total_ipv4_address_count': 256, + } + + response = vpc_service.create_cluster_network_subnet( + cluster_network_id=data['clusterNetworkId'], + cluster_network_subnet_prototype=cluster_network_subnet_prototype_model, + ) + cluster_network_subnet = response.get_result() + + print(json.dumps(cluster_network_subnet, indent=2)) + + # end-create_cluster_network_subnet + assert cluster_network_subnet is not None + data['clusterNetworkSubnetId']=cluster_network_subnet['id'] + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_cluster_network_subnet_reserved_ips_example(self): + """ + list_cluster_network_subnet_reserved_ips request example + """ + try: + print('\nlist_cluster_network_subnet_reserved_ips() result:') + + # begin-list_cluster_network_subnet_reserved_ips + + all_results = [] + pager = ClusterNetworkSubnetReservedIpsPager( + client=vpc_service, + cluster_network_id=data['clusterNetworkId'], + cluster_network_subnet_id=data['clusterNetworkSubnetId'], + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + print(json.dumps(all_results, indent=2)) + + # end-list_cluster_network_subnet_reserved_ips + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_create_cluster_network_subnet_reserved_ip_example(self): + """ + create_cluster_network_subnet_reserved_ip request example + """ + try: + print('\ncreate_cluster_network_subnet_reserved_ip() result:') + + # begin-create_cluster_network_subnet_reserved_ip + + response = vpc_service.create_cluster_network_subnet_reserved_ip( + cluster_network_id=data['clusterNetworkId'], + cluster_network_subnet_id=data['clusterNetworkSubnetId'], + name='my-cluster-network-subnet-reserved-ip', + ) + cluster_network_subnet_reserved_ip = response.get_result() + + print(json.dumps(cluster_network_subnet_reserved_ip, indent=2)) + + # end-create_cluster_network_subnet_reserved_ip + assert cluster_network_subnet_reserved_ip is not None + data['clusterNetworkSubnetReservedIpId']=cluster_network_subnet_reserved_ip['id'] + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_cluster_network_subnet_reserved_ip_example(self): + """ + get_cluster_network_subnet_reserved_ip request example + """ + try: + print('\nget_cluster_network_subnet_reserved_ip() result:') + + # begin-get_cluster_network_subnet_reserved_ip + + response = vpc_service.get_cluster_network_subnet_reserved_ip( + cluster_network_id=data['clusterNetworkId'], + cluster_network_subnet_id=data['clusterNetworkSubnetId'], + id=data['clusterNetworkSubnetReservedIpId'], + ) + cluster_network_subnet_reserved_ip = response.get_result() + + print(json.dumps(cluster_network_subnet_reserved_ip, indent=2)) + + # end-get_cluster_network_subnet_reserved_ip + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_cluster_network_subnet_reserved_ip_example(self): + """ + update_cluster_network_subnet_reserved_ip request example + """ + try: + print('\nupdate_cluster_network_subnet_reserved_ip() result:') + + # begin-update_cluster_network_subnet_reserved_ip + + cluster_network_subnet_reserved_ip_patch_model = { + 'name':'my-cluster-network-subnet-reserved-ip-updated', + } + + response = vpc_service.update_cluster_network_subnet_reserved_ip( + cluster_network_id=data['clusterNetworkId'], + cluster_network_subnet_id=data['clusterNetworkSubnetId'], + id=data['clusterNetworkSubnetReservedIpId'], + cluster_network_subnet_reserved_ip_patch=cluster_network_subnet_reserved_ip_patch_model, + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + cluster_network_subnet_reserved_ip = response.get_result() + + print(json.dumps(cluster_network_subnet_reserved_ip, indent=2)) + + # end-update_cluster_network_subnet_reserved_ip + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_cluster_network_subnet_example(self): + """ + get_cluster_network_subnet request example + """ + try: + print('\nget_cluster_network_subnet() result:') + + # begin-get_cluster_network_subnet + + response = vpc_service.get_cluster_network_subnet( + cluster_network_id=data['clusterNetworkId'], + id=data['clusterNetworkSubnetId'], + ) + cluster_network_subnet = response.get_result() + + print(json.dumps(cluster_network_subnet, indent=2)) + + # end-get_cluster_network_subnet + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_cluster_network_subnet_example(self): + """ + update_cluster_network_subnet request example + """ + try: + print('\nupdate_cluster_network_subnet() result:') + + # begin-update_cluster_network_subnet + + cluster_network_subnet_patch_model = { + 'name': 'my-cluster-network-subnet-updated', + } + + response = vpc_service.update_cluster_network_subnet( + cluster_network_id=data['clusterNetworkId'], + id=data['clusterNetworkSubnetId'], + cluster_network_subnet_patch=cluster_network_subnet_patch_model, + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + cluster_network_subnet = response.get_result() + + print(json.dumps(cluster_network_subnet, indent=2)) + + # end-update_cluster_network_subnet + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_cluster_network_example(self): + """ + get_cluster_network request example + """ + try: + print('\nget_cluster_network() result:') + + # begin-get_cluster_network + + response = vpc_service.get_cluster_network( + id=data['clusterNetworkId'], + ) + cluster_network = response.get_result() + + print(json.dumps(cluster_network, indent=2)) + + # end-get_cluster_network + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_cluster_network_example(self): + """ + update_cluster_network request example + """ + try: + print('\nupdate_cluster_network() result:') + + # begin-update_cluster_network + + cluster_network_patch_model = { + 'name': 'my-cluster-network-updated', + } + + response = vpc_service.update_cluster_network( + id=data['clusterNetworkId'], + cluster_network_patch=cluster_network_patch_model, + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + cluster_network = response.get_result() + + print(json.dumps(cluster_network, indent=2)) + + # end-update_cluster_network + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials def test_list_public_gateways_example(self): """ @@ -7677,6 +8273,32 @@ def test_delete_floating_ip_example(self): except ApiException as e: pytest.fail(str(e)) + + + @needscredentials + def test_delete_instance_cluster_network_attachment_example(self): + """ + delete_instance_cluster_network_attachment request example + """ + try: + print('\ndelete_instance_cluster_network_attachment() result:') + + # begin-delete_instance_cluster_network_attachment + + response = vpc_service.delete_instance_cluster_network_attachment( + instance_id=data['instanceId'], + id=data['instanceClusterNetworkAttachmentId'], + ) + instance_cluster_network_attachment = response.get_result() + + print(json.dumps(instance_cluster_network_attachment, indent=2)) + + # end-delete_instance_cluster_network_attachment + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials def test_delete_instance_example(self): """ @@ -7895,6 +8517,104 @@ def test_delete_security_group_example(self): except ApiException as e: pytest.fail(str(e)) + + @needscredentials + def test_delete_cluster_network_interface_example(self): + """ + delete_cluster_network_interface request example + """ + try: + print('\ndelete_cluster_network_interface() result:') + + # begin-delete_cluster_network_interface + + response = vpc_service.delete_cluster_network_interface( + cluster_network_id=data['clusterNetworkId'], + id=data['clusterNetworkInterfaceId'], + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + cluster_network_interface = response.get_result() + + print(json.dumps(cluster_network_interface, indent=2)) + + # end-delete_cluster_network_interface + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_delete_cluster_network_subnet_reserved_ip_example(self): + """ + delete_cluster_network_subnet_reserved_ip request example + """ + try: + print('\ndelete_cluster_network_subnet_reserved_ip() result:') + + # begin-delete_cluster_network_subnet_reserved_ip + + response = vpc_service.delete_cluster_network_subnet_reserved_ip( + cluster_network_id=data['clusterNetworkId'], + cluster_network_subnet_id=data['clusterNetworkSubnetId'], + id=data['clusterNetworkSubnetReservedIpId'], + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + cluster_network_subnet_reserved_ip = response.get_result() + + print(json.dumps(cluster_network_subnet_reserved_ip, indent=2)) + + # end-delete_cluster_network_subnet_reserved_ip + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_delete_cluster_network_subnet_example(self): + """ + delete_cluster_network_subnet request example + """ + try: + print('\ndelete_cluster_network_subnet() result:') + + # begin-delete_cluster_network_subnet + + response = vpc_service.delete_cluster_network_subnet( + cluster_network_id=data['clusterNetworkId'], + id=data['clusterNetworkSubnetId'], + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + cluster_network_subnet = response.get_result() + + print(json.dumps(cluster_network_subnet, indent=2)) + + # end-delete_cluster_network_subnet + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_delete_cluster_network_example(self): + """ + delete_cluster_network request example + """ + try: + print('\ndelete_cluster_network() result:') + + # begin-delete_cluster_network + + response = vpc_service.delete_cluster_network( + id=data['clusterNetworkId'], + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + cluster_network = response.get_result() + + print(json.dumps(cluster_network, indent=2)) + + # end-delete_cluster_network + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials def test_delete_public_gateway_example(self): """ diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py index fb7d33c..482ef26 100644 --- a/ibm_vpc/vpc_v1.py +++ b/ibm_vpc/vpc_v1.py @@ -14,13 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.92.2-3f2a0533-20240712-183330 +# IBM OpenAPI SDK Code Generator Version: 3.96.1-5136e54a-20241108-203028 + """ The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual server instances, along with subnets, volumes, load balancers, and more. -API Version: 2024-04-30 +API Version: 2024-11-13 """ from datetime import datetime @@ -52,7 +53,7 @@ class VpcV1(BaseService): @classmethod def new_instance( cls, - version: Optional[str] = "2024-10-15", + version: Optional[str] = "2024-11-12", service_name: str = DEFAULT_SERVICE_NAME, generation: Optional[int] = 2, ) -> 'VpcV1': @@ -62,7 +63,7 @@ def new_instance( :param str version: The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2024-04-30` and - `2024-10-17`. + `2024-11-14`. """ if version is None: raise ValueError('version must be provided') @@ -78,7 +79,7 @@ def new_instance( def __init__( self, - version: Optional[str] = "2024-10-15", + version: Optional[str] = "2024-11-12", authenticator: Authenticator = None, generation: Optional[int] = 2, ) -> None: @@ -87,7 +88,7 @@ def __init__( :param str version: The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2024-04-30` and - `2024-10-17`. + `2024-11-14`. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md @@ -191,11 +192,15 @@ def create_vpc( VPC will be created with no default address prefixes. Since address prefixes are managed identically regardless of whether they were automatically created, the value is not preserved as a VPC property. - :param bool classic_access: (optional) Indicates whether this VPC will be - connected to Classic Infrastructure. If true, this VPC's resources will - have private network connectivity to the account's Classic Infrastructure - resources. Only one VPC, per region, may be connected in this way. This - value is set at creation and subsequently immutable. + :param bool classic_access: (optional) Deprecated: Indicates whether this + VPC will be connected to Classic Infrastructure. If true, this VPC's + resources will have private network connectivity to the account's Classic + Infrastructure resources. Only one VPC, per region, may be connected in + this way. This value is set at creation and subsequently immutable. + This property has been deprecated. Instead, use a [Transit + Gateway](https://cloud.ibm.com/docs/transit-gateway) to connect this VPC to + Classic Infrastructure. For more information, see [upcoming + changes](https://cloud.ibm.com/docs/vpc?topic=vpc-api-change-log#upcoming-changes). :param VPCDNSPrototype dns: (optional) The DNS configuration for this VPC. If unspecified, the system will assign DNS servers capable of resolving hosts and endpoint @@ -223,6 +228,7 @@ def create_vpc( operation_id='create_vpc', ) headers.update(sdk_headers) + params = { 'version': self.version, 'generation': self.generation, @@ -1758,6 +1764,7 @@ def create_vpc_routing_table( :param str vpc_id: The VPC identifier. :param List[ResourceFilter] accept_routes_from: (optional) The filters specifying the resources that may create routes in this routing table. + If specified, `resource_type` must be `vpn_gateway` or `vpn_server`. :param List[str] advertise_routes_to: (optional) The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these sources. @@ -4356,6 +4363,7 @@ def list_keys( *, start: Optional[str] = None, limit: Optional[int] = None, + resource_group_id: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -4367,6 +4375,9 @@ def list_keys( :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + 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 `KeyCollection` object @@ -4385,6 +4396,7 @@ def list_keys( 'generation': self.generation, 'start': start, 'limit': limit, + 'resource_group.id': resource_group_id, } if 'headers' in kwargs: @@ -5015,6 +5027,9 @@ def list_instances( limit: Optional[int] = None, resource_group_id: Optional[str] = None, name: Optional[str] = None, + cluster_network_id: Optional[str] = None, + cluster_network_crn: Optional[str] = None, + cluster_network_name: Optional[str] = None, dedicated_host_id: Optional[str] = None, dedicated_host_crn: Optional[str] = None, dedicated_host_name: Optional[str] = None, @@ -5042,6 +5057,14 @@ def list_instances( identifier. :param str name: (optional) Filters the collection to resources with a `name` property matching the exact specified name. + :param str cluster_network_id: (optional) Filters the collection to + instances with a `cluster_network.id` property matching the specified + identifier. + :param str cluster_network_crn: (optional) Filters the collection to + instances with a `cluster_network.crn` property matching the specified CRN. + :param str cluster_network_name: (optional) Filters the collection to + resources with a `cluster_network.name` property matching the exact + specified name. :param str dedicated_host_id: (optional) Filters the collection to resources with a `dedicated_host.id` property matching the specified identifier. @@ -5091,6 +5114,9 @@ def list_instances( 'limit': limit, 'resource_group.id': resource_group_id, 'name': name, + 'cluster_network.id': cluster_network_id, + 'cluster_network.crn': cluster_network_crn, + 'cluster_network.name': cluster_network_name, 'dedicated_host.id': dedicated_host_id, 'dedicated_host.crn': dedicated_host_crn, 'dedicated_host.name': dedicated_host_name, @@ -5478,6 +5504,345 @@ def create_instance_action( response = self.send(request, **kwargs) return response + def list_instance_cluster_network_attachments( + self, + instance_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + **kwargs, + ) -> DetailedResponse: + """ + List cluster network attachments on an instance. + + This request lists cluster network attachments on an instance. A cluster network + attachment represents a device on the instance to which a cluster network + interface is attached. + + :param str instance_id: The virtual server instance identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :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 `InstanceClusterNetworkAttachmentCollection` object + """ + + if not instance_id: + raise ValueError('instance_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_instance_cluster_network_attachments', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id'] + path_param_values = self.encode_path_vars(instance_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/cluster_network_attachments'.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_cluster_network_attachment( + self, + instance_id: str, + cluster_network_interface: 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface', + *, + before: Optional['InstanceClusterNetworkAttachmentBeforePrototype'] = None, + name: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + Create a cluster network attachment. + + This request creates a cluster network attachment from an instance cluster network + attachment prototype object. A cluster network attachment will attach the instance + to a cluster network. The cluster network attachment prototype must specify a + cluster network interface identity or a cluster network interface prototype. + The instance must be in a `stopped` or `stopping` state to create an instance + cluster network attachment. + + :param str instance_id: The virtual server instance identifier. + :param InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface + cluster_network_interface: A cluster network interface for the instance + cluster network attachment. This can be + specified using an existing cluster network interface that does not already + have a `target`, + or a prototype object for a new cluster network interface. + This instance must reside in the same VPC as the specified cluster network + interface. The + cluster network interface must reside in the same cluster network as the + `cluster_network_interface` of any other `cluster_network_attachments` for + this instance. + :param InstanceClusterNetworkAttachmentBeforePrototype before: (optional) + The instance cluster network attachment to insert this instance cluster + network attachment + immediately before. + If unspecified, this instance cluster network attachment will be inserted + after all + existing instance cluster network attachments. + :param str name: (optional) The name for this cluster network attachment. + Names must be unique within the instance the cluster network attachment + resides in. If unspecified, the name will be a hyphenated list of + randomly-selected words. Names starting with `ibm-` are reserved for + provider-owned resources, and are not allowed. + :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 `InstanceClusterNetworkAttachment` object + """ + + if not instance_id: + raise ValueError('instance_id must be provided') + if cluster_network_interface is None: + raise ValueError('cluster_network_interface must be provided') + cluster_network_interface = convert_model(cluster_network_interface) + if before is not None: + before = convert_model(before) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_cluster_network_attachment', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = { + 'cluster_network_interface': cluster_network_interface, + 'before': before, + 'name': name, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id'] + path_param_values = self.encode_path_vars(instance_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/cluster_network_attachments'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def delete_instance_cluster_network_attachment( + self, + instance_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Delete an instance cluster network attachment. + + This request deletes an instance cluster network attachment. The instance must be + in a + `stopped` or `stopping` state to delete an instance cluster network attachment. + This operation cannot be reversed. + + :param str instance_id: The virtual server instance identifier. + :param str id: The instance cluster network attachment 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 `InstanceClusterNetworkAttachment` object + """ + + if not instance_id: + raise ValueError('instance_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_instance_cluster_network_attachment', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id', 'id'] + path_param_values = self.encode_path_vars(instance_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/cluster_network_attachments/{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_instance_cluster_network_attachment( + self, + instance_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve an instance cluster network attachment. + + This request retrieves a single instance cluster network attachment specified by + the identifier in the URL. + + :param str instance_id: The virtual server instance identifier. + :param str id: The instance cluster network attachment 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 `InstanceClusterNetworkAttachment` object + """ + + if not instance_id: + raise ValueError('instance_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_instance_cluster_network_attachment', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id', 'id'] + path_param_values = self.encode_path_vars(instance_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/cluster_network_attachments/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def update_instance_cluster_network_attachment( + self, + instance_id: str, + id: str, + instance_cluster_network_attachment_patch: 'InstanceClusterNetworkAttachmentPatch', + **kwargs, + ) -> DetailedResponse: + """ + Update an instance cluster network attachment. + + This request updates an instance cluster network attachment with the information + provided in an instance network interface patch object. The instance cluster + network attachment patch object is structured in the same way as a retrieved + instance cluster network attachment and needs to contain only the information to + be updated. + + :param str instance_id: The virtual server instance identifier. + :param str id: The instance cluster network attachment identifier. + :param InstanceClusterNetworkAttachmentPatch + instance_cluster_network_attachment_patch: The instance cluster network + attachment patch. + :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 `InstanceClusterNetworkAttachment` object + """ + + if not instance_id: + raise ValueError('instance_id must be provided') + if not id: + raise ValueError('id must be provided') + if instance_cluster_network_attachment_patch is None: + raise ValueError('instance_cluster_network_attachment_patch must be provided') + if isinstance(instance_cluster_network_attachment_patch, InstanceClusterNetworkAttachmentPatch): + instance_cluster_network_attachment_patch = convert_model(instance_cluster_network_attachment_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_instance_cluster_network_attachment', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = json.dumps(instance_cluster_network_attachment_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id', 'id'] + path_param_values = self.encode_path_vars(instance_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/cluster_network_attachments/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + def create_instance_console_access_token( self, instance_id: str, @@ -16618,24 +16983,133 @@ def add_virtual_network_interface_ip( return response ######################### - # Public gateways + # Cluster networks ######################### - def list_public_gateways( + def list_cluster_network_profiles( + self, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + **kwargs, + ) -> DetailedResponse: + """ + List cluster network profiles. + + This request lists cluster network profiles available in the region. A cluster + network profile specifies the performance characteristics and capabilities for a + cluster network. + + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :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 `ClusterNetworkProfileCollection` object + """ + + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_cluster_network_profiles', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/cluster_network/profiles' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_cluster_network_profile( + self, + name: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve a cluster network profile. + + This request retrieves a single cluster network profile specified by the name in + the URL. + + :param str name: The cluster network profile 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 `ClusterNetworkProfile` object + """ + + 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_cluster_network_profile', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + 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_dict = dict(zip(path_param_keys, path_param_values)) + url = '/cluster_network/profiles/{name}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def list_cluster_networks( self, *, start: Optional[str] = None, limit: Optional[int] = None, resource_group_id: Optional[str] = None, + name: Optional[str] = None, + sort: Optional[str] = None, + vpc_id: Optional[str] = None, + vpc_crn: Optional[str] = None, + vpc_name: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List public gateways. + List cluster networks. - This request lists public gateways in the region. A public gateway is a virtual - network device associated with a VPC, which allows access to the Internet. A - public gateway resides in a zone and can be connected to subnets in the same zone - only. + This request lists [cluster + networks](https://cloud.ibm.com/docs/vpc?topic=vpc-about-cluster-network) in the + region. A cluster network is a grouping of resources in a separate networking + space for high performance computing and networking. :param str start: (optional) A server-provided token determining what resource to start the page on. @@ -16643,16 +17117,29 @@ def list_public_gateways( :param str resource_group_id: (optional) Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str vpc_id: (optional) Filters the collection to cluster networks + with a `vpc.id` property matching the specified id. + :param str vpc_crn: (optional) Filters the collection to cluster networks + with a `vpc.crn` property matching the specified CRN. + :param str vpc_name: (optional) Filters the collection to cluster networks + with a `vpc.name` property matching the specified 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 `PublicGatewayCollection` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkCollection` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_public_gateways', + operation_id='list_cluster_networks', ) headers.update(sdk_headers) @@ -16662,6 +17149,11 @@ def list_public_gateways( 'start': start, 'limit': limit, 'resource_group.id': resource_group_id, + 'name': name, + 'sort': sort, + 'vpc.id': vpc_id, + 'vpc.crn': vpc_crn, + 'vpc.name': vpc_name, } if 'headers' in kwargs: @@ -16669,7 +17161,7 @@ def list_public_gateways( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/public_gateways' + url = '/cluster_networks' request = self.prepare_request( method='GET', url=url, @@ -16680,57 +17172,64 @@ def list_public_gateways( response = self.send(request, **kwargs) return response - def create_public_gateway( + def create_cluster_network( self, + profile: 'ClusterNetworkProfileIdentity', vpc: 'VPCIdentity', zone: 'ZoneIdentity', *, - floating_ip: Optional['PublicGatewayFloatingIPPrototype'] = None, name: Optional[str] = None, resource_group: Optional['ResourceGroupIdentity'] = None, + subnet_prefixes: Optional[List['ClusterNetworkSubnetPrefixPrototype']] = None, **kwargs, ) -> DetailedResponse: """ - Create a public gateway. - - This request creates a new public gateway from a public gateway prototype object. - For this to succeed, the VPC must not already have a public gateway in the - specified zone. - If a floating IP is provided, it must be unbound. If a floating IP is not - provided, one will be created and bound to the public gateway. Once a public - gateway has been created, its floating IP cannot be unbound. A public gateway must - be explicitly attached to each subnet it will provide connectivity for. - - :param VPCIdentity vpc: The VPC this public gateway will reside in. - :param ZoneIdentity zone: The zone this public gateway will reside in. - :param PublicGatewayFloatingIPPrototype floating_ip: (optional) - :param str name: (optional) The name for this public gateway. The name must - not be used by another public gateway in the VPC. If unspecified, the name - will be a hyphenated list of randomly-selected words. + Create a cluster network. + + This request creates a new cluster network from a cluster network prototype + object. The prototype object is structured in the same way as a retrieved cluster + network, and contains the information necessary to create the new cluster network. + + :param ClusterNetworkProfileIdentity profile: The profile to use for this + cluster network. + :param VPCIdentity vpc: The VPC this cluster network will reside in. + :param ZoneIdentity zone: The zone this cluster network will reside in. The + zone must be listed + as supported on the specified cluster network profile. + :param str name: (optional) The name for this cluster network. The name + must not be used by another cluster network in the region. Names starting + with `ibm-` are reserved for provider-owned resources, and are not allowed. + If unspecified, the name will be a hyphenated list of randomly-selected + words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + :param List[ClusterNetworkSubnetPrefixPrototype] subnet_prefixes: + (optional) :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 `PublicGateway` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetwork` object """ + if profile is None: + raise ValueError('profile must be provided') if vpc is None: raise ValueError('vpc must be provided') if zone is None: raise ValueError('zone must be provided') + profile = convert_model(profile) vpc = convert_model(vpc) zone = convert_model(zone) - if floating_ip is not None: - floating_ip = convert_model(floating_ip) if resource_group is not None: resource_group = convert_model(resource_group) + if subnet_prefixes is not None: + subnet_prefixes = [convert_model(x) for x in subnet_prefixes] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_public_gateway', + operation_id='create_cluster_network', ) headers.update(sdk_headers) @@ -16740,11 +17239,12 @@ def create_public_gateway( } data = { + 'profile': profile, 'vpc': vpc, 'zone': zone, - 'floating_ip': floating_ip, 'name': name, 'resource_group': resource_group, + 'subnet_prefixes': subnet_prefixes, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -16755,7 +17255,7 @@ def create_public_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/public_gateways' + url = '/cluster_networks' request = self.prepare_request( method='POST', url=url, @@ -16767,50 +17267,74 @@ def create_public_gateway( response = self.send(request, **kwargs) return response - def delete_public_gateway( + def list_cluster_network_interfaces( self, - id: str, + cluster_network_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + name: Optional[str] = None, + sort: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Delete a public gateway. + List cluster network interfaces. - This request deletes a public gateway. This operation cannot be reversed. For this - request to succeed, the public gateway must not be attached to any subnets. The - public gateway's floating IP will be automatically unbound. If the floating IP was - created when the public gateway was created, it will be deleted. + This request lists cluster network interfaces in the region. A cluster network + interface is a logical abstraction of a cluster network interface in a subnet, and + may be attached to a target resource. + The cluster network interfaces will be sorted by their `created_at` property + values, with newest cluster network interfaces first. Cluster network interfaces + with identical + `created_at` property values will in turn be sorted by ascending `name` property + values. - :param str id: The public gateway identifier. + :param str cluster_network_id: The cluster network identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :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 `ClusterNetworkInterfaceCollection` object """ - if not id: - raise ValueError('id must be provided') + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_public_gateway', + operation_id='list_cluster_network_interfaces', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'name': name, + 'sort': sort, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id'] + path_param_values = self.encode_path_vars(cluster_network_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/public_gateways/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/interfaces'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -16819,30 +17343,64 @@ def delete_public_gateway( response = self.send(request, **kwargs) return response - def get_public_gateway( + def create_cluster_network_interface( self, - id: str, + cluster_network_id: str, + *, + name: Optional[str] = None, + primary_ip: Optional['ClusterNetworkInterfacePrimaryIPPrototype'] = None, + subnet: Optional['ClusterNetworkSubnetIdentity'] = None, **kwargs, ) -> DetailedResponse: """ - Retrieve a public gateway. - - This request retrieves a single public gateway specified by the identifier in the - URL. + Create a cluster network interface. - :param str id: The public gateway identifier. + This request creates a new cluster network interface from a cluster network + interface prototype object. The prototype object is structured in the same way as + a retrieved cluster network interface, and contains the information necessary to + create the new cluster network interface. + + :param str cluster_network_id: The cluster network identifier. + :param str name: (optional) The name for this cluster network interface. + The name must not be used by another interface in the cluster network. + Names beginning with `ibm-` are reserved for provider-owned resources, and + are not allowed. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param ClusterNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The + primary IP address to bind to the cluster network interface. May be either + a cluster network subnet reserved IP identity, or a cluster network subnet + reserved IP + prototype object which will be used to create a new cluster network subnet + reserved IP. + If a cluster network subnet reserved IP identity is provided, the specified + cluster + network subnet reserved IP must be unbound. + If a cluster network subnet reserved IP prototype object with an address is + provided, + the address must be available on the cluster network interface's cluster + network + subnet. If no address is specified, an available address on the cluster + network subnet + will be automatically selected and reserved. + :param ClusterNetworkSubnetIdentity subnet: (optional) The associated + cluster network subnet. Required if `primary_ip` does not specify a cluster + network subnet reserved IP identity. :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 `PublicGateway` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkInterface` object """ - if not id: - raise ValueError('id must be provided') + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if primary_ip is not None: + primary_ip = convert_model(primary_ip) + if subnet is not None: + subnet = convert_model(subnet) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_public_gateway', + operation_id='create_cluster_network_interface', ) headers.update(sdk_headers) @@ -16851,54 +17409,71 @@ def get_public_gateway( 'generation': self.generation, } + data = { + 'name': name, + 'primary_ip': primary_ip, + 'subnet': subnet, + } + 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 = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id'] + path_param_values = self.encode_path_vars(cluster_network_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/public_gateways/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/interfaces'.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 - def update_public_gateway( + def delete_cluster_network_interface( self, + cluster_network_id: str, id: str, - public_gateway_patch: 'PublicGatewayPatch', + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Update a public gateway. + Delete a cluster network interface. - This request updates a public gateway's name. + This request deletes a cluster network interface. This operation cannot be + reversed. For this request to succeed, the cluster network interface must not be + required by another resource, such as a cluster network attachment for a virtual + server instance. - :param str id: The public gateway identifier. - :param PublicGatewayPatch public_gateway_patch: The public gateway patch. + :param str cluster_network_id: The cluster network identifier. + :param str id: The cluster network interface identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkInterface` object """ + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') if not id: raise ValueError('id must be provided') - if public_gateway_patch is None: - raise ValueError('public_gateway_patch must be provided') - if isinstance(public_gateway_patch, PublicGatewayPatch): - public_gateway_patch = convert_model(public_gateway_patch) - headers = {} + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_public_gateway', + operation_id='delete_cluster_network_interface', ) headers.update(sdk_headers) @@ -16907,96 +17482,59 @@ def update_public_gateway( 'generation': self.generation, } - data = json.dumps(public_gateway_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/public_gateways/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/interfaces/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='DELETE', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - ######################### - # Floating IPs - ######################### - - def list_floating_ips( + def get_cluster_network_interface( self, - *, - start: Optional[str] = None, - limit: Optional[int] = None, - resource_group_id: Optional[str] = None, - sort: Optional[str] = None, - target_id: Optional[str] = None, - target_crn: Optional[str] = None, - target_name: Optional[str] = None, - target_resource_type: Optional[str] = None, + cluster_network_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List floating IPs. + Retrieve a cluster network interface. - This request lists floating IPs in the region. Floating IPs allow inbound and - outbound traffic from the Internet to an instance. + This request retrieves a single cluster network interface specified by the + identifier in the URL. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. - :param str target_id: (optional) Filters the collection to resources with a - `target.id` property matching the specified identifier. - :param str target_crn: (optional) Filters the collection to resources with - a `target.crn` property matching the specified CRN. - :param str target_name: (optional) Filters the collection to resources with - a `target.name` property matching the exact specified name. - :param str target_resource_type: (optional) Filters the collection to - resources with a `target.resource_type` property matching the specified - value. + :param str cluster_network_id: The cluster network identifier. + :param str id: The cluster network interface 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 `FloatingIPCollection` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkInterface` object """ + if not cluster_network_id: + raise ValueError('cluster_network_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_floating_ips', + operation_id='get_cluster_network_interface', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, - 'sort': sort, - 'target.id': target_id, - 'target.crn': target_crn, - 'target.name': target_name, - 'target.resource_type': target_resource_type, } if 'headers' in kwargs: @@ -17004,7 +17542,10 @@ def list_floating_ips( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/floating_ips' + path_param_keys = ['cluster_network_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/cluster_networks/{cluster_network_id}/interfaces/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -17015,32 +17556,50 @@ def list_floating_ips( response = self.send(request, **kwargs) return response - def create_floating_ip( + def update_cluster_network_interface( self, - floating_ip_prototype: 'FloatingIPPrototype', + cluster_network_id: str, + id: str, + cluster_network_interface_patch: 'ClusterNetworkInterfacePatch', + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Reserve a floating IP. + Update a cluster network interface. - This request reserves a new floating IP. + This request updates a cluster network interface with the information provided in + a cluster network interface patch object. The patch object is structured in the + same way as a retrieved cluster network interface and needs to contain only the + information to be updated. - :param FloatingIPPrototype floating_ip_prototype: The floating IP prototype - object. + :param str cluster_network_id: The cluster network identifier. + :param str id: The cluster network interface identifier. + :param ClusterNetworkInterfacePatch cluster_network_interface_patch: The + cluster network interface patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :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 `FloatingIP` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkInterface` object """ - if floating_ip_prototype is None: - raise ValueError('floating_ip_prototype must be provided') - if isinstance(floating_ip_prototype, FloatingIPPrototype): - floating_ip_prototype = convert_model(floating_ip_prototype) - headers = {} + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if not id: + raise ValueError('id must be provided') + if cluster_network_interface_patch is None: + raise ValueError('cluster_network_interface_patch must be provided') + if isinstance(cluster_network_interface_patch, ClusterNetworkInterfacePatch): + cluster_network_interface_patch = convert_model(cluster_network_interface_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_floating_ip', + operation_id='update_cluster_network_interface', ) headers.update(sdk_headers) @@ -17049,17 +17608,20 @@ def create_floating_ip( 'generation': self.generation, } - data = json.dumps(floating_ip_prototype) - headers['content-type'] = 'application/json' + data = json.dumps(cluster_network_interface_patch) + headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/floating_ips' + path_param_keys = ['cluster_network_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/cluster_networks/{cluster_network_id}/interfaces/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='PATCH', url=url, headers=headers, params=params, @@ -17069,49 +17631,69 @@ def create_floating_ip( response = self.send(request, **kwargs) return response - def delete_floating_ip( + def list_cluster_network_subnets( self, - id: str, + cluster_network_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + name: Optional[str] = None, + sort: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Delete a floating IP. + List cluster network subnets. - This request disassociates (if associated) and releases a floating IP. This - operation cannot be reversed. For this request to succeed, the floating IP must - not be required by another resource, such as a public gateway. + This request lists cluster network subnets in the cluster network. A cluster + network subnet provides network routing between other cluster network subnets + within a cluster network. - :param str id: The floating IP identifier. + :param str cluster_network_id: The cluster network identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :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 `ClusterNetworkSubnetCollection` object """ - if not id: - raise ValueError('id must be provided') + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_floating_ip', + operation_id='list_cluster_network_subnets', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'name': name, + 'sort': sort, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id'] + path_param_values = self.encode_path_vars(cluster_network_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/floating_ips/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/subnets'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -17120,30 +17702,39 @@ def delete_floating_ip( response = self.send(request, **kwargs) return response - def get_floating_ip( + def create_cluster_network_subnet( self, - id: str, + cluster_network_id: str, + cluster_network_subnet_prototype: 'ClusterNetworkSubnetPrototype', **kwargs, ) -> DetailedResponse: """ - Retrieve a floating IP. + Create a cluster network subnet. - This request retrieves a single floating IP specified by the identifier in the - URL. + This request creates a new cluster network subnet from a cluster network subnet + prototype object. The prototype object is structured in the same way as a + retrieved cluster network subnet, and contains the information necessary to create + the new cluster network subnet. - :param str id: The floating IP identifier. + :param str cluster_network_id: The cluster network identifier. + :param ClusterNetworkSubnetPrototype cluster_network_subnet_prototype: The + cluster network subnet prototype object. :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 `FloatingIP` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkSubnet` object """ - if not id: - raise ValueError('id must be provided') + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if cluster_network_subnet_prototype is None: + raise ValueError('cluster_network_subnet_prototype must be provided') + if isinstance(cluster_network_subnet_prototype, ClusterNetworkSubnetPrototype): + cluster_network_subnet_prototype = convert_model(cluster_network_subnet_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_floating_ip', + operation_id='create_cluster_network_subnet', ) headers.update(sdk_headers) @@ -17152,176 +17743,223 @@ def get_floating_ip( 'generation': self.generation, } + data = json.dumps(cluster_network_subnet_prototype) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id'] + path_param_values = self.encode_path_vars(cluster_network_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/floating_ips/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/subnets'.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 - def update_floating_ip( + def list_cluster_network_subnet_reserved_ips( self, - id: str, - floating_ip_patch: 'FloatingIPPatch', + cluster_network_id: str, + cluster_network_subnet_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + name: Optional[str] = None, + sort: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Update a floating IP. + List cluster network subnet reserved IPs. - This request updates a floating IP's name and/or target. + This request lists cluster network subnet reserved IPs in the cluster network. - :param str id: The floating IP identifier. - :param FloatingIPPatch floating_ip_patch: The floating IP patch. + :param str cluster_network_id: The cluster network identifier. + :param str cluster_network_subnet_id: The cluster network subnet + identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :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 `FloatingIP` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkSubnetReservedIPCollection` object """ - if not id: - raise ValueError('id must be provided') - if floating_ip_patch is None: - raise ValueError('floating_ip_patch must be provided') - if isinstance(floating_ip_patch, FloatingIPPatch): - floating_ip_patch = convert_model(floating_ip_patch) + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if not cluster_network_subnet_id: + raise ValueError('cluster_network_subnet_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_floating_ip', + operation_id='list_cluster_network_subnet_reserved_ips', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'name': name, + 'sort': sort, } - data = json.dumps(floating_ip_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id', 'cluster_network_subnet_id'] + path_param_values = self.encode_path_vars(cluster_network_id, cluster_network_subnet_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/floating_ips/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - ######################### - # Network ACLs - ######################### - - def list_network_acls( + def create_cluster_network_subnet_reserved_ip( self, + cluster_network_id: str, + cluster_network_subnet_id: str, *, - start: Optional[str] = None, - limit: Optional[int] = None, - resource_group_id: Optional[str] = None, + address: Optional[str] = None, + name: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List network ACLs. + Create a cluster network subnet reserved IP. - This request lists network ACLs in the region. A network ACL defines a set of - packet filtering (5-tuple) rules for all traffic in and out of a subnet. Both - allow and deny rules can be defined, and rules are stateless such that reverse - traffic in response to allowed traffic is not automatically permitted. + This request creates a new cluster network subnet reserved IP from a cluster + network subnet reserved IP prototype object. The prototype object is structured in + the same way as a retrieved cluster network subnet reserved IP, and contains the + information necessary to create the new cluster network subnet reserved IP. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified + :param str cluster_network_id: The cluster network identifier. + :param str cluster_network_subnet_id: The cluster network subnet identifier. + :param str address: (optional) The IP address to reserve, which must not + already be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :param str name: (optional) The name for this cluster network subnet + reserved IP. The name must not be used by another reserved IP in the + cluster network subnet. Names starting with `ibm-` are reserved for + provider-owned resources, and are not allowed. If unspecified, the name + will be a hyphenated list of randomly-selected words. :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 `NetworkACLCollection` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkSubnetReservedIP` object """ + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if not cluster_network_subnet_id: + raise ValueError('cluster_network_subnet_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_network_acls', + operation_id='create_cluster_network_subnet_reserved_ip', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, } + data = { + 'address': address, + 'name': name, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/network_acls' + path_param_keys = ['cluster_network_id', 'cluster_network_subnet_id'] + path_param_values = self.encode_path_vars(cluster_network_id, cluster_network_subnet_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips'.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 - def create_network_acl( + def delete_cluster_network_subnet_reserved_ip( self, - network_acl_prototype: 'NetworkACLPrototype', + cluster_network_id: str, + cluster_network_subnet_id: str, + id: str, + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Create a network ACL. + Delete a cluster network subnet reserved IP. - This request creates a new stateless network ACL from a network ACL prototype - object. The prototype object is structured in the same way as a retrieved network - ACL, and contains the information necessary to create the new network ACL. + This request deletes a cluster network subnet reserved IP. This operation cannot + be reversed. + For this request to succeed, the reserved IP must be unbound. A provider-owned + reserved IP is not allowed to be deleted. - :param NetworkACLPrototype network_acl_prototype: The network ACL prototype - object. + :param str cluster_network_id: The cluster network identifier. + :param str cluster_network_subnet_id: The cluster network subnet + identifier. + :param str id: The cluster network subnet reserved IP identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkSubnetReservedIP` object """ - if network_acl_prototype is None: - raise ValueError('network_acl_prototype must be provided') - if isinstance(network_acl_prototype, NetworkACLPrototype): - network_acl_prototype = convert_model(network_acl_prototype) - headers = {} + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if not cluster_network_subnet_id: + raise ValueError('cluster_network_subnet_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_network_acl', + operation_id='delete_cluster_network_subnet_reserved_ip', ) headers.update(sdk_headers) @@ -17330,51 +17968,58 @@ def create_network_acl( 'generation': self.generation, } - data = json.dumps(network_acl_prototype) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/network_acls' + path_param_keys = ['cluster_network_id', 'cluster_network_subnet_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, cluster_network_subnet_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='DELETE', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_network_acl( + def get_cluster_network_subnet_reserved_ip( self, + cluster_network_id: str, + cluster_network_subnet_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a network ACL. + Retrieve a cluster network subnet reserved IP. - This request deletes a network ACL. This operation cannot be reversed. For this - request to succeed, the network ACL must not be the default network ACL for any - VPCs, and the network ACL must not be attached to any subnets. + This request retrieves a single cluster network subnet reserved IP specified by + the identifier in the URL. - :param str id: The network ACL identifier. + :param str cluster_network_id: The cluster network identifier. + :param str cluster_network_subnet_id: The cluster network subnet + identifier. + :param str id: The cluster network subnet reserved IP 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 `ClusterNetworkSubnetReservedIP` object """ + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if not cluster_network_subnet_id: + raise ValueError('cluster_network_subnet_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_network_acl', + operation_id='get_cluster_network_subnet_reserved_ip', ) headers.update(sdk_headers) @@ -17386,13 +18031,14 @@ def delete_network_acl( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id', 'cluster_network_subnet_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, cluster_network_subnet_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -17401,30 +18047,56 @@ def delete_network_acl( response = self.send(request, **kwargs) return response - def get_network_acl( + def update_cluster_network_subnet_reserved_ip( self, + cluster_network_id: str, + cluster_network_subnet_id: str, id: str, + cluster_network_subnet_reserved_ip_patch: 'ClusterNetworkSubnetReservedIPPatch', + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Retrieve a network ACL. + Update a cluster network subnet reserved IP. - This request retrieves a single network ACL specified by the identifier in the - URL. + This request updates a cluster network subnet reserved IP with the information + provided in a cluster network subnet reserved IP patch object. The patch object is + structured in the same way as a retrieved cluster network subnet reserved IP and + needs to contain only the information to be updated. - :param str id: The network ACL identifier. + :param str cluster_network_id: The cluster network identifier. + :param str cluster_network_subnet_id: The cluster network subnet + identifier. + :param str id: The cluster network subnet reserved IP identifier. + :param ClusterNetworkSubnetReservedIPPatch + cluster_network_subnet_reserved_ip_patch: The cluster network subnet + reserved IP patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :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 `NetworkACL` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkSubnetReservedIP` object """ + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if not cluster_network_subnet_id: + raise ValueError('cluster_network_subnet_id must be provided') if not id: raise ValueError('id must be provided') - headers = {} + if cluster_network_subnet_reserved_ip_patch is None: + raise ValueError('cluster_network_subnet_reserved_ip_patch must be provided') + if isinstance(cluster_network_subnet_reserved_ip_patch, ClusterNetworkSubnetReservedIPPatch): + cluster_network_subnet_reserved_ip_patch = convert_model(cluster_network_subnet_reserved_ip_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_network_acl', + operation_id='update_cluster_network_subnet_reserved_ip', ) headers.update(sdk_headers) @@ -17433,54 +18105,64 @@ def get_network_acl( 'generation': self.generation, } + data = json.dumps(cluster_network_subnet_reserved_ip_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id', 'cluster_network_subnet_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, cluster_network_subnet_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{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 - def update_network_acl( + def delete_cluster_network_subnet( self, + cluster_network_id: str, id: str, - network_acl_patch: 'NetworkACLPatch', + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Update a network ACL. + Delete a cluster network subnet. - This request updates a network ACL's name. + This request deletes a cluster network subnet. This operation cannot be reversed. + For this request to succeed, this cluster subnet must not be attached to a cluster + network interface. - :param str id: The network ACL identifier. - :param NetworkACLPatch network_acl_patch: The network ACL patch. + :param str cluster_network_id: The cluster network identifier. + :param str id: The cluster network subnet identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkSubnet` object """ + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') if not id: raise ValueError('id must be provided') - if network_acl_patch is None: - raise ValueError('network_acl_patch must be provided') - if isinstance(network_acl_patch, NetworkACLPatch): - network_acl_patch = convert_model(network_acl_patch) - headers = {} + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_network_acl', + operation_id='delete_cluster_network_subnet', ) headers.update(sdk_headers) @@ -17489,72 +18171,59 @@ def update_network_acl( 'generation': self.generation, } - data = json.dumps(network_acl_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['cluster_network_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{id}'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/subnets/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='DELETE', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_network_acl_rules( + def get_cluster_network_subnet( self, - network_acl_id: str, - *, - start: Optional[str] = None, - limit: Optional[int] = None, - direction: Optional[str] = None, + cluster_network_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List rules for a network ACL. + Retrieve a cluster network subnet. - This request lists rules for a network ACL. These rules can allow or deny traffic - between a source CIDR block and a destination CIDR block over a particular - protocol and port range. + This request retrieves a single cluster network subnet specified by the identifier + in the URL. - :param str network_acl_id: The network ACL identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str direction: (optional) Filters the collection to rules with a - `direction` property matching the specified value. + :param str cluster_network_id: The cluster network identifier. + :param str id: The cluster network subnet 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 `NetworkACLRuleCollection` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkSubnet` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') + if not cluster_network_id: + raise ValueError('cluster_network_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_network_acl_rules', + operation_id='get_cluster_network_subnet', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'direction': direction, } if 'headers' in kwargs: @@ -17562,10 +18231,10 @@ def list_network_acl_rules( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id'] - path_param_values = self.encode_path_vars(network_acl_id) + path_param_keys = ['cluster_network_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/subnets/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -17576,38 +18245,50 @@ def list_network_acl_rules( response = self.send(request, **kwargs) return response - def create_network_acl_rule( + def update_cluster_network_subnet( self, - network_acl_id: str, - network_acl_rule_prototype: 'NetworkACLRulePrototype', + cluster_network_id: str, + id: str, + cluster_network_subnet_patch: 'ClusterNetworkSubnetPatch', + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Create a rule for a network ACL. + Update a cluster network subnet. - This request creates a new rule from a network ACL rule prototype object. The - prototype object is structured in the same way as a retrieved rule, and contains - the information necessary to create the new rule. + This request updates a cluster network subnet with the information provided in a + cluster network subnet patch object. The patch object is structured in the same + way as a retrieved cluster network subnet and needs to contain only the + information to be updated. - :param str network_acl_id: The network ACL identifier. - :param NetworkACLRulePrototype network_acl_rule_prototype: The network ACL - rule prototype object. + :param str cluster_network_id: The cluster network identifier. + :param str id: The cluster network subnet identifier. + :param ClusterNetworkSubnetPatch cluster_network_subnet_patch: The cluster + network subnet patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :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 `NetworkACLRule` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetworkSubnet` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') - if network_acl_rule_prototype is None: - raise ValueError('network_acl_rule_prototype must be provided') - if isinstance(network_acl_rule_prototype, NetworkACLRulePrototype): - network_acl_rule_prototype = convert_model(network_acl_rule_prototype) - headers = {} + if not cluster_network_id: + raise ValueError('cluster_network_id must be provided') + if not id: + raise ValueError('id must be provided') + if cluster_network_subnet_patch is None: + raise ValueError('cluster_network_subnet_patch must be provided') + if isinstance(cluster_network_subnet_patch, ClusterNetworkSubnetPatch): + cluster_network_subnet_patch = convert_model(cluster_network_subnet_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_network_acl_rule', + operation_id='update_cluster_network_subnet', ) headers.update(sdk_headers) @@ -17616,20 +18297,20 @@ def create_network_acl_rule( 'generation': self.generation, } - data = json.dumps(network_acl_rule_prototype) - headers['content-type'] = 'application/json' + data = json.dumps(cluster_network_subnet_patch) + headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id'] - path_param_values = self.encode_path_vars(network_acl_id) + path_param_keys = ['cluster_network_id', 'id'] + path_param_values = self.encode_path_vars(cluster_network_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict) + url = '/cluster_networks/{cluster_network_id}/subnets/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='PATCH', url=url, headers=headers, params=params, @@ -17639,33 +18320,37 @@ def create_network_acl_rule( response = self.send(request, **kwargs) return response - def delete_network_acl_rule( + def delete_cluster_network( self, - network_acl_id: str, id: str, + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Delete a network ACL rule. + Delete a cluster network. - This request deletes a rule. This operation cannot be reversed. + This request deletes a cluster network. This operation cannot be reversed. + For this request to succeed, virtual server instances must not reside in this + cluster network. - :param str network_acl_id: The network ACL identifier. - :param str id: The rule identifier. + :param str id: The cluster network identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :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 `ClusterNetwork` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') - headers = {} + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_network_acl_rule', + operation_id='delete_cluster_network', ) headers.update(sdk_headers) @@ -17677,11 +18362,12 @@ def delete_network_acl_rule( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id', 'id'] - path_param_values = self.encode_path_vars(network_acl_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) + url = '/cluster_networks/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -17692,33 +18378,30 @@ def delete_network_acl_rule( response = self.send(request, **kwargs) return response - def get_network_acl_rule( + def get_cluster_network( self, - network_acl_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a network ACL rule. + Retrieve a cluster network. - This request retrieves a single rule specified by the identifier in the URL. + This request retrieves a single cluster network specified by the identifier in the + URL. - :param str network_acl_id: The network ACL identifier. - :param str id: The rule identifier. + :param str id: The cluster network 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 `NetworkACLRule` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetwork` object """ - if not network_acl_id: - raise ValueError('network_acl_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_network_acl_rule', + operation_id='get_cluster_network', ) headers.update(sdk_headers) @@ -17732,10 +18415,10 @@ def get_network_acl_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id', 'id'] - path_param_values = self.encode_path_vars(network_acl_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) + url = '/cluster_networks/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -17746,43 +18429,45 @@ def get_network_acl_rule( response = self.send(request, **kwargs) return response - def update_network_acl_rule( + def update_cluster_network( self, - network_acl_id: str, id: str, - network_acl_rule_patch: 'NetworkACLRulePatch', + cluster_network_patch: 'ClusterNetworkPatch', + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Update a network ACL rule. + Update a cluster. - This request updates a rule with the information in a provided rule patch. The - rule patch object contains only the information to be updated. The request will - fail if the provided patch includes properties that are not used by the rule's - protocol. + This request updates a cluster network with the information provided in a cluster + network patch object. The patch object is structured in the same way as a + retrieved cluster network and needs to contain only the information to be updated. - :param str network_acl_id: The network ACL identifier. - :param str id: The rule identifier. - :param NetworkACLRulePatch network_acl_rule_patch: The network ACL rule + :param str id: The cluster network identifier. + :param ClusterNetworkPatch cluster_network_patch: The cluster network patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :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 `NetworkACLRule` object + :rtype: DetailedResponse with `dict` result representing a `ClusterNetwork` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') - if network_acl_rule_patch is None: - raise ValueError('network_acl_rule_patch must be provided') - if isinstance(network_acl_rule_patch, NetworkACLRulePatch): - network_acl_rule_patch = convert_model(network_acl_rule_patch) - headers = {} + if cluster_network_patch is None: + raise ValueError('cluster_network_patch must be provided') + if isinstance(cluster_network_patch, ClusterNetworkPatch): + cluster_network_patch = convert_model(cluster_network_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_network_acl_rule', + operation_id='update_cluster_network', ) headers.update(sdk_headers) @@ -17791,7 +18476,7 @@ def update_network_acl_rule( 'generation': self.generation, } - data = json.dumps(network_acl_rule_patch) + data = json.dumps(cluster_network_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -17799,10 +18484,10 @@ def update_network_acl_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id', 'id'] - path_param_values = self.encode_path_vars(network_acl_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) + url = '/cluster_networks/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -17815,28 +18500,24 @@ def update_network_acl_rule( return response ######################### - # Security groups + # Public gateways ######################### - def list_security_groups( + def list_public_gateways( self, *, start: Optional[str] = None, limit: Optional[int] = None, resource_group_id: Optional[str] = None, - vpc_id: Optional[str] = None, - vpc_crn: Optional[str] = None, - vpc_name: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List security groups. + List public gateways. - This request lists security groups in the region. Security groups provide a way to - apply IP filtering rules to instances in the associated VPC. With security groups, - all traffic is denied by default, and rules added to security groups define which - traffic the security group permits. Security group rules are stateful such that - reverse traffic in response to allowed traffic is automatically permitted. + This request lists public gateways in the region. A public gateway is a virtual + network device associated with a VPC, which allows access to the Internet. A + public gateway resides in a zone and can be connected to subnets in the same zone + only. :param str start: (optional) A server-provided token determining what resource to start the page on. @@ -17844,22 +18525,16 @@ def list_security_groups( :param str resource_group_id: (optional) Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - :param str vpc_id: (optional) Filters the collection to resources with a - `vpc.id` property matching the specified identifier. - :param str vpc_crn: (optional) Filters the collection to resources with a - `vpc.crn` property matching the specified CRN. - :param str vpc_name: (optional) Filters the collection to resources with a - `vpc.name` property matching the exact specified 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 `SecurityGroupCollection` object + :rtype: DetailedResponse with `dict` result representing a `PublicGatewayCollection` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_security_groups', + operation_id='list_public_gateways', ) headers.update(sdk_headers) @@ -17869,9 +18544,6 @@ def list_security_groups( 'start': start, 'limit': limit, 'resource_group.id': resource_group_id, - 'vpc.id': vpc_id, - 'vpc.crn': vpc_crn, - 'vpc.name': vpc_name, } if 'headers' in kwargs: @@ -17879,7 +18551,7 @@ def list_security_groups( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/security_groups' + url = '/public_gateways' request = self.prepare_request( method='GET', url=url, @@ -17890,53 +18562,57 @@ def list_security_groups( response = self.send(request, **kwargs) return response - def create_security_group( + def create_public_gateway( self, vpc: 'VPCIdentity', + zone: 'ZoneIdentity', *, + floating_ip: Optional['PublicGatewayFloatingIPPrototype'] = None, name: Optional[str] = None, resource_group: Optional['ResourceGroupIdentity'] = None, - rules: Optional[List['SecurityGroupRulePrototype']] = None, **kwargs, ) -> DetailedResponse: """ - Create a security group. + Create a public gateway. - This request creates a new security group from a security group prototype object. - The prototype object is structured in the same way as a retrieved security group, - and contains the information necessary to create the new security group. If - security group rules are included in the prototype object, those rules will be - added to the security group. Each security group is scoped to one VPC. Only - resources in that VPC can be added to the security group. + This request creates a new public gateway from a public gateway prototype object. + For this to succeed, the VPC must not already have a public gateway in the + specified zone. + If a floating IP is provided, it must be unbound. If a floating IP is not + provided, one will be created and bound to the public gateway. Once a public + gateway has been created, its floating IP cannot be unbound. A public gateway must + be explicitly attached to each subnet it will provide connectivity for. - :param VPCIdentity vpc: The VPC this security group will reside in. - :param str name: (optional) The name for this security group. The name must - not be used by another security group for the VPC. If unspecified, the name + :param VPCIdentity vpc: The VPC this public gateway will reside in. + :param ZoneIdentity zone: The zone this public gateway will reside in. + :param PublicGatewayFloatingIPPrototype floating_ip: (optional) + :param str name: (optional) The name for this public gateway. The name must + not be used by another public gateway in the VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - :param List[SecurityGroupRulePrototype] rules: (optional) The prototype - objects for rules to be created for this security group. If unspecified, no - rules will be created, resulting in all traffic being denied. :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 `SecurityGroup` object + :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ if vpc is None: raise ValueError('vpc must be provided') + if zone is None: + raise ValueError('zone must be provided') vpc = convert_model(vpc) + zone = convert_model(zone) + if floating_ip is not None: + floating_ip = convert_model(floating_ip) if resource_group is not None: resource_group = convert_model(resource_group) - if rules is not None: - rules = [convert_model(x) for x in rules] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_security_group', + operation_id='create_public_gateway', ) headers.update(sdk_headers) @@ -17947,9 +18623,10 @@ def create_security_group( data = { 'vpc': vpc, + 'zone': zone, + 'floating_ip': floating_ip, 'name': name, 'resource_group': resource_group, - 'rules': rules, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -17960,7 +18637,7 @@ def create_security_group( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/security_groups' + url = '/public_gateways' request = self.prepare_request( method='POST', url=url, @@ -17972,19 +18649,20 @@ def create_security_group( response = self.send(request, **kwargs) return response - def delete_security_group( + def delete_public_gateway( self, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a security group. + Delete a public gateway. - This request deletes a security group. A security group cannot be deleted if it is - referenced by any security group targets or rules. Additionally, a VPC's default - security group cannot be deleted. This operation cannot be reversed. + This request deletes a public gateway. This operation cannot be reversed. For this + request to succeed, the public gateway must not be attached to any subnets. The + public gateway's floating IP will be automatically unbound. If the floating IP was + created when the public gateway was created, it will be deleted. - :param str id: The security group identifier. + :param str id: The public gateway identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -17996,7 +18674,7 @@ def delete_security_group( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_security_group', + operation_id='delete_public_gateway', ) headers.update(sdk_headers) @@ -18012,7 +18690,7 @@ def delete_security_group( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{id}'.format(**path_param_dict) + url = '/public_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -18023,21 +18701,21 @@ def delete_security_group( response = self.send(request, **kwargs) return response - def get_security_group( + def get_public_gateway( self, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a security group. + Retrieve a public gateway. - This request retrieves a single security group specified by the identifier in the - URL path. + This request retrieves a single public gateway specified by the identifier in the + URL. - :param str id: The security group identifier. + :param str id: The public 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 `SecurityGroup` object + :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ if not id: @@ -18046,7 +18724,7 @@ def get_security_group( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_security_group', + operation_id='get_public_gateway', ) headers.update(sdk_headers) @@ -18063,7 +18741,7 @@ def get_security_group( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{id}'.format(**path_param_dict) + url = '/public_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -18074,37 +18752,35 @@ def get_security_group( response = self.send(request, **kwargs) return response - def update_security_group( + def update_public_gateway( self, id: str, - security_group_patch: 'SecurityGroupPatch', + public_gateway_patch: 'PublicGatewayPatch', **kwargs, ) -> DetailedResponse: """ - Update a security group. + Update a public gateway. - This request updates a security group with the information provided in a security - group patch object. The security group patch object is structured in the same way - as a retrieved security group and contains only the information to be updated. + This request updates a public gateway's name. - :param str id: The security group identifier. - :param SecurityGroupPatch security_group_patch: The security group patch. + :param str id: The public gateway identifier. + :param PublicGatewayPatch public_gateway_patch: The public gateway patch. :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 `SecurityGroup` object + :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ if not id: raise ValueError('id must be provided') - if security_group_patch is None: - raise ValueError('security_group_patch must be provided') - if isinstance(security_group_patch, SecurityGroupPatch): - security_group_patch = convert_model(security_group_patch) + if public_gateway_patch is None: + raise ValueError('public_gateway_patch must be provided') + if isinstance(public_gateway_patch, PublicGatewayPatch): + public_gateway_patch = convert_model(public_gateway_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_security_group', + operation_id='update_public_gateway', ) headers.update(sdk_headers) @@ -18113,7 +18789,7 @@ def update_security_group( 'generation': self.generation, } - data = json.dumps(security_group_patch) + data = json.dumps(public_gateway_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -18124,7 +18800,7 @@ def update_security_group( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{id}'.format(**path_param_dict) + url = '/public_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -18136,37 +18812,73 @@ def update_security_group( response = self.send(request, **kwargs) return response - def list_security_group_rules( + ######################### + # Floating IPs + ######################### + + def list_floating_ips( self, - security_group_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + resource_group_id: Optional[str] = None, + sort: Optional[str] = None, + target_id: Optional[str] = None, + target_crn: Optional[str] = None, + target_name: Optional[str] = None, + target_resource_type: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List rules in a security group. + List floating IPs. - This request lists rules in a security group. These rules define what traffic the - security group permits. Security group rules are stateful, such that reverse - traffic in response to allowed traffic is automatically permitted. + This request lists floating IPs in the region. Floating IPs allow inbound and + outbound traffic from the Internet to an instance. - :param str security_group_id: The security group identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str target_id: (optional) Filters the collection to resources with a + `target.id` property matching the specified identifier. + :param str target_crn: (optional) Filters the collection to resources with + a `target.crn` property matching the specified CRN. + :param str target_name: (optional) Filters the collection to resources with + a `target.name` property matching the exact specified name. + :param str target_resource_type: (optional) Filters the collection to + resources with a `target.resource_type` property matching the specified + value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRuleCollection` object + :rtype: DetailedResponse with `dict` result representing a `FloatingIPCollection` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_security_group_rules', + operation_id='list_floating_ips', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'sort': sort, + 'target.id': target_id, + 'target.crn': target_crn, + 'target.name': target_name, + 'target.resource_type': target_resource_type, } if 'headers' in kwargs: @@ -18174,10 +18886,7 @@ def list_security_group_rules( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id'] - path_param_values = self.encode_path_vars(security_group_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict) + url = '/floating_ips' request = self.prepare_request( method='GET', url=url, @@ -18188,44 +18897,32 @@ def list_security_group_rules( response = self.send(request, **kwargs) return response - def create_security_group_rule( + def create_floating_ip( self, - security_group_id: str, - security_group_rule_prototype: 'SecurityGroupRulePrototype', + floating_ip_prototype: 'FloatingIPPrototype', **kwargs, ) -> DetailedResponse: """ - Create a rule for a security group. + Reserve a floating IP. - This request creates a new security group rule from a security group rule - prototype object. The prototype object is structured in the same way as a - retrieved security group rule and contains the information necessary to create the - rule. As part of creating a new rule in a security group, the rule is applied to - all the networking interfaces in the security group. Rules specify which IP - traffic a security group will allow. Security group rules are stateful, such that - reverse traffic in response to allowed traffic is automatically permitted. A rule - allowing inbound TCP traffic on port 80 also allows outbound TCP traffic on port - 80 without the need for an additional rule. + This request reserves a new floating IP. - :param str security_group_id: The security group identifier. - :param SecurityGroupRulePrototype security_group_rule_prototype: The - properties of the security group rule to be created. + :param FloatingIPPrototype floating_ip_prototype: The floating IP prototype + object. :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 `SecurityGroupRule` object + :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') - if security_group_rule_prototype is None: - raise ValueError('security_group_rule_prototype must be provided') - if isinstance(security_group_rule_prototype, SecurityGroupRulePrototype): - security_group_rule_prototype = convert_model(security_group_rule_prototype) + if floating_ip_prototype is None: + raise ValueError('floating_ip_prototype must be provided') + if isinstance(floating_ip_prototype, FloatingIPPrototype): + floating_ip_prototype = convert_model(floating_ip_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_security_group_rule', + operation_id='create_floating_ip', ) headers.update(sdk_headers) @@ -18234,7 +18931,7 @@ def create_security_group_rule( 'generation': self.generation, } - data = json.dumps(security_group_rule_prototype) + data = json.dumps(floating_ip_prototype) headers['content-type'] = 'application/json' if 'headers' in kwargs: @@ -18242,10 +18939,7 @@ def create_security_group_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id'] - path_param_values = self.encode_path_vars(security_group_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict) + url = '/floating_ips' request = self.prepare_request( method='POST', url=url, @@ -18257,35 +18951,31 @@ def create_security_group_rule( response = self.send(request, **kwargs) return response - def delete_security_group_rule( + def delete_floating_ip( self, - security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a security group rule. + Delete a floating IP. - This request deletes a security group rule. This operation cannot be reversed. - Removing a security group rule will not end existing connections allowed by that - rule. + This request disassociates (if associated) and releases a floating IP. This + operation cannot be reversed. For this request to succeed, the floating IP must + not be required by another resource, such as a public gateway. - :param str security_group_id: The security group identifier. - :param str id: The rule identifier. + :param str id: The floating IP 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 security_group_id: - raise ValueError('security_group_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_security_group_rule', + operation_id='delete_floating_ip', ) headers.update(sdk_headers) @@ -18298,10 +18988,10 @@ def delete_security_group_rule( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) + url = '/floating_ips/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -18312,34 +19002,30 @@ def delete_security_group_rule( response = self.send(request, **kwargs) return response - def get_security_group_rule( + def get_floating_ip( self, - security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a security group rule. + Retrieve a floating IP. - This request retrieves a single security group rule specified by the identifier in - the URL path. + This request retrieves a single floating IP specified by the identifier in the + URL. - :param str security_group_id: The security group identifier. - :param str id: The rule identifier. + :param str id: The floating IP 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 `SecurityGroupRule` object + :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if not security_group_id: - raise ValueError('security_group_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_security_group_rule', + operation_id='get_floating_ip', ) headers.update(sdk_headers) @@ -18353,10 +19039,10 @@ def get_security_group_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) + url = '/floating_ips/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -18367,43 +19053,35 @@ def get_security_group_rule( response = self.send(request, **kwargs) return response - def update_security_group_rule( + def update_floating_ip( self, - security_group_id: str, id: str, - security_group_rule_patch: 'SecurityGroupRulePatch', + floating_ip_patch: 'FloatingIPPatch', **kwargs, ) -> DetailedResponse: """ - Update a security group rule. + Update a floating IP. - This request updates a security group rule with the information in a provided rule - patch object. The rule patch object contains only the information to be updated. - The request will fail if the provided patch includes properties that are not used - by the rule's protocol. + This request updates a floating IP's name and/or target. - :param str security_group_id: The security group identifier. - :param str id: The rule identifier. - :param SecurityGroupRulePatch security_group_rule_patch: The security group - rule patch. + :param str id: The floating IP identifier. + :param FloatingIPPatch floating_ip_patch: The floating IP patch. :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 `SecurityGroupRule` object + :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') - if security_group_rule_patch is None: - raise ValueError('security_group_rule_patch must be provided') - if isinstance(security_group_rule_patch, SecurityGroupRulePatch): - security_group_rule_patch = convert_model(security_group_rule_patch) + if floating_ip_patch is None: + raise ValueError('floating_ip_patch must be provided') + if isinstance(floating_ip_patch, FloatingIPPatch): + floating_ip_patch = convert_model(floating_ip_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_security_group_rule', + operation_id='update_floating_ip', ) headers.update(sdk_headers) @@ -18412,7 +19090,7 @@ def update_security_group_rule( 'generation': self.generation, } - data = json.dumps(security_group_rule_patch) + data = json.dumps(floating_ip_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -18420,10 +19098,10 @@ def update_security_group_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) + url = '/floating_ips/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -18435,36 +19113,42 @@ def update_security_group_rule( response = self.send(request, **kwargs) return response - def list_security_group_targets( + ######################### + # Network ACLs + ######################### + + def list_network_acls( self, - security_group_id: str, *, start: Optional[str] = None, limit: Optional[int] = None, + resource_group_id: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List targets associated with a security group. + List network ACLs. - This request lists targets associated with a security group, to which the rules in - the security group are applied. + This request lists network ACLs in the region. A network ACL defines a set of + packet filtering (5-tuple) rules for all traffic in and out of a subnet. Both + allow and deny rules can be defined, and rules are stateless such that reverse + traffic in response to allowed traffic is not automatically permitted. - :param str security_group_id: The security group identifier. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + 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 `SecurityGroupTargetCollection` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLCollection` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_security_group_targets', + operation_id='list_network_acls', ) headers.update(sdk_headers) @@ -18473,6 +19157,7 @@ def list_security_group_targets( 'generation': self.generation, 'start': start, 'limit': limit, + 'resource_group.id': resource_group_id, } if 'headers' in kwargs: @@ -18480,10 +19165,7 @@ def list_security_group_targets( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id'] - path_param_values = self.encode_path_vars(security_group_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/targets'.format(**path_param_dict) + url = '/network_acls' request = self.prepare_request( method='GET', url=url, @@ -18494,43 +19176,34 @@ def list_security_group_targets( response = self.send(request, **kwargs) return response - def delete_security_group_target_binding( + def create_network_acl( self, - security_group_id: str, - id: str, + network_acl_prototype: 'NetworkACLPrototype', **kwargs, ) -> DetailedResponse: """ - Remove a target from a security group. + Create a network ACL. - This request removes a target from a security group. For this request to succeed, - the target must be attached to at least one other security group. The specified - target identifier can be: - - A bare metal server network interface identifier - - A virtual network interface identifier - - A VPN server identifier - - A load balancer identifier - - An endpoint gateway identifier - - An instance network interface identifier - Security groups are stateful, so any changes to a target's security groups are - applied to new connections. Existing connections are not affected. + This request creates a new stateless network ACL from a network ACL prototype + object. The prototype object is structured in the same way as a retrieved network + ACL, and contains the information necessary to create the new network ACL. - :param str security_group_id: The security group identifier. - :param str id: The security group target identifier. + :param NetworkACLPrototype network_acl_prototype: The network ACL prototype + object. :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 `NetworkACL` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') - if not id: - raise ValueError('id must be provided') + if network_acl_prototype is None: + raise ValueError('network_acl_prototype must be provided') + if isinstance(network_acl_prototype, NetworkACLPrototype): + network_acl_prototype = convert_model(network_acl_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_security_group_target_binding', + operation_id='create_network_acl', ) headers.update(sdk_headers) @@ -18539,52 +19212,51 @@ def delete_security_group_target_binding( 'generation': self.generation, } + data = json.dumps(network_acl_prototype) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) + url = '/network_acls' request = self.prepare_request( - method='DELETE', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def get_security_group_target( + def delete_network_acl( self, - security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a security group target. + Delete a network ACL. - This request retrieves a single target specified by the identifier in the URL - path. The target must be an existing target of the security group. + This request deletes a network ACL. This operation cannot be reversed. For this + request to succeed, the network ACL must not be the default network ACL for any + VPCs, and the network ACL must not be attached to any subnets. - :param str security_group_id: The security group identifier. - :param str id: The security group target identifier. + :param str id: The network ACL 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 `SecurityGroupTargetReference` object + :rtype: DetailedResponse """ - if not security_group_id: - raise ValueError('security_group_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_security_group_target', + operation_id='delete_network_acl', ) headers.update(sdk_headers) @@ -18596,14 +19268,13 @@ def get_security_group_target( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) + url = '/network_acls/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -18612,42 +19283,30 @@ def get_security_group_target( response = self.send(request, **kwargs) return response - def create_security_group_target_binding( + def get_network_acl( self, - security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Add a target to a security group. + Retrieve a network ACL. - This request adds a resource to an existing security group. The specified target - identifier can be: - - A bare metal server network interface identifier - - A virtual network interface identifier - - A VPN server identifier - - A load balancer identifier - - An endpoint gateway identifier - - An instance network interface identifier - When a target is added to a security group, the security group rules are applied - to the target. A request body is not required, and if provided, is ignored. + This request retrieves a single network ACL specified by the identifier in the + URL. - :param str security_group_id: The security group identifier. - :param str id: The security group target identifier. + :param str id: The network ACL 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 `SecurityGroupTargetReference` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object """ - if not security_group_id: - raise ValueError('security_group_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='create_security_group_target_binding', + operation_id='get_network_acl', ) headers.update(sdk_headers) @@ -18661,12 +19320,12 @@ def create_security_group_target_binding( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) + url = '/network_acls/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='GET', url=url, headers=headers, params=params, @@ -18675,173 +19334,162 @@ def create_security_group_target_binding( response = self.send(request, **kwargs) return response - ######################### - # VPN gateways - ######################### - - def list_ike_policies( + def update_network_acl( self, - *, - start: Optional[str] = None, - limit: Optional[int] = None, + id: str, + network_acl_patch: 'NetworkACLPatch', **kwargs, ) -> DetailedResponse: """ - List IKE policies. + Update a network ACL. - This request lists IKE policies in the region. + This request updates a network ACL's name. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. + :param str id: The network ACL identifier. + :param NetworkACLPatch network_acl_patch: The network ACL patch. :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 `IKEPolicyCollection` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object """ + if not id: + raise ValueError('id must be provided') + if network_acl_patch is None: + raise ValueError('network_acl_patch must be provided') + if isinstance(network_acl_patch, NetworkACLPatch): + network_acl_patch = convert_model(network_acl_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_ike_policies', + operation_id='update_network_acl', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, } + data = json.dumps(network_acl_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/ike_policies' + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/network_acls/{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 - def create_ike_policy( + def list_network_acl_rules( self, - authentication_algorithm: str, - dh_group: int, - encryption_algorithm: str, - ike_version: int, + network_acl_id: str, *, - key_lifetime: Optional[int] = None, - name: Optional[str] = None, - resource_group: Optional['ResourceGroupIdentity'] = None, + start: Optional[str] = None, + limit: Optional[int] = None, + direction: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Create an IKE policy. + List rules for a network ACL. - This request creates a new IKE policy. + This request lists rules for a network ACL. These rules can allow or deny traffic + between a source CIDR block and a destination CIDR block over a particular + protocol and port range. - :param str authentication_algorithm: The authentication algorithm. - :param int dh_group: The Diffie-Hellman group. - :param str encryption_algorithm: The encryption algorithm. - :param int ike_version: The IKE protocol version. - :param int key_lifetime: (optional) The key lifetime in seconds. - :param str name: (optional) The name for this IKE policy. The name must not - be used by another IKE policies in the region. If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. + :param str network_acl_id: The network ACL identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str direction: (optional) Filters the collection to rules with a + `direction` property matching the specified value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLRuleCollection` object """ - if authentication_algorithm is None: - raise ValueError('authentication_algorithm must be provided') - if dh_group is None: - raise ValueError('dh_group must be provided') - if encryption_algorithm is None: - raise ValueError('encryption_algorithm must be provided') - if ike_version is None: - raise ValueError('ike_version must be provided') - if resource_group is not None: - resource_group = convert_model(resource_group) + if not network_acl_id: + raise ValueError('network_acl_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_ike_policy', + operation_id='list_network_acl_rules', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'direction': direction, } - data = { - 'authentication_algorithm': authentication_algorithm, - 'dh_group': dh_group, - 'encryption_algorithm': encryption_algorithm, - 'ike_version': ike_version, - 'key_lifetime': key_lifetime, - 'name': name, - 'resource_group': resource_group, - } - 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' - url = '/ike_policies' + path_param_keys = ['network_acl_id'] + path_param_values = self.encode_path_vars(network_acl_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/network_acls/{network_acl_id}/rules'.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 delete_ike_policy( + def create_network_acl_rule( self, - id: str, + network_acl_id: str, + network_acl_rule_prototype: 'NetworkACLRulePrototype', **kwargs, ) -> DetailedResponse: """ - Delete an IKE policy. + Create a rule for a network ACL. - This request deletes an IKE policy. This operation cannot be reversed. For this - request to succeed, there must not be any VPN gateway connections using this - policy. + This request creates a new rule from a network ACL rule prototype object. The + prototype object is structured in the same way as a retrieved rule, and contains + the information necessary to create the new rule. - :param str id: The IKE policy identifier. + :param str network_acl_id: The network ACL identifier. + :param NetworkACLRulePrototype network_acl_rule_prototype: The network ACL + rule prototype object. :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 `NetworkACLRule` object """ - if not id: - raise ValueError('id must be provided') + if not network_acl_id: + raise ValueError('network_acl_id must be provided') + if network_acl_rule_prototype is None: + raise ValueError('network_acl_rule_prototype must be provided') + if isinstance(network_acl_rule_prototype, NetworkACLRulePrototype): + network_acl_rule_prototype = convert_model(network_acl_rule_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_ike_policy', + operation_id='create_network_acl_rule', ) headers.update(sdk_headers) @@ -18850,47 +19498,56 @@ def delete_ike_policy( 'generation': self.generation, } + data = json.dumps(network_acl_rule_prototype) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['network_acl_id'] + path_param_values = self.encode_path_vars(network_acl_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ike_policies/{id}'.format(**path_param_dict) + url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def get_ike_policy( + def delete_network_acl_rule( self, + network_acl_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve an IKE policy. + Delete a network ACL rule. - This request retrieves a single IKE policy specified by the identifier in the URL. + This request deletes a rule. This operation cannot be reversed. - :param str id: The IKE policy identifier. + :param str network_acl_id: The network ACL identifier. + :param str id: The rule 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 `IKEPolicy` object + :rtype: DetailedResponse """ + if not network_acl_id: + raise ValueError('network_acl_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_ike_policy', + operation_id='delete_network_acl_rule', ) headers.update(sdk_headers) @@ -18902,14 +19559,13 @@ def get_ike_policy( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['network_acl_id', 'id'] + path_param_values = self.encode_path_vars(network_acl_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ike_policies/{id}'.format(**path_param_dict) + url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -18918,35 +19574,33 @@ def get_ike_policy( response = self.send(request, **kwargs) return response - def update_ike_policy( + def get_network_acl_rule( self, + network_acl_id: str, id: str, - ike_policy_patch: 'IKEPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Update an IKE policy. + Retrieve a network ACL rule. - This request updates the properties of an existing IKE policy. + This request retrieves a single rule specified by the identifier in the URL. - :param str id: The IKE policy identifier. - :param IKEPolicyPatch ike_policy_patch: The IKE policy patch. + :param str network_acl_id: The network ACL identifier. + :param str id: The rule 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 `IKEPolicy` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object """ + if not network_acl_id: + raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') - if ike_policy_patch is None: - raise ValueError('ike_policy_patch must be provided') - if isinstance(ike_policy_patch, IKEPolicyPatch): - ike_policy_patch = convert_model(ike_policy_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_ike_policy', + operation_id='get_network_acl_rule', ) headers.update(sdk_headers) @@ -18955,112 +19609,139 @@ def update_ike_policy( 'generation': self.generation, } - data = json.dumps(ike_policy_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['network_acl_id', 'id'] + path_param_values = self.encode_path_vars(network_acl_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ike_policies/{id}'.format(**path_param_dict) + url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_ike_policy_connections( + def update_network_acl_rule( self, + network_acl_id: str, id: str, - *, - start: Optional[str] = None, - limit: Optional[int] = None, + network_acl_rule_patch: 'NetworkACLRulePatch', **kwargs, ) -> DetailedResponse: """ - List VPN gateway connections that use a specified IKE policy. + Update a network ACL rule. - This request lists VPN gateway connections that use a IKE policy. + This request updates a rule with the information in a provided rule patch. The + rule patch object contains only the information to be updated. The request will + fail if the provided patch includes properties that are not used by the rule's + protocol. - :param str id: The IKE policy identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. + :param str network_acl_id: The network ACL identifier. + :param str id: The rule identifier. + :param NetworkACLRulePatch network_acl_rule_patch: The network ACL rule + patch. :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 `IKEPolicyConnectionCollection` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object """ + if not network_acl_id: + raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') + if network_acl_rule_patch is None: + raise ValueError('network_acl_rule_patch must be provided') + if isinstance(network_acl_rule_patch, NetworkACLRulePatch): + network_acl_rule_patch = convert_model(network_acl_rule_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_ike_policy_connections', + operation_id='update_network_acl_rule', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, } + data = json.dumps(network_acl_rule_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['network_acl_id', 'id'] + path_param_values = self.encode_path_vars(network_acl_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ike_policies/{id}/connections'.format(**path_param_dict) + url = '/network_acls/{network_acl_id}/rules/{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 - def list_ipsec_policies( + ######################### + # Security groups + ######################### + + def list_security_groups( self, *, start: Optional[str] = None, limit: Optional[int] = None, + resource_group_id: Optional[str] = None, + vpc_id: Optional[str] = None, + vpc_crn: Optional[str] = None, + vpc_name: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List IPsec policies. + List security groups. - This request lists IPsec policies in the region. + This request lists security groups in the region. Security groups provide a way to + apply IP filtering rules to instances in the associated VPC. With security groups, + all traffic is denied by default, and rules added to security groups define which + traffic the security group permits. Security group rules are stateful such that + reverse traffic in response to allowed traffic is automatically permitted. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str vpc_id: (optional) Filters the collection to resources with a + `vpc.id` property matching the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources with a + `vpc.crn` property matching the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources with a + `vpc.name` property matching the exact specified 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 `IPsecPolicyCollection` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupCollection` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_ipsec_policies', + operation_id='list_security_groups', ) headers.update(sdk_headers) @@ -19069,6 +19750,10 @@ def list_ipsec_policies( 'generation': self.generation, 'start': start, 'limit': limit, + 'resource_group.id': resource_group_id, + 'vpc.id': vpc_id, + 'vpc.crn': vpc_crn, + 'vpc.name': vpc_name, } if 'headers' in kwargs: @@ -19076,7 +19761,7 @@ def list_ipsec_policies( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/ipsec_policies' + url = '/security_groups' request = self.prepare_request( method='GET', url=url, @@ -19087,59 +19772,53 @@ def list_ipsec_policies( response = self.send(request, **kwargs) return response - def create_ipsec_policy( + def create_security_group( self, - authentication_algorithm: str, - encryption_algorithm: str, - pfs: str, + vpc: 'VPCIdentity', *, - key_lifetime: Optional[int] = None, name: Optional[str] = None, resource_group: Optional['ResourceGroupIdentity'] = None, + rules: Optional[List['SecurityGroupRulePrototype']] = None, **kwargs, ) -> DetailedResponse: """ - Create an IPsec policy. + Create a security group. - This request creates a new IPsec policy. + This request creates a new security group from a security group prototype object. + The prototype object is structured in the same way as a retrieved security group, + and contains the information necessary to create the new security group. If + security group rules are included in the prototype object, those rules will be + added to the security group. Each security group is scoped to one VPC. Only + resources in that VPC can be added to the security group. - :param str authentication_algorithm: The authentication algorithm - Must be `disabled` if and only if the `encryption_algorithm` is - `aes128gcm16`, - `aes192gcm16`, or `aes256gcm16` - The `md5` and `sha1` algorithms have been deprecated. - :param str encryption_algorithm: The encryption algorithm - The `authentication_algorithm` must be `disabled` if and only if - `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or `aes256gcm16` - The `triple_des` algorithm has been deprecated. - :param str pfs: The Perfect Forward Secrecy group. - Groups `group_2` and `group_5` have been deprecated. - :param int key_lifetime: (optional) The key lifetime in seconds. - :param str name: (optional) The name for this IPsec policy. The name must - not be used by another IPsec policies in the region. If unspecified, the - name will be a hyphenated list of randomly-selected words. + :param VPCIdentity vpc: The VPC this security group will reside in. + :param str name: (optional) The name for this security group. The name must + not be used by another security group for the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + :param List[SecurityGroupRulePrototype] rules: (optional) The prototype + objects for rules to be created for this security group. If unspecified, no + rules will be created, resulting in all traffic being denied. :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 `IPsecPolicy` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object """ - if authentication_algorithm is None: - raise ValueError('authentication_algorithm must be provided') - if encryption_algorithm is None: - raise ValueError('encryption_algorithm must be provided') - if pfs is None: - raise ValueError('pfs must be provided') + if vpc is None: + raise ValueError('vpc must be provided') + vpc = convert_model(vpc) if resource_group is not None: resource_group = convert_model(resource_group) + if rules is not None: + rules = [convert_model(x) for x in rules] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_ipsec_policy', + operation_id='create_security_group', ) headers.update(sdk_headers) @@ -19149,12 +19828,10 @@ def create_ipsec_policy( } data = { - 'authentication_algorithm': authentication_algorithm, - 'encryption_algorithm': encryption_algorithm, - 'pfs': pfs, - 'key_lifetime': key_lifetime, + 'vpc': vpc, 'name': name, 'resource_group': resource_group, + 'rules': rules, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -19165,7 +19842,7 @@ def create_ipsec_policy( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/ipsec_policies' + url = '/security_groups' request = self.prepare_request( method='POST', url=url, @@ -19177,19 +19854,19 @@ def create_ipsec_policy( response = self.send(request, **kwargs) return response - def delete_ipsec_policy( + def delete_security_group( self, id: str, **kwargs, ) -> DetailedResponse: """ - Delete an IPsec policy. + Delete a security group. - This request deletes an IPsec policy. This operation cannot be reversed. For this - request to succeed, there must not be any VPN gateway connections using this - policy. + This request deletes a security group. A security group cannot be deleted if it is + referenced by any security group targets or rules. Additionally, a VPC's default + security group cannot be deleted. This operation cannot be reversed. - :param str id: The IPsec policy identifier. + :param str id: The security group identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -19201,7 +19878,7 @@ def delete_ipsec_policy( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_ipsec_policy', + operation_id='delete_security_group', ) headers.update(sdk_headers) @@ -19217,7 +19894,7 @@ def delete_ipsec_policy( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ipsec_policies/{id}'.format(**path_param_dict) + url = '/security_groups/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -19228,21 +19905,21 @@ def delete_ipsec_policy( response = self.send(request, **kwargs) return response - def get_ipsec_policy( + def get_security_group( self, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve an IPsec policy. + Retrieve a security group. - This request retrieves a single IPsec policy specified by the identifier in the - URL. + This request retrieves a single security group specified by the identifier in the + URL path. - :param str id: The IPsec policy identifier. + :param str id: The security group identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object """ if not id: @@ -19251,7 +19928,7 @@ def get_ipsec_policy( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_ipsec_policy', + operation_id='get_security_group', ) headers.update(sdk_headers) @@ -19268,7 +19945,7 @@ def get_ipsec_policy( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ipsec_policies/{id}'.format(**path_param_dict) + url = '/security_groups/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -19279,35 +19956,37 @@ def get_ipsec_policy( response = self.send(request, **kwargs) return response - def update_ipsec_policy( + def update_security_group( self, id: str, - i_psec_policy_patch: 'IPsecPolicyPatch', + security_group_patch: 'SecurityGroupPatch', **kwargs, ) -> DetailedResponse: """ - Update an IPsec policy. + Update a security group. - This request updates the properties of an existing IPsec policy. + This request updates a security group with the information provided in a security + group patch object. The security group patch object is structured in the same way + as a retrieved security group and contains only the information to be updated. - :param str id: The IPsec policy identifier. - :param IPsecPolicyPatch i_psec_policy_patch: The IPsec policy patch. + :param str id: The security group identifier. + :param SecurityGroupPatch security_group_patch: The security group patch. :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 `IPsecPolicy` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object """ if not id: raise ValueError('id must be provided') - if i_psec_policy_patch is None: - raise ValueError('i_psec_policy_patch must be provided') - if isinstance(i_psec_policy_patch, IPsecPolicyPatch): - i_psec_policy_patch = convert_model(i_psec_policy_patch) + if security_group_patch is None: + raise ValueError('security_group_patch must be provided') + if isinstance(security_group_patch, SecurityGroupPatch): + security_group_patch = convert_model(security_group_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_ipsec_policy', + operation_id='update_security_group', ) headers.update(sdk_headers) @@ -19316,7 +19995,7 @@ def update_ipsec_policy( 'generation': self.generation, } - data = json.dumps(i_psec_policy_patch) + data = json.dumps(security_group_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -19327,7 +20006,7 @@ def update_ipsec_policy( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ipsec_policies/{id}'.format(**path_param_dict) + url = '/security_groups/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -19339,43 +20018,37 @@ def update_ipsec_policy( response = self.send(request, **kwargs) return response - def list_ipsec_policy_connections( + def list_security_group_rules( self, - id: str, - *, - start: Optional[str] = None, - limit: Optional[int] = None, + security_group_id: str, **kwargs, ) -> DetailedResponse: """ - List VPN gateway connections that use a specified IPsec policy. + List rules in a security group. - This request lists VPN gateway connections that use a IPsec policy. + This request lists rules in a security group. These rules define what traffic the + security group permits. Security group rules are stateful, such that reverse + traffic in response to allowed traffic is automatically permitted. - :param str id: The IPsec policy identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. + :param str security_group_id: The security group identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IPsecPolicyConnectionCollection` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRuleCollection` object """ - if not id: - raise ValueError('id must be provided') + if not security_group_id: + raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_ipsec_policy_connections', + operation_id='list_security_group_rules', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, } if 'headers' in kwargs: @@ -19383,77 +20056,10 @@ def list_ipsec_policy_connections( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['security_group_id'] + path_param_values = self.encode_path_vars(security_group_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ipsec_policies/{id}/connections'.format(**path_param_dict) - request = self.prepare_request( - method='GET', - url=url, - headers=headers, - params=params, - ) - - response = self.send(request, **kwargs) - return response - - def list_vpn_gateways( - self, - *, - start: Optional[str] = None, - limit: Optional[int] = None, - resource_group_id: Optional[str] = None, - sort: Optional[str] = None, - mode: Optional[str] = None, - **kwargs, - ) -> DetailedResponse: - """ - List VPN gateways. - - This request lists VPN gateways in the region. - - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. - :param str mode: (optional) Filters the collection to VPN gateways with a - `mode` property matching the specified value. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayCollection` object - """ - - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_vpn_gateways', - ) - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, - 'sort': sort, - 'mode': mode, - } - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - url = '/vpn_gateways' + url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -19464,32 +20070,44 @@ def list_vpn_gateways( response = self.send(request, **kwargs) return response - def create_vpn_gateway( + def create_security_group_rule( self, - vpn_gateway_prototype: 'VPNGatewayPrototype', + security_group_id: str, + security_group_rule_prototype: 'SecurityGroupRulePrototype', **kwargs, ) -> DetailedResponse: """ - Create a VPN gateway. + Create a rule for a security group. - This request creates a new VPN gateway. + This request creates a new security group rule from a security group rule + prototype object. The prototype object is structured in the same way as a + retrieved security group rule and contains the information necessary to create the + rule. As part of creating a new rule in a security group, the rule is applied to + all the networking interfaces in the security group. Rules specify which IP + traffic a security group will allow. Security group rules are stateful, such that + reverse traffic in response to allowed traffic is automatically permitted. A rule + allowing inbound TCP traffic on port 80 also allows outbound TCP traffic on port + 80 without the need for an additional rule. - :param VPNGatewayPrototype vpn_gateway_prototype: The VPN gateway prototype - object. + :param str security_group_id: The security group identifier. + :param SecurityGroupRulePrototype security_group_rule_prototype: The + properties of the security group rule to be created. :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 `VPNGateway` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ - if vpn_gateway_prototype is None: - raise ValueError('vpn_gateway_prototype must be provided') - if isinstance(vpn_gateway_prototype, VPNGatewayPrototype): - vpn_gateway_prototype = convert_model(vpn_gateway_prototype) + if not security_group_id: + raise ValueError('security_group_id must be provided') + if security_group_rule_prototype is None: + raise ValueError('security_group_rule_prototype must be provided') + if isinstance(security_group_rule_prototype, SecurityGroupRulePrototype): + security_group_rule_prototype = convert_model(security_group_rule_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_vpn_gateway', + operation_id='create_security_group_rule', ) headers.update(sdk_headers) @@ -19498,7 +20116,7 @@ def create_vpn_gateway( 'generation': self.generation, } - data = json.dumps(vpn_gateway_prototype) + data = json.dumps(security_group_rule_prototype) headers['content-type'] = 'application/json' if 'headers' in kwargs: @@ -19506,7 +20124,10 @@ def create_vpn_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/vpn_gateways' + path_param_keys = ['security_group_id'] + path_param_values = self.encode_path_vars(security_group_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -19518,32 +20139,35 @@ def create_vpn_gateway( response = self.send(request, **kwargs) return response - def delete_vpn_gateway( + def delete_security_group_rule( self, + security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a VPN gateway. + Delete a security group rule. - This request deletes a VPN gateway. This operation cannot be reversed. For this - request to succeed, the VPN gateway must not have a `status` of `pending`, and - there must not be any VPC routes using the VPN gateway's connections as a next - hop. + This request deletes a security group rule. This operation cannot be reversed. + Removing a security group rule will not end existing connections allowed by that + rule. - :param str id: The VPN gateway identifier. + :param str security_group_id: The security group identifier. + :param str id: The rule 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 security_group_id: + raise ValueError('security_group_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_vpn_gateway', + operation_id='delete_security_group_rule', ) headers.update(sdk_headers) @@ -19556,10 +20180,10 @@ def delete_vpn_gateway( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -19570,30 +20194,34 @@ def delete_vpn_gateway( response = self.send(request, **kwargs) return response - def get_vpn_gateway( + def get_security_group_rule( self, + security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN gateway. + Retrieve a security group rule. - This request retrieves a single VPN gateway specified by the identifier in the - URL. + This request retrieves a single security group rule specified by the identifier in + the URL path. - :param str id: The VPN gateway identifier. + :param str security_group_id: The security group identifier. + :param str id: The rule 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 `VPNGateway` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ + if not security_group_id: + raise ValueError('security_group_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_vpn_gateway', + operation_id='get_security_group_rule', ) headers.update(sdk_headers) @@ -19607,10 +20235,10 @@ def get_vpn_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -19621,35 +20249,43 @@ def get_vpn_gateway( response = self.send(request, **kwargs) return response - def update_vpn_gateway( + def update_security_group_rule( self, + security_group_id: str, id: str, - vpn_gateway_patch: 'VPNGatewayPatch', + security_group_rule_patch: 'SecurityGroupRulePatch', **kwargs, ) -> DetailedResponse: """ - Update a VPN gateway. + Update a security group rule. - This request updates the properties of an existing VPN gateway. + This request updates a security group rule with the information in a provided rule + patch object. The rule patch object contains only the information to be updated. + The request will fail if the provided patch includes properties that are not used + by the rule's protocol. - :param str id: The VPN gateway identifier. - :param VPNGatewayPatch vpn_gateway_patch: The VPN gateway patch. + :param str security_group_id: The security group identifier. + :param str id: The rule identifier. + :param SecurityGroupRulePatch security_group_rule_patch: The security group + rule patch. :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 `VPNGateway` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ + if not security_group_id: + raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') - if vpn_gateway_patch is None: - raise ValueError('vpn_gateway_patch must be provided') - if isinstance(vpn_gateway_patch, VPNGatewayPatch): - vpn_gateway_patch = convert_model(vpn_gateway_patch) + if security_group_rule_patch is None: + raise ValueError('security_group_rule_patch must be provided') + if isinstance(security_group_rule_patch, SecurityGroupRulePatch): + security_group_rule_patch = convert_model(security_group_rule_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_vpn_gateway', + operation_id='update_security_group_rule', ) headers.update(sdk_headers) @@ -19658,7 +20294,7 @@ def update_vpn_gateway( 'generation': self.generation, } - data = json.dumps(vpn_gateway_patch) + data = json.dumps(security_group_rule_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -19666,10 +20302,10 @@ def update_vpn_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -19681,38 +20317,36 @@ def update_vpn_gateway( response = self.send(request, **kwargs) return response - def list_vpn_gateway_connections( + def list_security_group_targets( self, - vpn_gateway_id: str, + security_group_id: str, *, start: Optional[str] = None, limit: Optional[int] = None, - status: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List connections of a VPN gateway. + List targets associated with a security group. - This request lists connections of a VPN gateway. + This request lists targets associated with a security group, to which the rules in + the security group are applied. - :param str vpn_gateway_id: The VPN gateway identifier. + :param str security_group_id: The security group identifier. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. - :param str status: (optional) Filters the collection to VPN gateway - connections with a `status` property matching the specified value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetCollection` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') + if not security_group_id: + raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_gateway_connections', + operation_id='list_security_group_targets', ) headers.update(sdk_headers) @@ -19721,7 +20355,6 @@ def list_vpn_gateway_connections( 'generation': self.generation, 'start': start, 'limit': limit, - 'status': status, } if 'headers' in kwargs: @@ -19729,10 +20362,10 @@ def list_vpn_gateway_connections( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id'] - path_param_values = self.encode_path_vars(vpn_gateway_id) + path_param_keys = ['security_group_id'] + path_param_values = self.encode_path_vars(security_group_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/targets'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -19743,36 +20376,43 @@ def list_vpn_gateway_connections( response = self.send(request, **kwargs) return response - def create_vpn_gateway_connection( + def delete_security_group_target_binding( self, - vpn_gateway_id: str, - vpn_gateway_connection_prototype: 'VPNGatewayConnectionPrototype', + security_group_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - Create a connection for a VPN gateway. + Remove a target from a security group. - This request creates a new VPN gateway connection. + This request removes a target from a security group. For this request to succeed, + the target must be attached to at least one other security group. The specified + target identifier can be: + - A bare metal server network interface identifier + - A virtual network interface identifier + - A VPN server identifier + - A load balancer identifier + - An endpoint gateway identifier + - An instance network interface identifier + Security groups are stateful, so any changes to a target's security groups are + applied to new connections. Existing connections are not affected. - :param str vpn_gateway_id: The VPN gateway identifier. - :param VPNGatewayConnectionPrototype vpn_gateway_connection_prototype: The - VPN gateway connection prototype object. + :param str security_group_id: The security group identifier. + :param str id: The security group target 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 `VPNGatewayConnection` object + :rtype: DetailedResponse """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if vpn_gateway_connection_prototype is None: - raise ValueError('vpn_gateway_connection_prototype must be provided') - if isinstance(vpn_gateway_connection_prototype, VPNGatewayConnectionPrototype): - vpn_gateway_connection_prototype = convert_model(vpn_gateway_connection_prototype) + if not security_group_id: + raise ValueError('security_group_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='create_vpn_gateway_connection', + operation_id='delete_security_group_target_binding', ) headers.update(sdk_headers) @@ -19781,58 +20421,52 @@ def create_vpn_gateway_connection( 'generation': self.generation, } - data = json.dumps(vpn_gateway_connection_prototype) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id'] - path_param_values = self.encode_path_vars(vpn_gateway_id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='DELETE', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_vpn_gateway_connection( + def get_security_group_target( self, - vpn_gateway_id: str, + security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a VPN gateway connection. + Retrieve a security group target. - This request deletes a VPN gateway connection. This operation cannot be reversed. - For this request to succeed, there must not be VPC routes using this VPN - connection as a next hop. + This request retrieves a single target specified by the identifier in the URL + path. The target must be an existing target of the security group. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. + :param str security_group_id: The security group identifier. + :param str id: The security group target 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 `SecurityGroupTargetReference` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') + if not security_group_id: + raise ValueError('security_group_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_vpn_gateway_connection', + operation_id='get_security_group_target', ) headers.update(sdk_headers) @@ -19844,13 +20478,14 @@ def delete_vpn_gateway_connection( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -19859,34 +20494,42 @@ def delete_vpn_gateway_connection( response = self.send(request, **kwargs) return response - def get_vpn_gateway_connection( + def create_security_group_target_binding( self, - vpn_gateway_id: str, + security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN gateway connection. + Add a target to a security group. - This request retrieves a single VPN gateway connection specified by the identifier - in the URL. + This request adds a resource to an existing security group. The specified target + identifier can be: + - A bare metal server network interface identifier + - A virtual network interface identifier + - A VPN server identifier + - A load balancer identifier + - An endpoint gateway identifier + - An instance network interface identifier + When a target is added to a security group, the security group rules are applied + to the target. A request body is not required, and if provided, is ignored. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. + :param str security_group_id: The security group identifier. + :param str id: The security group target 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 `VPNGatewayConnection` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') + if not security_group_id: + raise ValueError('security_group_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_vpn_gateway_connection', + operation_id='create_security_group_target_binding', ) headers.update(sdk_headers) @@ -19900,12 +20543,12 @@ def get_vpn_gateway_connection( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, params=params, @@ -19914,105 +20557,43 @@ def get_vpn_gateway_connection( response = self.send(request, **kwargs) return response - def update_vpn_gateway_connection( + ######################### + # VPN gateways + ######################### + + def list_ike_policies( self, - vpn_gateway_id: str, - id: str, - vpn_gateway_connection_patch: 'VPNGatewayConnectionPatch', + *, + start: Optional[str] = None, + limit: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - Update a VPN gateway connection. + List IKE policies. - This request updates the properties of an existing VPN gateway connection. + This request lists IKE policies in the region. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param VPNGatewayConnectionPatch vpn_gateway_connection_patch: The VPN - gateway connection patch. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :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 `VPNGatewayConnection` object + :rtype: DetailedResponse with `dict` result representing a `IKEPolicyCollection` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if vpn_gateway_connection_patch is None: - raise ValueError('vpn_gateway_connection_patch must be provided') - if isinstance(vpn_gateway_connection_patch, VPNGatewayConnectionPatch): - vpn_gateway_connection_patch = convert_model(vpn_gateway_connection_patch) - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='update_vpn_gateway_connection', - ) - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, - } - - data = json.dumps(vpn_gateway_connection_patch) - headers['content-type'] = 'application/merge-patch+json' - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) - request = self.prepare_request( - method='PATCH', - url=url, - headers=headers, - params=params, - data=data, - ) - - response = self.send(request, **kwargs) - return response - - def list_vpn_gateway_connections_local_cidrs( - self, - vpn_gateway_id: str, - id: str, - **kwargs, - ) -> DetailedResponse: - """ - List local CIDRs for a VPN gateway connection. - - This request lists local CIDRs for a VPN gateway connection. - This request is only supported for policy mode VPN gateways. - - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway 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 `VPNGatewayConnectionCIDRs` object - """ - - if not vpn_gateway_id: - raise ValueError('vpn_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_vpn_gateway_connections_local_cidrs', + operation_id='list_ike_policies', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, } if 'headers' in kwargs: @@ -20020,10 +20601,7 @@ def list_vpn_gateway_connections_local_cidrs( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs'.format(**path_param_dict) + url = '/ike_policies' request = self.prepare_request( method='GET', url=url, @@ -20034,38 +20612,55 @@ def list_vpn_gateway_connections_local_cidrs( response = self.send(request, **kwargs) return response - def remove_vpn_gateway_connections_local_cidr( + def create_ike_policy( self, - vpn_gateway_id: str, - id: str, - cidr: str, + authentication_algorithm: str, + dh_group: int, + encryption_algorithm: str, + ike_version: int, + *, + key_lifetime: Optional[int] = None, + name: Optional[str] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, **kwargs, ) -> DetailedResponse: """ - Remove a local CIDR from a VPN gateway connection. + Create an IKE policy. - This request removes a CIDR from a VPN gateway connection. - This request is only supported for policy mode VPN gateways. + This request creates a new IKE policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr: The IP address range in CIDR block notation. + :param str authentication_algorithm: The authentication algorithm. + :param int dh_group: The Diffie-Hellman group. + :param str encryption_algorithm: The encryption algorithm. + :param int ike_version: The IKE protocol version. + :param int key_lifetime: (optional) The key lifetime in seconds. + :param str name: (optional) The name for this IKE policy. The name must not + be used by another IKE policies in the region. If unspecified, the name + will be a hyphenated list of randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. :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 `IKEPolicy` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not cidr: - raise ValueError('cidr must be provided') + if authentication_algorithm is None: + raise ValueError('authentication_algorithm must be provided') + if dh_group is None: + raise ValueError('dh_group must be provided') + if encryption_algorithm is None: + raise ValueError('encryption_algorithm must be provided') + if ike_version is None: + raise ValueError('ike_version must be provided') + if resource_group is not None: + resource_group = convert_model(resource_group) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='remove_vpn_gateway_connections_local_cidr', + operation_id='create_ike_policy', ) headers.update(sdk_headers) @@ -20074,117 +20669,61 @@ def remove_vpn_gateway_connections_local_cidr( 'generation': self.generation, } - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - - path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}'.format(**path_param_dict) - request = self.prepare_request( - method='DELETE', - url=url, - headers=headers, - params=params, - ) - - response = self.send(request, **kwargs) - return response - - def check_vpn_gateway_connections_local_cidr( - self, - vpn_gateway_id: str, - id: str, - cidr: str, - **kwargs, - ) -> DetailedResponse: - """ - Check if the specified local CIDR exists on a VPN gateway connection. - - This request succeeds if a CIDR exists on the specified VPN gateway connection, - and fails otherwise. - This request is only supported for policy mode VPN gateways. - - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr: The IP address range in CIDR block notation. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse - """ - - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not cidr: - raise ValueError('cidr must be provided') - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='check_vpn_gateway_connections_local_cidr', - ) - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, + data = { + 'authentication_algorithm': authentication_algorithm, + 'dh_group': dh_group, + 'encryption_algorithm': encryption_algorithm, + 'ike_version': ike_version, + 'key_lifetime': key_lifetime, + 'name': name, + 'resource_group': resource_group, } + 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 = ['vpn_gateway_id', 'id', 'cidr'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}'.format(**path_param_dict) + url = '/ike_policies' request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def add_vpn_gateway_connections_local_cidr( + def delete_ike_policy( self, - vpn_gateway_id: str, id: str, - cidr: str, **kwargs, ) -> DetailedResponse: """ - Set a local CIDR on a VPN gateway connection. + Delete an IKE policy. - This request adds the specified CIDR to the specified VPN gateway connection. This - request succeeds if the specified CIDR already exists. A request body is not - required, and if provided, is ignored. - This request is only supported for policy mode VPN gateways. + This request deletes an IKE policy. This operation cannot be reversed. For this + request to succeed, there must not be any VPN gateway connections using this + policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr: The IP address range in CIDR block notation. + :param str id: The IKE policy 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 vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not cidr: - raise ValueError('cidr must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='add_vpn_gateway_connections_local_cidr', + operation_id='delete_ike_policy', ) headers.update(sdk_headers) @@ -20197,12 +20736,12 @@ def add_vpn_gateway_connections_local_cidr( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}'.format(**path_param_dict) + url = '/ike_policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='DELETE', url=url, headers=headers, params=params, @@ -20211,34 +20750,29 @@ def add_vpn_gateway_connections_local_cidr( response = self.send(request, **kwargs) return response - def list_vpn_gateway_connections_peer_cidrs( + def get_ike_policy( self, - vpn_gateway_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - List peer CIDRs for a VPN gateway connection. + Retrieve an IKE policy. - This request lists peer CIDRs for a VPN gateway connection. - This request is only supported for policy mode VPN gateways. + This request retrieves a single IKE policy specified by the identifier in the URL. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. + :param str id: The IKE policy 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 `VPNGatewayConnectionCIDRs` object + :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object """ - if not vpn_gateway_id: - raise ValueError('vpn_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_vpn_gateway_connections_peer_cidrs', + operation_id='get_ike_policy', ) headers.update(sdk_headers) @@ -20252,10 +20786,10 @@ def list_vpn_gateway_connections_peer_cidrs( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs'.format(**path_param_dict) + url = '/ike_policies/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -20266,38 +20800,35 @@ def list_vpn_gateway_connections_peer_cidrs( response = self.send(request, **kwargs) return response - def remove_vpn_gateway_connections_peer_cidr( + def update_ike_policy( self, - vpn_gateway_id: str, id: str, - cidr: str, + ike_policy_patch: 'IKEPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Remove a peer CIDR from a VPN gateway connection. + Update an IKE policy. - This request removes a CIDR from a VPN gateway connection. - This request is only supported for policy mode VPN gateways. + This request updates the properties of an existing IKE policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr: The IP address range in CIDR block notation. + :param str id: The IKE policy identifier. + :param IKEPolicyPatch ike_policy_patch: The IKE policy patch. :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 `IKEPolicy` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not cidr: - raise ValueError('cidr must be provided') + if ike_policy_patch is None: + raise ValueError('ike_policy_patch must be provided') + if isinstance(ike_policy_patch, IKEPolicyPatch): + ike_policy_patch = convert_model(ike_policy_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='remove_vpn_gateway_connections_peer_cidr', + operation_id='update_ike_policy', ) headers.update(sdk_headers) @@ -20306,135 +20837,79 @@ def remove_vpn_gateway_connections_peer_cidr( 'generation': self.generation, } - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - - path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}'.format(**path_param_dict) - request = self.prepare_request( - method='DELETE', - url=url, - headers=headers, - params=params, - ) - - response = self.send(request, **kwargs) - return response - - def check_vpn_gateway_connections_peer_cidr( - self, - vpn_gateway_id: str, - id: str, - cidr: str, - **kwargs, - ) -> DetailedResponse: - """ - Check if the specified peer CIDR exists on a VPN gateway connection. - - This request succeeds if a CIDR exists on the specified VPN gateway connection, - and fails otherwise. - This request is only supported for policy mode VPN gateways. - - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr: The IP address range in CIDR block notation. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse - """ - - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not cidr: - raise ValueError('cidr must be provided') - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='check_vpn_gateway_connections_peer_cidr', - ) - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, - } + data = json.dumps(ike_policy_patch) + headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}'.format(**path_param_dict) + url = '/ike_policies/{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 - def add_vpn_gateway_connections_peer_cidr( + def list_ike_policy_connections( self, - vpn_gateway_id: str, id: str, - cidr: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - Set a peer CIDR on a VPN gateway connection. + List VPN gateway connections that use a specified IKE policy. - This request adds the specified CIDR to the specified VPN gateway connection. This - request succeeds if the specified CIDR already exists. A request body is not - required, and if provided, is ignored. - This request is only supported for policy mode VPN gateways. + This request lists VPN gateway connections that use a IKE policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr: The IP address range in CIDR block notation. + :param str id: The IKE policy identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :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 `IKEPolicyConnectionCollection` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not cidr: - raise ValueError('cidr must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='add_vpn_gateway_connections_peer_cidr', + operation_id='list_ike_policy_connections', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}'.format(**path_param_dict) + url = '/ike_policies/{id}/connections'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='GET', url=url, headers=headers, params=params, @@ -20443,59 +20918,39 @@ def add_vpn_gateway_connections_peer_cidr( response = self.send(request, **kwargs) return response - ######################### - # VPN servers - ######################### - - def list_vpn_servers( + def list_ipsec_policies( self, *, - name: Optional[str] = None, start: Optional[str] = None, limit: Optional[int] = None, - resource_group_id: Optional[str] = None, - sort: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List VPN servers. + List IPsec policies. - This request lists VPN servers. + This request lists IPsec policies in the region. - :param str name: (optional) Filters the collection to resources with a - `name` property matching the exact specified name. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. :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 `VPNServerCollection` object + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicyCollection` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_servers', + operation_id='list_ipsec_policies', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'name': name, 'start': start, 'limit': limit, - 'resource_group.id': resource_group_id, - 'sort': sort, } if 'headers' in kwargs: @@ -20503,7 +20958,7 @@ def list_vpn_servers( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/vpn_servers' + url = '/ipsec_policies' request = self.prepare_request( method='GET', url=url, @@ -20514,94 +20969,59 @@ def list_vpn_servers( response = self.send(request, **kwargs) return response - def create_vpn_server( + def create_ipsec_policy( self, - certificate: 'CertificateInstanceIdentity', - client_authentication: List['VPNServerAuthenticationPrototype'], - client_ip_pool: str, - subnets: List['SubnetIdentity'], + authentication_algorithm: str, + encryption_algorithm: str, + pfs: str, *, - client_dns_server_ips: Optional[List['IP']] = None, - client_idle_timeout: Optional[int] = None, - enable_split_tunneling: Optional[bool] = None, + key_lifetime: Optional[int] = None, name: Optional[str] = None, - port: Optional[int] = None, - protocol: Optional[str] = None, resource_group: Optional['ResourceGroupIdentity'] = None, - security_groups: Optional[List['SecurityGroupIdentity']] = None, **kwargs, ) -> DetailedResponse: """ - Create a VPN server. + Create an IPsec policy. - This request creates a new VPN server. + This request creates a new IPsec policy. - :param CertificateInstanceIdentity certificate: The certificate instance - for this VPN server. - :param List[VPNServerAuthenticationPrototype] client_authentication: The - methods used to authenticate VPN clients to this VPN server. VPN clients - must authenticate against all specified methods. - :param str client_ip_pool: The VPN client IPv4 address pool, expressed in - CIDR format. The request must not overlap with any existing address - prefixes in the VPC or any of the following reserved address ranges: - - `127.0.0.0/8` (IPv4 loopback addresses) - - `161.26.0.0/16` (IBM services) - - `166.8.0.0/14` (Cloud Service Endpoints) - - `169.254.0.0/16` (IPv4 link-local addresses) - - `224.0.0.0/4` (IPv4 multicast addresses) - The prefix length of the client IP address pool's CIDR must be between - `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that - contains twice the number of IP addresses that are required to enable the - maximum number of concurrent connections is recommended. - :param List[SubnetIdentity] subnets: The subnets to provision this VPN - server in. Use subnets in different zones for high availability. - :param List[IP] client_dns_server_ips: (optional) The DNS server addresses - that will be provided to VPN clients connected to this VPN server. - :param int client_idle_timeout: (optional) The seconds a VPN client can be - idle before this VPN server will disconnect it. Specify `0` to prevent - the server from disconnecting idle clients. - :param bool enable_split_tunneling: (optional) Indicates whether the split - tunneling is enabled on this VPN server. - :param str name: (optional) The name for this VPN server. The name must not - be used by another VPN server in the VPC. If unspecified, the name will be - a hyphenated list of randomly-selected words. - :param int port: (optional) The port number to use for this VPN server. - :param str protocol: (optional) The transport protocol to use for this VPN - server. + :param str authentication_algorithm: The authentication algorithm + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, + `aes192gcm16`, or `aes256gcm16` + The `md5` and `sha1` algorithms have been deprecated. + :param str encryption_algorithm: The encryption algorithm + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or `aes256gcm16` + The `triple_des` algorithm has been deprecated. + :param str pfs: The Perfect Forward Secrecy group. + Groups `group_2` and `group_5` have been deprecated. + :param int key_lifetime: (optional) The key lifetime in seconds. + :param str name: (optional) The name for this IPsec policy. The name must + not be used by another IPsec policies in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this VPN server. If unspecified, the VPC's default - security group is used. :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 `VPNServer` object + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object """ - if certificate is None: - raise ValueError('certificate must be provided') - if client_authentication is None: - raise ValueError('client_authentication must be provided') - if client_ip_pool is None: - raise ValueError('client_ip_pool must be provided') - if subnets is None: - raise ValueError('subnets must be provided') - certificate = convert_model(certificate) - client_authentication = [convert_model(x) for x in client_authentication] - subnets = [convert_model(x) for x in subnets] - if client_dns_server_ips is not None: - client_dns_server_ips = [convert_model(x) for x in client_dns_server_ips] + if authentication_algorithm is None: + raise ValueError('authentication_algorithm must be provided') + if encryption_algorithm is None: + raise ValueError('encryption_algorithm must be provided') + if pfs is None: + raise ValueError('pfs must be provided') if resource_group is not None: resource_group = convert_model(resource_group) - if security_groups is not None: - security_groups = [convert_model(x) for x in security_groups] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_vpn_server', + operation_id='create_ipsec_policy', ) headers.update(sdk_headers) @@ -20611,18 +21031,12 @@ def create_vpn_server( } data = { - 'certificate': certificate, - 'client_authentication': client_authentication, - 'client_ip_pool': client_ip_pool, - 'subnets': subnets, - 'client_dns_server_ips': client_dns_server_ips, - 'client_idle_timeout': client_idle_timeout, - 'enable_split_tunneling': enable_split_tunneling, + 'authentication_algorithm': authentication_algorithm, + 'encryption_algorithm': encryption_algorithm, + 'pfs': pfs, + 'key_lifetime': key_lifetime, 'name': name, - 'port': port, - 'protocol': protocol, 'resource_group': resource_group, - 'security_groups': security_groups, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -20633,7 +21047,7 @@ def create_vpn_server( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/vpn_servers' + url = '/ipsec_policies' request = self.prepare_request( method='POST', url=url, @@ -20645,21 +21059,19 @@ def create_vpn_server( response = self.send(request, **kwargs) return response - def delete_vpn_server( + def delete_ipsec_policy( self, id: str, - *, - if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Delete a VPN server. + Delete an IPsec policy. - This request deletes a VPN server. This operation cannot be reversed. + This request deletes an IPsec policy. This operation cannot be reversed. For this + request to succeed, there must not be any VPN gateway connections using this + policy. - :param str id: The VPN server identifier. - :param str if_match: (optional) If present, the request will fail if the - specified ETag value does not match the resource's current ETag value. + :param str id: The IPsec policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -20667,13 +21079,11 @@ def delete_vpn_server( if not id: raise ValueError('id must be provided') - headers = { - 'If-Match': if_match, - } + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_vpn_server', + operation_id='delete_ipsec_policy', ) headers.update(sdk_headers) @@ -20689,7 +21099,7 @@ def delete_vpn_server( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{id}'.format(**path_param_dict) + url = '/ipsec_policies/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -20700,20 +21110,21 @@ def delete_vpn_server( response = self.send(request, **kwargs) return response - def get_vpn_server( + def get_ipsec_policy( self, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN server. + Retrieve an IPsec policy. - This request retrieves a single VPN server specified by the identifier in the URL. + This request retrieves a single IPsec policy specified by the identifier in the + URL. - :param str id: The VPN server identifier. + :param str id: The IPsec policy 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 `VPNServer` object + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object """ if not id: @@ -20722,7 +21133,7 @@ def get_vpn_server( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_vpn_server', + operation_id='get_ipsec_policy', ) headers.update(sdk_headers) @@ -20739,7 +21150,7 @@ def get_vpn_server( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{id}'.format(**path_param_dict) + url = '/ipsec_policies/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -20750,43 +21161,35 @@ def get_vpn_server( response = self.send(request, **kwargs) return response - def update_vpn_server( + def update_ipsec_policy( self, id: str, - vpn_server_patch: 'VPNServerPatch', - *, - if_match: Optional[str] = None, + i_psec_policy_patch: 'IPsecPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Update a VPN server. + Update an IPsec policy. - This request updates the properties of an existing VPN server. Any updates other - than to `name` will cause all connected VPN clients to be disconnected. + This request updates the properties of an existing IPsec policy. - :param str id: The VPN server identifier. - :param VPNServerPatch vpn_server_patch: The VPN server patch. - :param str if_match: (optional) If present, the request will fail if the - specified ETag value does not match the resource's current ETag value. - Required if the request body includes an array. + :param str id: The IPsec policy identifier. + :param IPsecPolicyPatch i_psec_policy_patch: The IPsec policy patch. :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 `VPNServer` object + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object """ if not id: raise ValueError('id must be provided') - if vpn_server_patch is None: - raise ValueError('vpn_server_patch must be provided') - if isinstance(vpn_server_patch, VPNServerPatch): - vpn_server_patch = convert_model(vpn_server_patch) - headers = { - 'If-Match': if_match, - } + if i_psec_policy_patch is None: + raise ValueError('i_psec_policy_patch must be provided') + if isinstance(i_psec_policy_patch, IPsecPolicyPatch): + i_psec_policy_patch = convert_model(i_psec_policy_patch) + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_vpn_server', + operation_id='update_ipsec_policy', ) headers.update(sdk_headers) @@ -20795,7 +21198,7 @@ def update_vpn_server( 'generation': self.generation, } - data = json.dumps(vpn_server_patch) + data = json.dumps(i_psec_policy_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -20806,7 +21209,7 @@ def update_vpn_server( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{id}'.format(**path_param_dict) + url = '/ipsec_policies/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -20818,22 +21221,26 @@ def update_vpn_server( response = self.send(request, **kwargs) return response - def get_vpn_server_client_configuration( + def list_ipsec_policy_connections( self, id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - Retrieve client configuration. + List VPN gateway connections that use a specified IPsec policy. - This request retrieves OpenVPN client configuration on a single VPN server - specified by the identifier in the URL. This configuration includes directives - compatible with OpenVPN releases 2.4 and 2.5. + This request lists VPN gateway connections that use a IPsec policy. - :param str id: The VPN server identifier. + :param str id: The IPsec policy identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `str` result + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicyConnectionCollection` object """ if not id: @@ -20842,24 +21249,26 @@ def get_vpn_server_client_configuration( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_vpn_server_client_configuration', + operation_id='list_ipsec_policy_connections', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'text/plain' + headers['Accept'] = 'application/json' path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{id}/client_configuration'.format(**path_param_dict) + url = '/ipsec_policies/{id}/connections'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -20870,41 +21279,44 @@ def get_vpn_server_client_configuration( response = self.send(request, **kwargs) return response - def list_vpn_server_clients( + def list_vpn_gateways( self, - vpn_server_id: str, *, start: Optional[str] = None, limit: Optional[int] = None, + resource_group_id: Optional[str] = None, sort: Optional[str] = None, + mode: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List VPN clients for a VPN server. + List VPN gateways. - This request retrieves connected VPN clients, and any disconnected VPN clients - that the VPN server has not yet deleted based on its auto-deletion policy. + This request lists VPN gateways in the region. - :param str vpn_server_id: The VPN server identifier. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. :param str sort: (optional) Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name to sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order. + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str mode: (optional) Filters the collection to VPN gateways with a + `mode` property matching the specified value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerClientCollection` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayCollection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_server_clients', + operation_id='list_vpn_gateways', ) headers.update(sdk_headers) @@ -20913,7 +21325,9 @@ def list_vpn_server_clients( 'generation': self.generation, 'start': start, 'limit': limit, + 'resource_group.id': resource_group_id, 'sort': sort, + 'mode': mode, } if 'headers' in kwargs: @@ -20921,10 +21335,7 @@ def list_vpn_server_clients( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id'] - path_param_values = self.encode_path_vars(vpn_server_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/clients'.format(**path_param_dict) + url = '/vpn_gateways' request = self.prepare_request( method='GET', url=url, @@ -20935,35 +21346,86 @@ def list_vpn_server_clients( response = self.send(request, **kwargs) return response - def delete_vpn_server_client( + def create_vpn_gateway( + self, + vpn_gateway_prototype: 'VPNGatewayPrototype', + **kwargs, + ) -> DetailedResponse: + """ + Create a VPN gateway. + + This request creates a new VPN gateway. + + :param VPNGatewayPrototype vpn_gateway_prototype: The VPN gateway prototype + object. + :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 `VPNGateway` object + """ + + if vpn_gateway_prototype is None: + raise ValueError('vpn_gateway_prototype must be provided') + if isinstance(vpn_gateway_prototype, VPNGatewayPrototype): + vpn_gateway_prototype = convert_model(vpn_gateway_prototype) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_vpn_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = json.dumps(vpn_gateway_prototype) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/vpn_gateways' + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def delete_vpn_gateway( self, - vpn_server_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a VPN client. + Delete a VPN gateway. - This request disconnects and deletes the VPN client from the VPN server. The VPN - client may reconnect unless its authentication permissions for the configured - authentication methods (such as its client certificate) have been revoked. + This request deletes a VPN gateway. This operation cannot be reversed. For this + request to succeed, the VPN gateway must not have a `status` of `pending`, and + there must not be any VPC routes using the VPN gateway's connections as a next + hop. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN client identifier. + :param str id: The VPN gateway 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 vpn_server_id: - raise ValueError('vpn_server_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_vpn_server_client', + operation_id='delete_vpn_gateway', ) headers.update(sdk_headers) @@ -20976,10 +21438,10 @@ def delete_vpn_server_client( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -20990,33 +21452,30 @@ def delete_vpn_server_client( response = self.send(request, **kwargs) return response - def get_vpn_server_client( + def get_vpn_gateway( self, - vpn_server_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN client. + Retrieve a VPN gateway. - This request retrieves a single VPN client specified by the identifier in the URL. + This request retrieves a single VPN gateway specified by the identifier in the + URL. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN client identifier. + :param str id: The VPN 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 `VPNServerClient` object + :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object """ - if not vpn_server_id: - raise ValueError('vpn_server_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_vpn_server_client', + operation_id='get_vpn_gateway', ) headers.update(sdk_headers) @@ -21030,10 +21489,10 @@ def get_vpn_server_client( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -21044,36 +21503,35 @@ def get_vpn_server_client( response = self.send(request, **kwargs) return response - def disconnect_vpn_client( + def update_vpn_gateway( self, - vpn_server_id: str, id: str, + vpn_gateway_patch: 'VPNGatewayPatch', **kwargs, ) -> DetailedResponse: """ - Disconnect a VPN client. + Update a VPN gateway. - This request disconnects the specified VPN client, and deletes the client - according to the VPN server's auto-deletion policy. The VPN client may reconnect - unless its authentication permissions for the configured authentication methods - (such as its client certificate) have been revoked. + This request updates the properties of an existing VPN gateway. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN client identifier. + :param str id: The VPN gateway identifier. + :param VPNGatewayPatch vpn_gateway_patch: The VPN gateway patch. :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 `VPNGateway` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') if not id: raise ValueError('id must be provided') + if vpn_gateway_patch is None: + raise ValueError('vpn_gateway_patch must be provided') + if isinstance(vpn_gateway_patch, VPNGatewayPatch): + vpn_gateway_patch = convert_model(vpn_gateway_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='disconnect_vpn_client', + operation_id='update_vpn_gateway', ) headers.update(sdk_headers) @@ -21082,62 +21540,61 @@ def disconnect_vpn_client( 'generation': self.generation, } + data = json.dumps(vpn_gateway_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/clients/{id}/disconnect'.format(**path_param_dict) + url = '/vpn_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def list_vpn_server_routes( + def list_vpn_gateway_connections( self, - vpn_server_id: str, + vpn_gateway_id: str, *, start: Optional[str] = None, limit: Optional[int] = None, - sort: Optional[str] = None, + status: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List VPN routes for a VPN server. + List connections of a VPN gateway. - This request lists VPN routes in a VPN server. All VPN routes are provided to the - VPN client when the connection is established. Packets received from the VPN - client will be dropped by the VPN server if there is no VPN route matching their - specified destinations. All VPN routes must be unique within the VPN server. + This request lists connections of a VPN gateway. - :param str vpn_server_id: The VPN server identifier. + :param str vpn_gateway_id: The VPN gateway identifier. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. + :param str status: (optional) Filters the collection to VPN gateway + connections with a `status` property matching the specified value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerRouteCollection` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_server_routes', + operation_id='list_vpn_gateway_connections', ) headers.update(sdk_headers) @@ -21146,7 +21603,7 @@ def list_vpn_server_routes( 'generation': self.generation, 'start': start, 'limit': limit, - 'sort': sort, + 'status': status, } if 'headers' in kwargs: @@ -21154,10 +21611,10 @@ def list_vpn_server_routes( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id'] - path_param_values = self.encode_path_vars(vpn_server_id) + path_param_keys = ['vpn_gateway_id'] + path_param_values = self.encode_path_vars(vpn_gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -21168,52 +21625,36 @@ def list_vpn_server_routes( response = self.send(request, **kwargs) return response - def create_vpn_server_route( + def create_vpn_gateway_connection( self, - vpn_server_id: str, - destination: str, - *, - action: Optional[str] = None, - name: Optional[str] = None, + vpn_gateway_id: str, + vpn_gateway_connection_prototype: 'VPNGatewayConnectionPrototype', **kwargs, ) -> DetailedResponse: """ - Create a VPN route for a VPN server. + Create a connection for a VPN gateway. - This request creates a new VPN route in the VPN server. All VPN routes are - provided to the VPN client when the connection is established. Packets received - from the VPN client will be dropped by the VPN server if there is no VPN route - matching their specified destinations. All VPN routes must be unique within the - VPN server. + This request creates a new VPN gateway connection. - :param str vpn_server_id: The VPN server identifier. - :param str destination: The destination to use for this VPN route in the - VPN server. Must be unique within the VPN server. If an incoming packet - does not match any destination, it will be dropped. - :param str action: (optional) The action to perform with a packet matching - the VPN route: - - `translate`: translate the source IP address to one of the private IP - addresses of - the VPN server, then deliver the packet to target. - - `deliver`: deliver the packet to the target. - - `drop`: drop the packet. - :param str name: (optional) The name for this VPN server route. The name - must not be used by another route for the VPN server. If unspecified, the - name will be a hyphenated list of randomly-selected words. + :param str vpn_gateway_id: The VPN gateway identifier. + :param VPNGatewayConnectionPrototype vpn_gateway_connection_prototype: The + VPN gateway connection prototype object. :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 `VPNServerRoute` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') - if destination is None: - raise ValueError('destination must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if vpn_gateway_connection_prototype is None: + raise ValueError('vpn_gateway_connection_prototype must be provided') + if isinstance(vpn_gateway_connection_prototype, VPNGatewayConnectionPrototype): + vpn_gateway_connection_prototype = convert_model(vpn_gateway_connection_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_vpn_server_route', + operation_id='create_vpn_gateway_connection', ) headers.update(sdk_headers) @@ -21222,13 +21663,7 @@ def create_vpn_server_route( 'generation': self.generation, } - data = { - 'destination': destination, - 'action': action, - 'name': name, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) + data = json.dumps(vpn_gateway_connection_prototype) headers['content-type'] = 'application/json' if 'headers' in kwargs: @@ -21236,10 +21671,10 @@ def create_vpn_server_route( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id'] - path_param_values = self.encode_path_vars(vpn_server_id) + path_param_keys = ['vpn_gateway_id'] + path_param_values = self.encode_path_vars(vpn_gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -21251,33 +21686,35 @@ def create_vpn_server_route( response = self.send(request, **kwargs) return response - def delete_vpn_server_route( + def delete_vpn_gateway_connection( self, - vpn_server_id: str, + vpn_gateway_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a VPN route. + Delete a VPN gateway connection. - This request deletes a VPN route. This operation cannot be reversed. + This request deletes a VPN gateway connection. This operation cannot be reversed. + For this request to succeed, there must not be VPC routes using this VPN + connection as a next hop. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN route identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection 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 vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_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_vpn_server_route', + operation_id='delete_vpn_gateway_connection', ) headers.update(sdk_headers) @@ -21290,10 +21727,10 @@ def delete_vpn_server_route( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -21304,33 +21741,34 @@ def delete_vpn_server_route( response = self.send(request, **kwargs) return response - def get_vpn_server_route( + def get_vpn_gateway_connection( self, - vpn_server_id: str, + vpn_gateway_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN route. + Retrieve a VPN gateway connection. - This request retrieves a single VPN route specified by the identifier in the URL. + This request retrieves a single VPN gateway connection specified by the identifier + in the URL. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN route identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway 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 `VPNServerRoute` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_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_vpn_server_route', + operation_id='get_vpn_gateway_connection', ) headers.update(sdk_headers) @@ -21344,10 +21782,10 @@ def get_vpn_server_route( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -21358,41 +21796,40 @@ def get_vpn_server_route( response = self.send(request, **kwargs) return response - def update_vpn_server_route( + def update_vpn_gateway_connection( self, - vpn_server_id: str, + vpn_gateway_id: str, id: str, - vpn_server_route_patch: 'VPNServerRoutePatch', + vpn_gateway_connection_patch: 'VPNGatewayConnectionPatch', **kwargs, ) -> DetailedResponse: """ - Update a VPN route. + Update a VPN gateway connection. - This request updates a VPN route with the information in a provided VPN route - patch. The VPN route patch object is structured in the same way as a retrieved VPN - route and contains only the information to be updated. + This request updates the properties of an existing VPN gateway connection. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN route identifier. - :param VPNServerRoutePatch vpn_server_route_patch: The VPN route patch. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param VPNGatewayConnectionPatch vpn_gateway_connection_patch: The VPN + gateway connection patch. :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 `VPNServerRoute` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if vpn_server_route_patch is None: - raise ValueError('vpn_server_route_patch must be provided') - if isinstance(vpn_server_route_patch, VPNServerRoutePatch): - vpn_server_route_patch = convert_model(vpn_server_route_patch) + if vpn_gateway_connection_patch is None: + raise ValueError('vpn_gateway_connection_patch must be provided') + if isinstance(vpn_gateway_connection_patch, VPNGatewayConnectionPatch): + vpn_gateway_connection_patch = convert_model(vpn_gateway_connection_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_vpn_server_route', + operation_id='update_vpn_gateway_connection', ) headers.update(sdk_headers) @@ -21401,7 +21838,7 @@ def update_vpn_server_route( 'generation': self.generation, } - data = json.dumps(vpn_server_route_patch) + data = json.dumps(vpn_gateway_connection_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -21409,10 +21846,10 @@ def update_vpn_server_route( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -21424,45 +21861,40 @@ def update_vpn_server_route( response = self.send(request, **kwargs) return response - ######################### - # Load balancers - ######################### - - def list_load_balancer_profiles( + def list_vpn_gateway_connections_local_cidrs( self, - *, - start: Optional[str] = None, - limit: Optional[int] = None, + vpn_gateway_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List load balancer profiles. + List local CIDRs for a VPN gateway connection. - This request lists load balancer profiles available in the region. A load balancer - profile specifies the performance characteristics and pricing model for a load - balancer. + This request lists local CIDRs for a VPN gateway connection. + This request is only supported for policy mode VPN gateways. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway 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 `LoadBalancerProfileCollection` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCIDRs` object """ + if not vpn_gateway_id: + raise ValueError('vpn_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_load_balancer_profiles', + operation_id='list_vpn_gateway_connections_local_cidrs', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, } if 'headers' in kwargs: @@ -21470,7 +21902,10 @@ def list_load_balancer_profiles( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/load_balancer/profiles' + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -21481,29 +21916,38 @@ def list_load_balancer_profiles( response = self.send(request, **kwargs) return response - def get_load_balancer_profile( + def remove_vpn_gateway_connections_local_cidr( self, - name: str, + vpn_gateway_id: str, + id: str, + cidr: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer profile. + Remove a local CIDR from a VPN gateway connection. - This request retrieves a load balancer profile specified by the name in the URL. + This request removes a CIDR from a VPN gateway connection. + This request is only supported for policy mode VPN gateways. - :param str name: The load balancer profile name. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr: The IP address range in CIDR block notation. :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 `LoadBalancerProfile` object + :rtype: DetailedResponse """ - if not name: - raise ValueError('name must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if not cidr: + raise ValueError('cidr must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_profile', + operation_id='remove_vpn_gateway_connections_local_cidr', ) headers.update(sdk_headers) @@ -21515,14 +21959,13 @@ def get_load_balancer_profile( 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 = ['vpn_gateway_id', 'id', 'cidr'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancer/profiles/{name}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -21531,47 +21974,55 @@ def get_load_balancer_profile( response = self.send(request, **kwargs) return response - def list_load_balancers( + def check_vpn_gateway_connections_local_cidr( self, - *, - start: Optional[str] = None, - limit: Optional[int] = None, + vpn_gateway_id: str, + id: str, + cidr: str, **kwargs, ) -> DetailedResponse: """ - List load balancers. + Check if the specified local CIDR exists on a VPN gateway connection. - This request lists load balancers in the region. + This request succeeds if a CIDR exists on the specified VPN gateway connection, + and fails otherwise. + This request is only supported for policy mode VPN gateways. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr: The IP address range in CIDR block notation. :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 `LoadBalancerCollection` object + :rtype: DetailedResponse """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if not cidr: + raise ValueError('cidr must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancers', + operation_id='check_vpn_gateway_connections_local_cidr', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - url = '/load_balancers' + path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -21582,111 +22033,40 @@ def list_load_balancers( response = self.send(request, **kwargs) return response - def create_load_balancer( + def add_vpn_gateway_connections_local_cidr( self, - is_public: bool, - subnets: List['SubnetIdentity'], - *, - dns: Optional['LoadBalancerDNSPrototype'] = None, - is_private_path: Optional[bool] = None, - listeners: Optional[List['LoadBalancerListenerPrototypeLoadBalancerContext']] = None, - logging: Optional['LoadBalancerLoggingPrototype'] = None, - name: Optional[str] = None, - pools: Optional[List['LoadBalancerPoolPrototype']] = None, - profile: Optional['LoadBalancerProfileIdentity'] = None, - resource_group: Optional['ResourceGroupIdentity'] = None, - route_mode: Optional[bool] = None, - security_groups: Optional[List['SecurityGroupIdentity']] = None, + vpn_gateway_id: str, + id: str, + cidr: str, **kwargs, ) -> DetailedResponse: """ - Create a load balancer. + Set a local CIDR on a VPN gateway connection. - This request creates and provisions a new load balancer. + This request adds the specified CIDR to the specified VPN gateway connection. This + request succeeds if the specified CIDR already exists. A request body is not + required, and if provided, is ignored. + This request is only supported for policy mode VPN gateways. - :param bool is_public: Indicates whether this load balancer is public. - At present, - - If route mode is enabled, the load balancer must be private. - - If `is_private_path` is specified, it must be set to `false`. - :param List[SubnetIdentity] subnets: The subnets to provision this load - balancer in. The subnets must be in the same VPC. - - If 'availability' is specified as `subnet` in the profile, the load - balancer's availability will depend on the availability of the zones that - the subnets reside in. - - If 'availability' is specified as `region` in the profile, the load - balancer remains available as long as any zone in the region is available. - Only members in healthy zones will be sent new connections. - Load balancers in the `network` family allow only one subnet to be - specified. - :param LoadBalancerDNSPrototype dns: (optional) The DNS configuration for - this load balancer. - If unspecified, DNS `A` records for this load balancer's `hostname` - property will be added - to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` - records will be - added to the specified `zone`. - Not supported by private path load balancers. - :param bool is_private_path: (optional) Indicates whether this is a private - path load balancer. - :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners: - (optional) The listeners of this load balancer. - :param LoadBalancerLoggingPrototype logging: (optional) The logging - configuration to use for this load balancer. See [VPC Datapath - Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the - logging - format, fields and permitted values. If unspecified, `datapath.active` will - be `false`. - To activate logging, the load balancer profile must support the specified - logging type. - :param str name: (optional) The name for this load balancer. The name must - not be used by another load balancer in the VPC. If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this - load balancer. - :param LoadBalancerProfileIdentity profile: (optional) The profile to use - for this load balancer. - If unspecified, `application` will be used. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. - :param bool route_mode: (optional) Indicates whether route mode is enabled - for this load balancer. - At present, public load balancers are not supported with route mode - enabled. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this load balancer. If unspecified, the VPC's default - security group is used. - The load balancer profile must support security groups. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr: The IP address range in CIDR block notation. :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 `LoadBalancer` object + :rtype: DetailedResponse """ - if is_public is None: - raise ValueError('is_public must be provided') - if subnets is None: - raise ValueError('subnets must be provided') - subnets = [convert_model(x) for x in subnets] - if dns is not None: - dns = convert_model(dns) - if listeners is not None: - listeners = [convert_model(x) for x in listeners] - if logging is not None: - logging = convert_model(logging) - if pools is not None: - pools = [convert_model(x) for x in pools] - if profile is not None: - profile = convert_model(profile) - if resource_group is not None: - resource_group = convert_model(resource_group) - if security_groups is not None: - security_groups = [convert_model(x) for x in security_groups] + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if not cidr: + raise ValueError('cidr must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer', + operation_id='add_vpn_gateway_connections_local_cidr', ) headers.update(sdk_headers) @@ -21695,72 +22075,52 @@ def create_load_balancer( 'generation': self.generation, } - data = { - 'is_public': is_public, - 'subnets': subnets, - 'dns': dns, - 'is_private_path': is_private_path, - 'listeners': listeners, - 'logging': logging, - 'name': name, - 'pools': pools, - 'profile': profile, - 'resource_group': resource_group, - 'route_mode': route_mode, - 'security_groups': security_groups, - } - 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' - url = '/load_balancers' + path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='PUT', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_load_balancer( + def list_vpn_gateway_connections_peer_cidrs( self, + vpn_gateway_id: str, id: str, - *, - if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer. + List peer CIDRs for a VPN gateway connection. - This request deletes a load balancer. This operation cannot be reversed. A load - balancer cannot be deleted if its `provisioning_status` is `delete_pending` or it - is referenced by a resource. + This request lists peer CIDRs for a VPN gateway connection. + This request is only supported for policy mode VPN gateways. - :param str id: The load balancer identifier. - :param str if_match: (optional) If present, the request will fail if the - specified ETag value does not match the resource's current ETag value. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection 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 `VPNGatewayConnectionCIDRs` object """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - headers = { - 'If-Match': if_match, - } + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer', + operation_id='list_vpn_gateway_connections_peer_cidrs', ) headers.update(sdk_headers) @@ -21772,13 +22132,14 @@ def delete_load_balancer( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -21787,30 +22148,38 @@ def delete_load_balancer( response = self.send(request, **kwargs) return response - def get_load_balancer( + def remove_vpn_gateway_connections_peer_cidr( self, + vpn_gateway_id: str, id: str, + cidr: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer. + Remove a peer CIDR from a VPN gateway connection. - This request retrieves a single load balancer specified by the identifier in the - URL path. + This request removes a CIDR from a VPN gateway connection. + This request is only supported for policy mode VPN gateways. - :param str id: The load balancer identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr: The IP address range in CIDR block notation. :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 `LoadBalancer` object + :rtype: DetailedResponse """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not cidr: + raise ValueError('cidr must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer', + operation_id='remove_vpn_gateway_connections_peer_cidr', ) headers.update(sdk_headers) @@ -21822,14 +22191,13 @@ def get_load_balancer( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -21838,45 +22206,39 @@ def get_load_balancer( response = self.send(request, **kwargs) return response - def update_load_balancer( + def check_vpn_gateway_connections_peer_cidr( self, + vpn_gateway_id: str, id: str, - load_balancer_patch: 'LoadBalancerPatch', - *, - if_match: Optional[str] = None, + cidr: str, **kwargs, ) -> DetailedResponse: """ - Update a load balancer. + Check if the specified peer CIDR exists on a VPN gateway connection. - This request updates a load balancer with the information in a provided load - balancer patch. The load balancer patch object is structured in the same way as a - retrieved load balancer and contains only the information to be updated. A load - balancer can only be updated if its `provisioning_status` is `active`. + This request succeeds if a CIDR exists on the specified VPN gateway connection, + and fails otherwise. + This request is only supported for policy mode VPN gateways. - :param str id: The load balancer identifier. - :param LoadBalancerPatch load_balancer_patch: The load balancer patch. - :param str if_match: (optional) If present, the request will fail if the - specified ETag value does not match the resource's current ETag value. - Required if the request body includes an array. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr: The IP address range in CIDR block notation. :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 `LoadBalancer` object + :rtype: DetailedResponse """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if load_balancer_patch is None: - raise ValueError('load_balancer_patch must be provided') - if isinstance(load_balancer_patch, LoadBalancerPatch): - load_balancer_patch = convert_model(load_balancer_patch) - headers = { - 'If-Match': if_match, - } + if not cidr: + raise ValueError('cidr must be provided') + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer', + operation_id='check_vpn_gateway_connections_peer_cidr', ) headers.update(sdk_headers) @@ -21885,52 +22247,58 @@ def update_load_balancer( 'generation': self.generation, } - data = json.dumps(load_balancer_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def get_load_balancer_statistics( + def add_vpn_gateway_connections_peer_cidr( self, + vpn_gateway_id: str, id: str, + cidr: str, **kwargs, ) -> DetailedResponse: """ - List statistics of a load balancer. + Set a peer CIDR on a VPN gateway connection. - This request lists statistics of a load balancer. + This request adds the specified CIDR to the specified VPN gateway connection. This + request succeeds if the specified CIDR already exists. A request body is not + required, and if provided, is ignored. + This request is only supported for policy mode VPN gateways. - :param str id: The load balancer identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr: The IP address range in CIDR block notation. :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 `LoadBalancerStatistics` object + :rtype: DetailedResponse """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not cidr: + raise ValueError('cidr must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_statistics', + operation_id='add_vpn_gateway_connections_peer_cidr', ) headers.update(sdk_headers) @@ -21942,14 +22310,13 @@ def get_load_balancer_statistics( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['vpn_gateway_id', 'id', 'cidr'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{id}/statistics'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, params=params, @@ -21958,35 +22325,59 @@ def get_load_balancer_statistics( response = self.send(request, **kwargs) return response - def list_load_balancer_listeners( + ######################### + # VPN servers + ######################### + + def list_vpn_servers( self, - load_balancer_id: str, + *, + name: Optional[str] = None, + start: Optional[str] = None, + limit: Optional[int] = None, + resource_group_id: Optional[str] = None, + sort: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List listeners for a load balancer. + List VPN servers. - This request lists listeners for a load balancer. + This request lists VPN servers. - :param str load_balancer_id: The load balancer identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :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 `LoadBalancerListenerCollection` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerCollection` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_listeners', + operation_id='list_vpn_servers', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'name': name, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'sort': sort, } if 'headers' in kwargs: @@ -21994,10 +22385,7 @@ def list_load_balancer_listeners( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id'] - path_param_values = self.encode_path_vars(load_balancer_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict) + url = '/vpn_servers' request = self.prepare_request( method='GET', url=url, @@ -22008,125 +22396,94 @@ def list_load_balancer_listeners( response = self.send(request, **kwargs) return response - def create_load_balancer_listener( + def create_vpn_server( self, - load_balancer_id: str, - protocol: str, + certificate: 'CertificateInstanceIdentity', + client_authentication: List['VPNServerAuthenticationPrototype'], + client_ip_pool: str, + subnets: List['SubnetIdentity'], *, - accept_proxy_protocol: Optional[bool] = None, - certificate_instance: Optional['CertificateInstanceIdentity'] = None, - connection_limit: Optional[int] = None, - default_pool: Optional['LoadBalancerPoolIdentity'] = None, - https_redirect: Optional['LoadBalancerListenerHTTPSRedirectPrototype'] = None, - idle_connection_timeout: Optional[int] = None, - policies: Optional[List['LoadBalancerListenerPolicyPrototype']] = None, + client_dns_server_ips: Optional[List['IP']] = None, + client_idle_timeout: Optional[int] = None, + enable_split_tunneling: Optional[bool] = None, + name: Optional[str] = None, port: Optional[int] = None, - port_max: Optional[int] = None, - port_min: Optional[int] = None, + protocol: Optional[str] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, + security_groups: Optional[List['SecurityGroupIdentity']] = None, **kwargs, ) -> DetailedResponse: """ - Create a listener for a load balancer. + Create a VPN server. - This request creates a new listener for a load balancer. + This request creates a new VPN server. - :param str load_balancer_id: The load balancer identifier. - :param str protocol: The listener protocol. Each listener in the load - balancer must have a unique `port` and `protocol` combination. - Load balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the `application` family - support `tcp`, `http` and - `https`. - Additional restrictions: - - If `default_pool` is set, the pool's protocol must match, or be - compatible with - the listener's protocol. At present, the compatible protocols are `http` - and - `https`. - - If `https_redirect` is set, the protocol must be `http`. - :param bool accept_proxy_protocol: (optional) If set to `true`, this - listener will accept and forward PROXY protocol information. Supported by - load balancers in the `application` family (otherwise always `false`). - Additional restrictions: - - If this listener has `https_redirect` specified, its - `accept_proxy_protocol` value must - match the `accept_proxy_protocol` value of the `https_redirect` listener. - - If this listener is the target of another listener's `https_redirect`, - its - `accept_proxy_protocol` value must match that listener's - `accept_proxy_protocol` value. - :param CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance to use for SSL termination. The listener must have a - `protocol` of `https`. - :param int connection_limit: (optional) The connection limit of the - listener. - :param LoadBalancerPoolIdentity default_pool: (optional) The default pool - for this listener. If `https_redirect` is specified, the - default pool will not be used. - If specified, the pool must: - - Belong to this load balancer. - - Have the same `protocol` as this listener, or have a compatible protocol. - At present, the compatible protocols are `http` and `https`. - - Not already be the `default_pool` for another listener. - If unspecified, this listener will be created with no default pool, but one - may be - subsequently set. - :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: - (optional) The target listener that requests will be redirected to if none - of the listener's - `policies` match. - If specified, this listener must have a `protocol` of `http`, and the - target - listener must have a `protocol` of `https`. - :param int idle_connection_timeout: (optional) The idle connection timeout - of the listener in seconds. Supported for load balancers in the - `application` family. - :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The - policy prototype objects for this listener. The load balancer must be in - the - `application` family. - :param int port: (optional) The listener port number, or the inclusive - lower bound of the port range. Each listener in the load balancer must have - a unique `port` and `protocol` combination. - Not supported for load balancers operating with route mode enabled. - :param int port_max: (optional) The inclusive upper bound of the range of - ports used by this listener. Must not be less than `port_min`. - Only load balancers with route mode enabled, or network load balancers with - `is_public` or `is_private_path` set to `true` support different values for - `port_min` and `port_max`. When route mode is enabled, the value `65535` - must be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :param int port_min: (optional) The inclusive lower bound of the range of - ports used by this listener. Must not be greater than `port_max`. - Only load balancers with route mode enabled, or network load balancers with - `is_public` or `is_private_path` set to `true` support different values for - `port_min` and `port_max`. When route mode is enabled, the value `1` must - be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. + :param CertificateInstanceIdentity certificate: The certificate instance + for this VPN server. + :param List[VPNServerAuthenticationPrototype] client_authentication: The + methods used to authenticate VPN clients to this VPN server. VPN clients + must authenticate against all specified methods. + :param str client_ip_pool: The VPN client IPv4 address pool, expressed in + CIDR format. The request must not overlap with any existing address + prefixes in the VPC or any of the following reserved address ranges: + - `127.0.0.0/8` (IPv4 loopback addresses) + - `161.26.0.0/16` (IBM services) + - `166.8.0.0/14` (Cloud Service Endpoints) + - `169.254.0.0/16` (IPv4 link-local addresses) + - `224.0.0.0/4` (IPv4 multicast addresses) + The prefix length of the client IP address pool's CIDR must be between + `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that + contains twice the number of IP addresses that are required to enable the + maximum number of concurrent connections is recommended. + :param List[SubnetIdentity] subnets: The subnets to provision this VPN + server in. Use subnets in different zones for high availability. + :param List[IP] client_dns_server_ips: (optional) The DNS server addresses + that will be provided to VPN clients connected to this VPN server. + :param int client_idle_timeout: (optional) The seconds a VPN client can be + idle before this VPN server will disconnect it. Specify `0` to prevent + the server from disconnecting idle clients. + :param bool enable_split_tunneling: (optional) Indicates whether the split + tunneling is enabled on this VPN server. + :param str name: (optional) The name for this VPN server. The name must not + be used by another VPN server in the VPC. If unspecified, the name will be + a hyphenated list of randomly-selected words. + :param int port: (optional) The port number to use for this VPN server. + :param str protocol: (optional) The transport protocol to use for this VPN + server. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this VPN server. If unspecified, the VPC's default + security group is used. :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 `LoadBalancerListener` object + :rtype: DetailedResponse with `dict` result representing a `VPNServer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if protocol is None: - raise ValueError('protocol must be provided') - if certificate_instance is not None: - certificate_instance = convert_model(certificate_instance) - if default_pool is not None: - default_pool = convert_model(default_pool) - if https_redirect is not None: - https_redirect = convert_model(https_redirect) - if policies is not None: - policies = [convert_model(x) for x in policies] + if certificate is None: + raise ValueError('certificate must be provided') + if client_authentication is None: + raise ValueError('client_authentication must be provided') + if client_ip_pool is None: + raise ValueError('client_ip_pool must be provided') + if subnets is None: + raise ValueError('subnets must be provided') + certificate = convert_model(certificate) + client_authentication = [convert_model(x) for x in client_authentication] + subnets = [convert_model(x) for x in subnets] + if client_dns_server_ips is not None: + client_dns_server_ips = [convert_model(x) for x in client_dns_server_ips] + if resource_group is not None: + resource_group = convert_model(resource_group) + if security_groups is not None: + security_groups = [convert_model(x) for x in security_groups] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_listener', + operation_id='create_vpn_server', ) headers.update(sdk_headers) @@ -22136,17 +22493,18 @@ def create_load_balancer_listener( } data = { - 'protocol': protocol, - 'accept_proxy_protocol': accept_proxy_protocol, - 'certificate_instance': certificate_instance, - 'connection_limit': connection_limit, - 'default_pool': default_pool, - 'https_redirect': https_redirect, - 'idle_connection_timeout': idle_connection_timeout, - 'policies': policies, + 'certificate': certificate, + 'client_authentication': client_authentication, + 'client_ip_pool': client_ip_pool, + 'subnets': subnets, + 'client_dns_server_ips': client_dns_server_ips, + 'client_idle_timeout': client_idle_timeout, + 'enable_split_tunneling': enable_split_tunneling, + 'name': name, 'port': port, - 'port_max': port_max, - 'port_min': port_min, + 'protocol': protocol, + 'resource_group': resource_group, + 'security_groups': security_groups, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -22157,10 +22515,7 @@ def create_load_balancer_listener( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id'] - path_param_values = self.encode_path_vars(load_balancer_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict) + url = '/vpn_servers' request = self.prepare_request( method='POST', url=url, @@ -22172,35 +22527,35 @@ def create_load_balancer_listener( response = self.send(request, **kwargs) return response - def delete_load_balancer_listener( + def delete_vpn_server( self, - load_balancer_id: str, id: str, + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer listener. + Delete a VPN server. - This request deletes a load balancer listener. This operation cannot be reversed. - For this operation to succeed, the listener must not be the target of another load - balancer listener. + This request deletes a VPN server. This operation cannot be reversed. - :param str load_balancer_id: The load balancer identifier. - :param str id: The listener identifier. + :param str id: The VPN server identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - headers = {} + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer_listener', + operation_id='delete_vpn_server', ) headers.update(sdk_headers) @@ -22213,10 +22568,10 @@ def delete_load_balancer_listener( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) + url = '/vpn_servers/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -22227,34 +22582,29 @@ def delete_load_balancer_listener( response = self.send(request, **kwargs) return response - def get_load_balancer_listener( + def get_vpn_server( self, - load_balancer_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer listener. + Retrieve a VPN server. - This request retrieves a single listener specified by the identifier in the URL - path. + This request retrieves a single VPN server specified by the identifier in the URL. - :param str load_balancer_id: The load balancer identifier. - :param str id: The listener identifier. + :param str id: The VPN server 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 `LoadBalancerListener` object + :rtype: DetailedResponse with `dict` result representing a `VPNServer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_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_load_balancer_listener', + operation_id='get_vpn_server', ) headers.update(sdk_headers) @@ -22268,10 +22618,10 @@ def get_load_balancer_listener( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) + url = '/vpn_servers/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -22282,40 +22632,43 @@ def get_load_balancer_listener( response = self.send(request, **kwargs) return response - def update_load_balancer_listener( + def update_vpn_server( self, - load_balancer_id: str, id: str, - load_balancer_listener_patch: 'LoadBalancerListenerPatch', + vpn_server_patch: 'VPNServerPatch', + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Update a load balancer listener. + Update a VPN server. - This request updates a load balancer listener from a listener patch. + This request updates the properties of an existing VPN server. Any updates other + than to `name` will cause all connected VPN clients to be disconnected. - :param str load_balancer_id: The load balancer identifier. - :param str id: The listener identifier. - :param LoadBalancerListenerPatch load_balancer_listener_patch: The load - balancer listener patch. + :param str id: The VPN server identifier. + :param VPNServerPatch vpn_server_patch: The VPN server patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :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 `LoadBalancerListener` object + :rtype: DetailedResponse with `dict` result representing a `VPNServer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - if load_balancer_listener_patch is None: - raise ValueError('load_balancer_listener_patch must be provided') - if isinstance(load_balancer_listener_patch, LoadBalancerListenerPatch): - load_balancer_listener_patch = convert_model(load_balancer_listener_patch) - headers = {} + if vpn_server_patch is None: + raise ValueError('vpn_server_patch must be provided') + if isinstance(vpn_server_patch, VPNServerPatch): + vpn_server_patch = convert_model(vpn_server_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_listener', + operation_id='update_vpn_server', ) headers.update(sdk_headers) @@ -22324,7 +22677,7 @@ def update_load_balancer_listener( 'generation': self.generation, } - data = json.dumps(load_balancer_listener_patch) + data = json.dumps(vpn_server_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -22332,10 +22685,10 @@ def update_load_balancer_listener( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) + url = '/vpn_servers/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -22347,35 +22700,31 @@ def update_load_balancer_listener( response = self.send(request, **kwargs) return response - def list_load_balancer_listener_policies( + def get_vpn_server_client_configuration( self, - load_balancer_id: str, - listener_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List policies for a load balancer listener. + Retrieve client configuration. - This request lists policies for a load balancer listener. A policy consists of - rules to match against each incoming request, and an action to apply to the - request if a rule matches. + This request retrieves OpenVPN client configuration on a single VPN server + specified by the identifier in the URL. This configuration includes directives + compatible with OpenVPN releases 2.4 and 2.5. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. + :param str id: The VPN server 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 `LoadBalancerListenerPolicyCollection` object + :rtype: DetailedResponse with `str` result """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_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_load_balancer_listener_policies', + operation_id='get_vpn_server_client_configuration', ) headers.update(sdk_headers) @@ -22387,12 +22736,12 @@ def list_load_balancer_listener_policies( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' + headers['Accept'] = 'text/plain' - path_param_keys = ['load_balancer_id', 'listener_id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict) + url = '/vpn_servers/{id}/client_configuration'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -22403,143 +22752,100 @@ def list_load_balancer_listener_policies( response = self.send(request, **kwargs) return response - def create_load_balancer_listener_policy( + def list_vpn_server_clients( self, - load_balancer_id: str, - listener_id: str, - action: str, - priority: int, + vpn_server_id: str, *, - name: Optional[str] = None, - rules: Optional[List['LoadBalancerListenerPolicyRulePrototype']] = None, - target: Optional['LoadBalancerListenerPolicyTargetPrototype'] = None, + start: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Create a policy for a load balancer listener. + List VPN clients for a VPN server. - This request creates a new policy from a load balancer listener policy object. The - prototype object is structured in the same way as a retrieved policy, and contains - the information necessary to create the new policy. For this request to succeed, - the listener must have a `protocol` of `http` or `https`. + This request retrieves connected VPN clients, and any disconnected VPN clients + that the VPN server has not yet deleted based on its auto-deletion policy. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str action: The policy action: - - `forward`: Requests will be forwarded to the specified `target` pool - - `https_redirect`: Requests will be redirected to the specified target - listener. The - listener must have a `protocol` of `http`, and the target listener must - have a - `protocol` of `https` - - `redirect`: Requests will be redirected to the specified `target.url` - - `reject`: Requests will be rejected with a `403` status code. - :param int priority: Priority of the policy. The priority is unique across - all policies for this load balancer listener. Lower value indicates higher - priority. - :param str name: (optional) The name for this policy. The name must not be - used by another policy for the load balancer listener. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The - rule prototype objects for this policy. - :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If - `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPrototype`. + :param str vpn_server_id: The VPN server identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order. :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 `LoadBalancerListenerPolicy` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerClientCollection` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if action is None: - raise ValueError('action must be provided') - if priority is None: - raise ValueError('priority must be provided') - if rules is not None: - rules = [convert_model(x) for x in rules] - if target is not None: - target = convert_model(target) + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_listener_policy', + operation_id='list_vpn_server_clients', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'sort': sort, } - data = { - 'action': action, - 'priority': priority, - 'name': name, - 'rules': rules, - 'target': target, - } - 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 = ['load_balancer_id', 'listener_id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id) + path_param_keys = ['vpn_server_id'] + path_param_values = self.encode_path_vars(vpn_server_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/clients'.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 delete_load_balancer_listener_policy( + def delete_vpn_server_client( self, - load_balancer_id: str, - listener_id: str, + vpn_server_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer listener policy. + Delete a VPN client. - Deletes a policy of the load balancer listener. This operation cannot be reversed. + This request disconnects and deletes the VPN client from the VPN server. The VPN + client may reconnect unless its authentication permissions for the configured + authentication methods (such as its client certificate) have been revoked. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str id: The policy identifier. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN client 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 load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_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_load_balancer_listener_policy', + operation_id='delete_vpn_server_client', ) headers.update(sdk_headers) @@ -22552,10 +22858,10 @@ def delete_load_balancer_listener_policy( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['load_balancer_id', 'listener_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -22566,37 +22872,33 @@ def delete_load_balancer_listener_policy( response = self.send(request, **kwargs) return response - def get_load_balancer_listener_policy( + def get_vpn_server_client( self, - load_balancer_id: str, - listener_id: str, + vpn_server_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer listener policy. + Retrieve a VPN client. - Retrieve a single policy specified by the identifier in the URL path. + This request retrieves a single VPN client specified by the identifier in the URL. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str id: The policy identifier. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN client 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 `LoadBalancerListenerPolicy` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerClient` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_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_load_balancer_listener_policy', + operation_id='get_vpn_server_client', ) headers.update(sdk_headers) @@ -22610,10 +22912,10 @@ def get_load_balancer_listener_policy( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -22624,46 +22926,36 @@ def get_load_balancer_listener_policy( response = self.send(request, **kwargs) return response - def update_load_balancer_listener_policy( + def disconnect_vpn_client( self, - load_balancer_id: str, - listener_id: str, + vpn_server_id: str, id: str, - load_balancer_listener_policy_patch: 'LoadBalancerListenerPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Update a load balancer listener policy. + Disconnect a VPN client. - This request updates a load balancer listener policy with the information in a - provided policy patch. The policy patch object is structured in the same way as a - retrieved policy and contains only the information to be updated. + This request disconnects the specified VPN client, and deletes the client + according to the VPN server's auto-deletion policy. The VPN client may reconnect + unless its authentication permissions for the configured authentication methods + (such as its client certificate) have been revoked. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str id: The policy identifier. - :param LoadBalancerListenerPolicyPatch load_balancer_listener_policy_patch: - The listener policy patch. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN client 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 `LoadBalancerListenerPolicy` object + :rtype: DetailedResponse """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') if not id: raise ValueError('id must be provided') - if load_balancer_listener_policy_patch is None: - raise ValueError('load_balancer_listener_policy_patch must be provided') - if isinstance(load_balancer_listener_policy_patch, LoadBalancerListenerPolicyPatch): - load_balancer_listener_policy_patch = convert_model(load_balancer_listener_policy_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_listener_policy', + operation_id='disconnect_vpn_client', ) headers.update(sdk_headers) @@ -22672,66 +22964,71 @@ def update_load_balancer_listener_policy( 'generation': self.generation, } - data = json.dumps(load_balancer_listener_policy_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/clients/{id}/disconnect'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='POST', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_load_balancer_listener_policy_rules( + def list_vpn_server_routes( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, + vpn_server_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - List rules of a load balancer listener policy. + List VPN routes for a VPN server. - This request lists rules of a load balancer listener policy. + This request lists VPN routes in a VPN server. All VPN routes are provided to the + VPN client when the connection is established. Packets received from the VPN + client will be dropped by the VPN server if there is no VPN route matching their + specified destinations. All VPN routes must be unique within the VPN server. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. + :param str vpn_server_id: The VPN server identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :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 `LoadBalancerListenerPolicyRuleCollection` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerRouteCollection` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_listener_policy_rules', + operation_id='list_vpn_server_routes', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'sort': sort, } if 'headers' in kwargs: @@ -22739,10 +23036,10 @@ def list_load_balancer_listener_policy_rules( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id) + path_param_keys = ['vpn_server_id'] + path_param_values = self.encode_path_vars(vpn_server_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -22753,61 +23050,52 @@ def list_load_balancer_listener_policy_rules( response = self.send(request, **kwargs) return response - def create_load_balancer_listener_policy_rule( + def create_vpn_server_route( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, - condition: str, - type: str, - value: str, - *, - field: Optional[str] = None, + vpn_server_id: str, + destination: str, + *, + action: Optional[str] = None, + name: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Create a rule for a load balancer listener policy. + Create a VPN route for a VPN server. - Creates a new rule for the load balancer listener policy. + This request creates a new VPN route in the VPN server. All VPN routes are + provided to the VPN client when the connection is established. Packets received + from the VPN client will be dropped by the VPN server if there is no VPN route + matching their specified destinations. All VPN routes must be unique within the + VPN server. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. - :param str condition: The condition for the rule. - :param str type: The type of the rule. Body rules are applied to - form-encoded request bodies using the - `UTF-8` character set. - :param str value: The value to be matched for the rule condition. - If the rule type is `query` and the rule condition is not `matches_regex`, - the value must be percent-encoded. - :param str field: (optional) The field to match for this rule. This - property must be specified if the rule type is - `header`, may be specified if the rule type is `body` or `query`, and must - not be specified if the rule type is `hostname` or `path`. - If the rule condition is not `matches_regex`, the value must be - percent-encoded. + :param str vpn_server_id: The VPN server identifier. + :param str destination: The destination to use for this VPN route in the + VPN server. Must be unique within the VPN server. If an incoming packet + does not match any destination, it will be dropped. + :param str action: (optional) The action to perform with a packet matching + the VPN route: + - `translate`: translate the source IP address to one of the private IP + addresses of + the VPN server, then deliver the packet to target. + - `deliver`: deliver the packet to the target. + - `drop`: drop the packet. + :param str name: (optional) The name for this VPN server route. The name + must not be used by another route for the VPN server. If unspecified, the + name will be a hyphenated list of randomly-selected words. :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 `LoadBalancerListenerPolicyRule` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') - if condition is None: - raise ValueError('condition must be provided') - if type is None: - raise ValueError('type must be provided') - if value is None: - raise ValueError('value must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') + if destination is None: + raise ValueError('destination must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_listener_policy_rule', + operation_id='create_vpn_server_route', ) headers.update(sdk_headers) @@ -22817,10 +23105,9 @@ def create_load_balancer_listener_policy_rule( } data = { - 'condition': condition, - 'type': type, - 'value': value, - 'field': field, + 'destination': destination, + 'action': action, + 'name': name, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -22831,10 +23118,10 @@ def create_load_balancer_listener_policy_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id) + path_param_keys = ['vpn_server_id'] + path_param_values = self.encode_path_vars(vpn_server_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -22846,42 +23133,33 @@ def create_load_balancer_listener_policy_rule( response = self.send(request, **kwargs) return response - def delete_load_balancer_listener_policy_rule( + def delete_vpn_server_route( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, + vpn_server_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer listener policy rule. + Delete a VPN route. - Deletes a rule from the load balancer listener policy. This operation cannot be - reversed. + This request deletes a VPN route. This operation cannot be reversed. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. - :param str id: The rule identifier. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN route 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 load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_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_load_balancer_listener_policy_rule', + operation_id='delete_vpn_server_route', ) headers.update(sdk_headers) @@ -22894,10 +23172,10 @@ def delete_load_balancer_listener_policy_rule( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -22908,41 +23186,33 @@ def delete_load_balancer_listener_policy_rule( response = self.send(request, **kwargs) return response - def get_load_balancer_listener_policy_rule( + def get_vpn_server_route( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, + vpn_server_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer listener policy rule. + Retrieve a VPN route. - Retrieves a single rule specified by the identifier in the URL path. + This request retrieves a single VPN route specified by the identifier in the URL. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. - :param str id: The rule identifier. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN route 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 `LoadBalancerListenerPolicyRule` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_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_load_balancer_listener_policy_rule', + operation_id='get_vpn_server_route', ) headers.update(sdk_headers) @@ -22956,10 +23226,10 @@ def get_load_balancer_listener_policy_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -22970,48 +23240,41 @@ def get_load_balancer_listener_policy_rule( response = self.send(request, **kwargs) return response - def update_load_balancer_listener_policy_rule( + def update_vpn_server_route( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, + vpn_server_id: str, id: str, - load_balancer_listener_policy_rule_patch: 'LoadBalancerListenerPolicyRulePatch', + vpn_server_route_patch: 'VPNServerRoutePatch', **kwargs, ) -> DetailedResponse: """ - Update a load balancer listener policy rule. + Update a VPN route. - Updates a rule of the load balancer listener policy. + This request updates a VPN route with the information in a provided VPN route + patch. The VPN route patch object is structured in the same way as a retrieved VPN + route and contains only the information to be updated. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. - :param str id: The rule identifier. - :param LoadBalancerListenerPolicyRulePatch - load_balancer_listener_policy_rule_patch: The listener policy rule patch. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN route identifier. + :param VPNServerRoutePatch vpn_server_route_patch: The VPN route patch. :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 `LoadBalancerListenerPolicyRule` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') if not id: raise ValueError('id must be provided') - if load_balancer_listener_policy_rule_patch is None: - raise ValueError('load_balancer_listener_policy_rule_patch must be provided') - if isinstance(load_balancer_listener_policy_rule_patch, LoadBalancerListenerPolicyRulePatch): - load_balancer_listener_policy_rule_patch = convert_model(load_balancer_listener_policy_rule_patch) + if vpn_server_route_patch is None: + raise ValueError('vpn_server_route_patch must be provided') + if isinstance(vpn_server_route_patch, VPNServerRoutePatch): + vpn_server_route_patch = convert_model(vpn_server_route_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_listener_policy_rule', + operation_id='update_vpn_server_route', ) headers.update(sdk_headers) @@ -23020,7 +23283,7 @@ def update_load_balancer_listener_policy_rule( 'generation': self.generation, } - data = json.dumps(load_balancer_listener_policy_rule_patch) + data = json.dumps(vpn_server_route_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -23028,10 +23291,10 @@ def update_load_balancer_listener_policy_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -23043,35 +23306,45 @@ def update_load_balancer_listener_policy_rule( response = self.send(request, **kwargs) return response - def list_load_balancer_pools( + ######################### + # Load balancers + ######################### + + def list_load_balancer_profiles( self, - load_balancer_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - List pools of a load balancer. + List load balancer profiles. - This request lists pools of a load balancer. + This request lists load balancer profiles available in the region. A load balancer + profile specifies the performance characteristics and pricing model for a load + balancer. - :param str load_balancer_id: The load balancer identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :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 `LoadBalancerPoolCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfileCollection` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_pools', + operation_id='list_load_balancer_profiles', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, } if 'headers' in kwargs: @@ -23079,10 +23352,57 @@ def list_load_balancer_pools( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id'] - path_param_values = self.encode_path_vars(load_balancer_id) + url = '/load_balancer/profiles' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_load_balancer_profile( + self, + name: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve a load balancer profile. + + This request retrieves a load balancer profile specified by the name in the URL. + + :param str name: The load balancer profile 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 `LoadBalancerProfile` object + """ + + 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_load_balancer_profile', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + 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_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict) + url = '/load_balancer/profiles/{name}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -23093,78 +23413,162 @@ def list_load_balancer_pools( response = self.send(request, **kwargs) return response - def create_load_balancer_pool( + def list_load_balancers( self, - load_balancer_id: str, - algorithm: str, - health_monitor: 'LoadBalancerPoolHealthMonitorPrototype', - protocol: str, *, - members: Optional[List['LoadBalancerPoolMemberPrototype']] = None, + start: Optional[str] = None, + limit: Optional[int] = None, + **kwargs, + ) -> DetailedResponse: + """ + List load balancers. + + This request lists load balancers in the region. + + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :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 `LoadBalancerCollection` object + """ + + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_load_balancers', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/load_balancers' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def create_load_balancer( + self, + is_public: bool, + subnets: List['SubnetIdentity'], + *, + dns: Optional['LoadBalancerDNSPrototype'] = None, + is_private_path: Optional[bool] = None, + listeners: Optional[List['LoadBalancerListenerPrototypeLoadBalancerContext']] = None, + logging: Optional['LoadBalancerLoggingPrototype'] = None, name: Optional[str] = None, - proxy_protocol: Optional[str] = None, - session_persistence: Optional['LoadBalancerPoolSessionPersistencePrototype'] = None, + pools: Optional[List['LoadBalancerPoolPrototype']] = None, + profile: Optional['LoadBalancerProfileIdentity'] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, + route_mode: Optional[bool] = None, + security_groups: Optional[List['SecurityGroupIdentity']] = None, **kwargs, ) -> DetailedResponse: """ - Create a load balancer pool. + Create a load balancer. - This request creates a new pool from a pool prototype object. + This request creates and provisions a new load balancer. - :param str load_balancer_id: The load balancer identifier. - :param str algorithm: The load balancing algorithm. The `least_connections` - algorithm is only supported for load balancers that have `availability` - with value `subnet` in the profile. - :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health - monitor of this pool. - :param str protocol: The protocol used for this load balancer pool. Load - balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the - `application` family support `tcp`, `http`, and `https`. - :param List[LoadBalancerPoolMemberPrototype] members: (optional) The - members for this load balancer pool. For load balancers in the `network` - family, the same `port` and `target` tuple cannot be shared by a pool - member of any other load balancer in the same VPC. - :param str name: (optional) The name for this load balancer pool. The name - must not be used by another pool for the load balancer. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param str proxy_protocol: (optional) The PROXY protocol setting for this - pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - For load balancers in the `network` family, this property must be - `disabled`. - :param LoadBalancerPoolSessionPersistencePrototype session_persistence: - (optional) The session persistence of this pool. If specified, the load - balancer must have - `source_ip_session_persistence_supported` set to `true` in its profile. If - unspecified, session persistence will be disabled, and traffic will be - distributed - across backend server members of the pool. + :param bool is_public: Indicates whether this load balancer is public. + At present, + - If route mode is enabled, the load balancer must be private. + - If `is_private_path` is specified, it must be set to `false`. + :param List[SubnetIdentity] subnets: The subnets to provision this load + balancer in. The subnets must be in the same VPC. + - If 'availability' is specified as `subnet` in the profile, the load + balancer's availability will depend on the availability of the zones that + the subnets reside in. + - If 'availability' is specified as `region` in the profile, the load + balancer remains available as long as any zone in the region is available. + Only members in healthy zones will be sent new connections. + Load balancers in the `network` family allow only one subnet to be + specified. + :param LoadBalancerDNSPrototype dns: (optional) The DNS configuration for + this load balancer. + If unspecified, DNS `A` records for this load balancer's `hostname` + property will be added + to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` + records will be + added to the specified `zone`. + Not supported by private path load balancers. + :param bool is_private_path: (optional) Indicates whether this is a private + path load balancer. + :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners: + (optional) The listeners of this load balancer. + :param LoadBalancerLoggingPrototype logging: (optional) The logging + configuration to use for this load balancer. See [VPC Datapath + Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the + logging + format, fields and permitted values. If unspecified, `datapath.active` will + be `false`. + To activate logging, the load balancer profile must support the specified + logging type. + :param str name: (optional) The name for this load balancer. The name must + not be used by another load balancer in the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. + :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this + load balancer. + :param LoadBalancerProfileIdentity profile: (optional) The profile to use + for this load balancer. + If unspecified, `application` will be used. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. + :param bool route_mode: (optional) Indicates whether route mode is enabled + for this load balancer. + At present, public load balancers are not supported with route mode + enabled. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this load balancer. If unspecified, the VPC's default + security group is used. + The load balancer profile must support security groups. :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 `LoadBalancerPool` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if algorithm is None: - raise ValueError('algorithm must be provided') - if health_monitor is None: - raise ValueError('health_monitor must be provided') - if protocol is None: - raise ValueError('protocol must be provided') - health_monitor = convert_model(health_monitor) - if members is not None: - members = [convert_model(x) for x in members] - if session_persistence is not None: - session_persistence = convert_model(session_persistence) + if is_public is None: + raise ValueError('is_public must be provided') + if subnets is None: + raise ValueError('subnets must be provided') + subnets = [convert_model(x) for x in subnets] + if dns is not None: + dns = convert_model(dns) + if listeners is not None: + listeners = [convert_model(x) for x in listeners] + if logging is not None: + logging = convert_model(logging) + if pools is not None: + pools = [convert_model(x) for x in pools] + if profile is not None: + profile = convert_model(profile) + if resource_group is not None: + resource_group = convert_model(resource_group) + if security_groups is not None: + security_groups = [convert_model(x) for x in security_groups] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_pool', + operation_id='create_load_balancer', ) headers.update(sdk_headers) @@ -23174,13 +23578,18 @@ def create_load_balancer_pool( } data = { - 'algorithm': algorithm, - 'health_monitor': health_monitor, - 'protocol': protocol, - 'members': members, + 'is_public': is_public, + 'subnets': subnets, + 'dns': dns, + 'is_private_path': is_private_path, + 'listeners': listeners, + 'logging': logging, 'name': name, - 'proxy_protocol': proxy_protocol, - 'session_persistence': session_persistence, + 'pools': pools, + 'profile': profile, + 'resource_group': resource_group, + 'route_mode': route_mode, + 'security_groups': security_groups, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -23191,10 +23600,7 @@ def create_load_balancer_pool( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id'] - path_param_values = self.encode_path_vars(load_balancer_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict) + url = '/load_balancers' request = self.prepare_request( method='POST', url=url, @@ -23206,34 +23612,37 @@ def create_load_balancer_pool( response = self.send(request, **kwargs) return response - def delete_load_balancer_pool( + def delete_load_balancer( self, - load_balancer_id: str, id: str, + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer pool. + Delete a load balancer. - This request deletes a load balancer pool. This operation cannot be reversed. The - pool must not currently be the default pool for any listener in the load balancer. + This request deletes a load balancer. This operation cannot be reversed. A load + balancer cannot be deleted if its `provisioning_status` is `delete_pending` or it + is referenced by a resource. - :param str load_balancer_id: The load balancer identifier. - :param str id: The pool identifier. + :param str id: The load balancer identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - headers = {} + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer_pool', + operation_id='delete_load_balancer', ) headers.update(sdk_headers) @@ -23246,10 +23655,10 @@ def delete_load_balancer_pool( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) + url = '/load_balancers/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -23260,33 +23669,30 @@ def delete_load_balancer_pool( response = self.send(request, **kwargs) return response - def get_load_balancer_pool( + def get_load_balancer( self, - load_balancer_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer pool. + Retrieve a load balancer. - This request retrieves a single pool specified by the identifier in the URL path. + This request retrieves a single load balancer specified by the identifier in the + URL path. - :param str load_balancer_id: The load balancer identifier. - :param str id: The pool identifier. + :param str id: The load balancer 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 `LoadBalancerPool` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_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_load_balancer_pool', + operation_id='get_load_balancer', ) headers.update(sdk_headers) @@ -23300,10 +23706,10 @@ def get_load_balancer_pool( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) + url = '/load_balancers/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -23314,40 +23720,45 @@ def get_load_balancer_pool( response = self.send(request, **kwargs) return response - def update_load_balancer_pool( + def update_load_balancer( self, - load_balancer_id: str, id: str, - load_balancer_pool_patch: 'LoadBalancerPoolPatch', + load_balancer_patch: 'LoadBalancerPatch', + *, + if_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Update a load balancer pool. + Update a load balancer. - This request updates a load balancer pool from a pool patch. + This request updates a load balancer with the information in a provided load + balancer patch. The load balancer patch object is structured in the same way as a + retrieved load balancer and contains only the information to be updated. A load + balancer can only be updated if its `provisioning_status` is `active`. - :param str load_balancer_id: The load balancer identifier. - :param str id: The pool identifier. - :param LoadBalancerPoolPatch load_balancer_pool_patch: The load balancer - pool patch. + :param str id: The load balancer identifier. + :param LoadBalancerPatch load_balancer_patch: The load balancer patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :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 `LoadBalancerPool` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - if load_balancer_pool_patch is None: - raise ValueError('load_balancer_pool_patch must be provided') - if isinstance(load_balancer_pool_patch, LoadBalancerPoolPatch): - load_balancer_pool_patch = convert_model(load_balancer_pool_patch) - headers = {} + if load_balancer_patch is None: + raise ValueError('load_balancer_patch must be provided') + if isinstance(load_balancer_patch, LoadBalancerPatch): + load_balancer_patch = convert_model(load_balancer_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_pool', + operation_id='update_load_balancer', ) headers.update(sdk_headers) @@ -23356,7 +23767,7 @@ def update_load_balancer_pool( 'generation': self.generation, } - data = json.dumps(load_balancer_pool_patch) + data = json.dumps(load_balancer_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -23364,10 +23775,10 @@ def update_load_balancer_pool( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) + url = '/load_balancers/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -23379,33 +23790,29 @@ def update_load_balancer_pool( response = self.send(request, **kwargs) return response - def list_load_balancer_pool_members( + def get_load_balancer_statistics( self, - load_balancer_id: str, - pool_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List members of a load balancer pool. + List statistics of a load balancer. - This request lists members of a load balancer pool. + This request lists statistics of a load balancer. - :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. + :param str id: The load balancer 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 `LoadBalancerPoolMemberCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerStatistics` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_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_load_balancer_pool_members', + operation_id='get_load_balancer_statistics', ) headers.update(sdk_headers) @@ -23419,10 +23826,10 @@ def list_load_balancer_pool_members( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + url = '/load_balancers/{id}/statistics'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -23433,60 +23840,29 @@ def list_load_balancer_pool_members( response = self.send(request, **kwargs) return response - def create_load_balancer_pool_member( + def list_load_balancer_listeners( self, load_balancer_id: str, - pool_id: str, - port: int, - target: 'LoadBalancerPoolMemberTargetPrototype', - *, - weight: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - Create a member in a load balancer pool. + List listeners for a load balancer. - This request creates a new member and adds the member to the pool. + This request lists listeners for a load balancer. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param int port: The port the member will receive load balancer traffic on. - Applies only to load balancer traffic received on a listener with a single - port. (If the traffic is received on a listener with a port range, the - member will receive the traffic on the same port the listener received it - on.) - This port will also be used for health checks unless the `port` property of - `health_monitor` property is specified. - The port must be unique across all members for all pools associated with - this pool's listener. - :param LoadBalancerPoolMemberTargetPrototype target: The pool member - target. Load balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. - If the load - balancer has route mode enabled, the member must be in a zone the load - balancer has a - subnet in. - :param int weight: (optional) The weight of the server member. - If specified, the pool algorithm must be `weighted_round_robin`. :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 `LoadBalancerPoolMember` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerCollection` object """ if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') - if port is None: - raise ValueError('port must be provided') - if target is None: - raise ValueError('target must be provided') - target = convert_model(target) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_pool_member', + operation_id='list_load_balancer_listeners', ) headers.update(sdk_headers) @@ -23495,69 +23871,146 @@ def create_load_balancer_pool_member( 'generation': self.generation, } - data = { - 'port': port, - 'target': target, - 'weight': weight, - } - 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 = ['load_balancer_id', 'pool_id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_keys = ['load_balancer_id'] + path_param_values = self.encode_path_vars(load_balancer_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners'.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_load_balancer_pool_members( + def create_load_balancer_listener( self, load_balancer_id: str, - pool_id: str, - members: List['LoadBalancerPoolMemberPrototype'], + protocol: str, + *, + accept_proxy_protocol: Optional[bool] = None, + certificate_instance: Optional['CertificateInstanceIdentity'] = None, + connection_limit: Optional[int] = None, + default_pool: Optional['LoadBalancerPoolIdentity'] = None, + https_redirect: Optional['LoadBalancerListenerHTTPSRedirectPrototype'] = None, + idle_connection_timeout: Optional[int] = None, + policies: Optional[List['LoadBalancerListenerPolicyPrototype']] = None, + port: Optional[int] = None, + port_max: Optional[int] = None, + port_min: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - Replace load balancer pool members. + Create a listener for a load balancer. - This request replaces the existing members of the load balancer pool with new - members created from the collection of member prototype objects. + This request creates a new listener for a load balancer. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param List[LoadBalancerPoolMemberPrototype] members: The member prototype - objects for this pool. + :param str protocol: The listener protocol. Each listener in the load + balancer must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be + compatible with + the listener's protocol. At present, the compatible protocols are `http` + and + `https`. + - If `https_redirect` is set, the protocol must be `http`. + :param bool accept_proxy_protocol: (optional) If set to `true`, this + listener will accept and forward PROXY protocol information. Supported by + load balancers in the `application` family (otherwise always `false`). + Additional restrictions: + - If this listener has `https_redirect` specified, its + `accept_proxy_protocol` value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, + its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. + :param CertificateInstanceIdentity certificate_instance: (optional) The + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. + :param int connection_limit: (optional) The concurrent connection limit for + the listener. If reached, incoming connections may be queued or rejected. + This property will be present for load balancers in the `application` + family. + :param LoadBalancerPoolIdentity default_pool: (optional) The default pool + for this listener. If `https_redirect` is specified, the + default pool will not be used. + If specified, the pool must: + - Belong to this load balancer. + - Have the same `protocol` as this listener, or have a compatible protocol. + At present, the compatible protocols are `http` and `https`. + - Not already be the `default_pool` for another listener. + If unspecified, this listener will be created with no default pool, but one + may be + subsequently set. + :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: + (optional) The target listener that requests will be redirected to if none + of the listener's + `policies` match. + If specified, this listener must have a `protocol` of `http`, and the + target + listener must have a `protocol` of `https`. + :param int idle_connection_timeout: (optional) The idle connection timeout + of the listener in seconds. + Supported for load balancers in the `application` family. + :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The + policy prototype objects for this listener. The load balancer must be in + the + `application` family. + :param int port: (optional) The listener port number, or the inclusive + lower bound of the port range. Each listener in the load balancer must have + a unique `port` and `protocol` combination. + Not supported for load balancers operating with route mode enabled. + :param int port_max: (optional) The inclusive upper bound of the range of + ports used by this listener. Must not be less than `port_min`. + Only load balancers with route mode enabled, or network load balancers with + `is_public` or `is_private_path` set to `true` support different values for + `port_min` and `port_max`. When route mode is enabled, the value `65535` + must be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :param int port_min: (optional) The inclusive lower bound of the range of + ports used by this listener. Must not be greater than `port_max`. + Only load balancers with route mode enabled, or network load balancers with + `is_public` or `is_private_path` set to `true` support different values for + `port_min` and `port_max`. When route mode is enabled, the value `1` must + be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. :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 `LoadBalancerPoolMemberCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') - if members is None: - raise ValueError('members must be provided') - members = [convert_model(x) for x in members] + if protocol is None: + raise ValueError('protocol must be provided') + if certificate_instance is not None: + certificate_instance = convert_model(certificate_instance) + if default_pool is not None: + default_pool = convert_model(default_pool) + if https_redirect is not None: + https_redirect = convert_model(https_redirect) + if policies is not None: + policies = [convert_model(x) for x in policies] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='replace_load_balancer_pool_members', + operation_id='create_load_balancer_listener', ) headers.update(sdk_headers) @@ -23567,7 +24020,17 @@ def replace_load_balancer_pool_members( } data = { - 'members': members, + 'protocol': protocol, + 'accept_proxy_protocol': accept_proxy_protocol, + 'certificate_instance': certificate_instance, + 'connection_limit': connection_limit, + 'default_pool': default_pool, + 'https_redirect': https_redirect, + 'idle_connection_timeout': idle_connection_timeout, + 'policies': policies, + 'port': port, + 'port_max': port_max, + 'port_min': port_min, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -23578,12 +24041,12 @@ def replace_load_balancer_pool_members( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_keys = ['load_balancer_id'] + path_param_values = self.encode_path_vars(load_balancer_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='POST', url=url, headers=headers, params=params, @@ -23593,21 +24056,21 @@ def replace_load_balancer_pool_members( response = self.send(request, **kwargs) return response - def delete_load_balancer_pool_member( + def delete_load_balancer_listener( self, load_balancer_id: str, - pool_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer pool member. + Delete a load balancer listener. - This request deletes a member from the pool. This operation cannot be reversed. + This request deletes a load balancer listener. This operation cannot be reversed. + For this operation to succeed, the listener must not be the target of another load + balancer listener. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param str id: The member identifier. + :param str id: The listener identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -23615,15 +24078,13 @@ def delete_load_balancer_pool_member( if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_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_load_balancer_pool_member', + operation_id='delete_load_balancer_listener', ) headers.update(sdk_headers) @@ -23636,10 +24097,10 @@ def delete_load_balancer_pool_member( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['load_balancer_id', 'pool_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -23650,38 +24111,34 @@ def delete_load_balancer_pool_member( response = self.send(request, **kwargs) return response - def get_load_balancer_pool_member( + def get_load_balancer_listener( self, load_balancer_id: str, - pool_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer pool member. + Retrieve a load balancer listener. - This request retrieves a single member specified by the identifier in the URL + This request retrieves a single listener specified by the identifier in the URL path. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param str id: The member identifier. + :param str id: The listener 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 `LoadBalancerPoolMember` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_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_load_balancer_pool_member', + operation_id='get_load_balancer_listener', ) headers.update(sdk_headers) @@ -23695,10 +24152,10 @@ def get_load_balancer_pool_member( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -23709,44 +24166,40 @@ def get_load_balancer_pool_member( response = self.send(request, **kwargs) return response - def update_load_balancer_pool_member( + def update_load_balancer_listener( self, load_balancer_id: str, - pool_id: str, id: str, - load_balancer_pool_member_patch: 'LoadBalancerPoolMemberPatch', + load_balancer_listener_patch: 'LoadBalancerListenerPatch', **kwargs, ) -> DetailedResponse: """ - Update a load balancer pool member. + Update a load balancer listener. - This request updates an existing member from a member patch. + This request updates a load balancer listener from a listener patch. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param str id: The member identifier. - :param LoadBalancerPoolMemberPatch load_balancer_pool_member_patch: The - load balancer pool member patch. + :param str id: The listener identifier. + :param LoadBalancerListenerPatch load_balancer_listener_patch: The load + balancer listener patch. :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 `LoadBalancerPoolMember` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') if not id: raise ValueError('id must be provided') - if load_balancer_pool_member_patch is None: - raise ValueError('load_balancer_pool_member_patch must be provided') - if isinstance(load_balancer_pool_member_patch, LoadBalancerPoolMemberPatch): - load_balancer_pool_member_patch = convert_model(load_balancer_pool_member_patch) + if load_balancer_listener_patch is None: + raise ValueError('load_balancer_listener_patch must be provided') + if isinstance(load_balancer_listener_patch, LoadBalancerListenerPatch): + load_balancer_listener_patch = convert_model(load_balancer_listener_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_pool_member', + operation_id='update_load_balancer_listener', ) headers.update(sdk_headers) @@ -23755,7 +24208,7 @@ def update_load_balancer_pool_member( 'generation': self.generation, } - data = json.dumps(load_balancer_pool_member_patch) + data = json.dumps(load_balancer_listener_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -23763,10 +24216,10 @@ def update_load_balancer_pool_member( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -23778,75 +24231,41 @@ def update_load_balancer_pool_member( response = self.send(request, **kwargs) return response - ######################### - # Endpoint gateways - ######################### - - def list_endpoint_gateways( + def list_load_balancer_listener_policies( self, - *, - name: Optional[str] = None, - start: Optional[str] = None, - limit: Optional[int] = None, - resource_group_id: Optional[str] = None, - lifecycle_state: Optional[List[str]] = None, - vpc_id: Optional[str] = None, - vpc_crn: Optional[str] = None, - vpc_name: Optional[str] = None, - allow_dns_resolution_binding: Optional[bool] = None, + load_balancer_id: str, + listener_id: str, **kwargs, ) -> DetailedResponse: """ - List endpoint gateways. + List policies for a load balancer listener. - This request lists endpoint gateways in the region. An endpoint gateway maps one - or more reserved IPs in a VPC to a target outside the VPC. + This request lists policies for a load balancer listener. A policy consists of + rules to match against each incoming request, and an action to apply to the + request if a rule matches. - :param str name: (optional) Filters the collection to resources with a - `name` property matching the exact specified name. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param List[str] lifecycle_state: (optional) Filters the collection to - resources with a `lifecycle_state` property matching one of the specified - comma-separated values. - :param str vpc_id: (optional) Filters the collection to resources with a - `vpc.id` property matching the specified identifier. - :param str vpc_crn: (optional) Filters the collection to resources with a - `vpc.crn` property matching the specified CRN. - :param str vpc_name: (optional) Filters the collection to resources with a - `vpc.name` property matching the exact specified name. - :param bool allow_dns_resolution_binding: (optional) Filters the collection - to endpoint gateways with an `allow_dns_resolution_binding` property - matching the specified value. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener 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 `EndpointGatewayCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyCollection` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_endpoint_gateways', + operation_id='list_load_balancer_listener_policies', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'name': name, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, - 'lifecycle_state': convert_list(lifecycle_state), - 'vpc.id': vpc_id, - 'vpc.crn': vpc_crn, - 'vpc.name': vpc_name, - 'allow_dns_resolution_binding': allow_dns_resolution_binding, } if 'headers' in kwargs: @@ -23854,7 +24273,10 @@ def list_endpoint_gateways( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/endpoint_gateways' + path_param_keys = ['load_balancer_id', 'listener_id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -23865,72 +24287,78 @@ def list_endpoint_gateways( response = self.send(request, **kwargs) return response - def create_endpoint_gateway( + def create_load_balancer_listener_policy( self, - target: 'EndpointGatewayTargetPrototype', - vpc: 'VPCIdentity', + load_balancer_id: str, + listener_id: str, + action: str, + priority: int, *, - allow_dns_resolution_binding: Optional[bool] = None, - ips: Optional[List['EndpointGatewayReservedIP']] = None, name: Optional[str] = None, - resource_group: Optional['ResourceGroupIdentity'] = None, - security_groups: Optional[List['SecurityGroupIdentity']] = None, + rules: Optional[List['LoadBalancerListenerPolicyRulePrototype']] = None, + target: Optional['LoadBalancerListenerPolicyTargetPrototype'] = None, **kwargs, ) -> DetailedResponse: """ - Create an endpoint gateway. - - This request creates a new endpoint gateway. An endpoint gateway maps one or more - reserved IPs in a VPC to a target outside the VPC. + Create a policy for a load balancer listener. - :param EndpointGatewayTargetPrototype target: The target to use for this - endpoint gateway. The target: - - Must not already be the target of another endpoint gateway in the VPC - - Must not have a service endpoint that duplicates or overlaps with any - `service_endpoints` - of another endpoint gateway in the VPC. - :param VPCIdentity vpc: The VPC this endpoint gateway will reside in. - :param bool allow_dns_resolution_binding: (optional) Indicates whether to - allow DNS resolution for this endpoint gateway when the VPC this endpoint - gateway resides in has a DNS resolution binding to a VPC with - `dns.enable_hub` set to `true`. - Must be `true` if the VPC this endpoint gateway resides in has - `dns.enable_hub` set to - `true`. - :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to - bind to this endpoint gateway. At most one reserved IP per zone is allowed. - :param str name: (optional) The name for this endpoint gateway. The name - must not be used by another endpoint gateway in the VPC. If unspecified, - the name will be a hyphenated list of randomly-selected words. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this endpoint gateway. If unspecified, the VPC's default - security group is used. - :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 `EndpointGateway` object - """ + This request creates a new policy from a load balancer listener policy object. The + prototype object is structured in the same way as a retrieved policy, and contains + the information necessary to create the new policy. For this request to succeed, + the listener must have a `protocol` of `http` or `https`. - if target is None: - raise ValueError('target must be provided') - if vpc is None: - raise ValueError('vpc must be provided') - target = convert_model(target) - vpc = convert_model(vpc) - if ips is not None: - ips = [convert_model(x) for x in ips] - if resource_group is not None: - resource_group = convert_model(resource_group) - if security_groups is not None: - security_groups = [convert_model(x) for x in security_groups] + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str action: The policy action: + - `forward`: Requests will be forwarded to the specified `target` pool + - `https_redirect`: Requests will be redirected to the specified + `target.listener`. + This listener must have a `protocol` of `http`, and the target listener + must + have a `protocol` of `https`. + - `redirect`: Requests will be redirected to the specified `target.url` + - `reject`: Requests will be rejected with a `403` status code. + :param int priority: Priority of the policy. The priority is unique across + all policies for this load balancer listener. Lower value indicates higher + priority. + :param str name: (optional) The name for this policy. The name must not be + used by another policy for the load balancer listener. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The + rule prototype objects for this policy. + :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If + `action` is `forward`, use `LoadBalancerPoolIdentity` to specify a pool in + this + load balancer to forward to. + - If `action` is `https_redirect`, use + `LoadBalancerListenerPolicyHTTPSRedirectPrototype` to specify a listener + on this + load balancer to redirect to. + - If `action` is `redirect`, use + `LoadBalancerListenerPolicyRedirectURLPrototype`to + specify a URL to redirect to. + :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 `LoadBalancerListenerPolicy` object + """ + + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if action is None: + raise ValueError('action must be provided') + if priority is None: + raise ValueError('priority must be provided') + if rules is not None: + rules = [convert_model(x) for x in rules] + if target is not None: + target = convert_model(target) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_endpoint_gateway', + operation_id='create_load_balancer_listener_policy', ) headers.update(sdk_headers) @@ -23940,13 +24368,11 @@ def create_endpoint_gateway( } data = { - 'target': target, - 'vpc': vpc, - 'allow_dns_resolution_binding': allow_dns_resolution_binding, - 'ips': ips, + 'action': action, + 'priority': priority, 'name': name, - 'resource_group': resource_group, - 'security_groups': security_groups, + 'rules': rules, + 'target': target, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -23957,7 +24383,10 @@ def create_endpoint_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/endpoint_gateways' + path_param_keys = ['load_balancer_id', 'listener_id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -23969,63 +24398,55 @@ def create_endpoint_gateway( response = self.send(request, **kwargs) return response - def list_endpoint_gateway_ips( + def delete_load_balancer_listener_policy( self, - endpoint_gateway_id: str, - *, - start: Optional[str] = None, - limit: Optional[int] = None, - sort: Optional[str] = None, + load_balancer_id: str, + listener_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List reserved IPs bound to an endpoint gateway. + Delete a load balancer listener policy. - This request lists reserved IPs bound to an endpoint gateway. + Deletes a policy of the load balancer listener. This operation cannot be reversed. - :param str endpoint_gateway_id: The endpoint gateway identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str id: The policy 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 `ReservedIPCollectionEndpointGatewayContext` object + :rtype: DetailedResponse """ - if not endpoint_gateway_id: - raise ValueError('endpoint_gateway_id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_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_endpoint_gateway_ips', + operation_id='delete_load_balancer_listener_policy', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'sort': sort, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['endpoint_gateway_id'] - path_param_values = self.encode_path_vars(endpoint_gateway_id) + path_param_keys = ['load_balancer_id', 'listener_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{endpoint_gateway_id}/ips'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -24034,35 +24455,37 @@ def list_endpoint_gateway_ips( response = self.send(request, **kwargs) return response - def remove_endpoint_gateway_ip( + def get_load_balancer_listener_policy( self, - endpoint_gateway_id: str, + load_balancer_id: str, + listener_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Unbind a reserved IP from an endpoint gateway. + Retrieve a load balancer listener policy. - This request unbinds the specified reserved IP from the specified endpoint - gateway. If the reserved IP has `auto_delete` set to `true`, the reserved IP will - be deleted. + Retrieve a single policy specified by the identifier in the URL path. - :param str endpoint_gateway_id: The endpoint gateway identifier. - :param str id: The reserved IP identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str id: The policy 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 `LoadBalancerListenerPolicy` object """ - if not endpoint_gateway_id: - raise ValueError('endpoint_gateway_id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_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='remove_endpoint_gateway_ip', + operation_id='get_load_balancer_listener_policy', ) headers.update(sdk_headers) @@ -24074,13 +24497,14 @@ def remove_endpoint_gateway_ip( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['endpoint_gateway_id', 'id'] - path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_keys = ['load_balancer_id', 'listener_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -24089,34 +24513,46 @@ def remove_endpoint_gateway_ip( response = self.send(request, **kwargs) return response - def get_endpoint_gateway_ip( + def update_load_balancer_listener_policy( self, - endpoint_gateway_id: str, + load_balancer_id: str, + listener_id: str, id: str, + load_balancer_listener_policy_patch: 'LoadBalancerListenerPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Retrieve a reserved IP bound to an endpoint gateway. + Update a load balancer listener policy. - This request retrieves the specified reserved IP address if it is bound to the - endpoint gateway specified in the URL. + This request updates a load balancer listener policy with the information in a + provided policy patch. The policy patch object is structured in the same way as a + retrieved policy and contains only the information to be updated. - :param str endpoint_gateway_id: The endpoint gateway identifier. - :param str id: The reserved IP identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str id: The policy identifier. + :param LoadBalancerListenerPolicyPatch load_balancer_listener_policy_patch: + The listener policy patch. :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 `ReservedIP` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object """ - if not endpoint_gateway_id: - raise ValueError('endpoint_gateway_id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') if not id: raise ValueError('id must be provided') + if load_balancer_listener_policy_patch is None: + raise ValueError('load_balancer_listener_policy_patch must be provided') + if isinstance(load_balancer_listener_policy_patch, LoadBalancerListenerPolicyPatch): + load_balancer_listener_policy_patch = convert_model(load_balancer_listener_policy_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_endpoint_gateway_ip', + operation_id='update_load_balancer_listener_policy', ) headers.update(sdk_headers) @@ -24125,15 +24561,77 @@ def get_endpoint_gateway_ip( 'generation': self.generation, } + data = json.dumps(load_balancer_listener_policy_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['endpoint_gateway_id', 'id'] - path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_keys = ['load_balancer_id', 'listener_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def list_load_balancer_listener_policy_rules( + self, + load_balancer_id: str, + listener_id: str, + policy_id: str, + **kwargs, + ) -> DetailedResponse: + """ + List rules of a load balancer listener policy. + + This request lists rules of a load balancer listener policy. + + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy 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 `LoadBalancerListenerPolicyRuleCollection` object + """ + + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_load_balancer_listener_policy_rules', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -24144,37 +24642,61 @@ def get_endpoint_gateway_ip( response = self.send(request, **kwargs) return response - def add_endpoint_gateway_ip( + def create_load_balancer_listener_policy_rule( self, - endpoint_gateway_id: str, - id: str, + load_balancer_id: str, + listener_id: str, + policy_id: str, + condition: str, + type: str, + value: str, + *, + field: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Bind a reserved IP to an endpoint gateway. + Create a rule for a load balancer listener policy. - This request binds the specified reserved IP to the specified endpoint gateway. - The reserved IP: - - must currently be unbound, or not required by its target - - must not be in the same zone as any other reserved IP bound to the endpoint - gateway. + Creates a new rule for the load balancer listener policy. - :param str endpoint_gateway_id: The endpoint gateway identifier. - :param str id: The reserved IP identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. + :param str condition: The condition for the rule. + :param str type: The type of the rule. Body rules are applied to + form-encoded request bodies using the + `UTF-8` character set. + :param str value: The value to be matched for the rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. + :param str field: (optional) The field to match for this rule. This + property must be specified if the rule type is + `header`, may be specified if the rule type is `body` or `query`, and must + not be specified if the rule type is `hostname` or `path`. + If the rule condition is not `matches_regex`, the value must be + percent-encoded. :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 `ReservedIP` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ - if not endpoint_gateway_id: - raise ValueError('endpoint_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_id must be provided') + if condition is None: + raise ValueError('condition must be provided') + if type is None: + raise ValueError('type must be provided') + if value is None: + raise ValueError('value must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='add_endpoint_gateway_ip', + operation_id='create_load_balancer_listener_policy_rule', ) headers.update(sdk_headers) @@ -24183,50 +24705,72 @@ def add_endpoint_gateway_ip( 'generation': self.generation, } + data = { + 'condition': condition, + 'type': type, + 'value': value, + 'field': field, + } + 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 = ['endpoint_gateway_id', 'id'] - path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def delete_endpoint_gateway( + def delete_load_balancer_listener_policy_rule( self, + load_balancer_id: str, + listener_id: str, + policy_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete an endpoint gateway. + Delete a load balancer listener policy rule. - This request deletes an endpoint gateway. This operation cannot be reversed. - Reserved IPs that were bound to the endpoint gateway will be released if their - `auto_delete` property is set to true. + Deletes a rule from the load balancer listener policy. This operation cannot be + reversed. - :param str id: The endpoint gateway identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. + :param str id: The rule 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 load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_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_endpoint_gateway', + operation_id='delete_load_balancer_listener_policy_rule', ) headers.update(sdk_headers) @@ -24239,10 +24783,10 @@ def delete_endpoint_gateway( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -24253,30 +24797,41 @@ def delete_endpoint_gateway( response = self.send(request, **kwargs) return response - def get_endpoint_gateway( + def get_load_balancer_listener_policy_rule( self, + load_balancer_id: str, + listener_id: str, + policy_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve an endpoint gateway. + Retrieve a load balancer listener policy rule. - This request retrieves a single endpoint gateway specified by the identifier in - the URL. + Retrieves a single rule specified by the identifier in the URL path. - :param str id: The endpoint gateway identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. + :param str id: The rule 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 `EndpointGateway` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_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_endpoint_gateway', + operation_id='get_load_balancer_listener_policy_rule', ) headers.update(sdk_headers) @@ -24290,10 +24845,10 @@ def get_endpoint_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -24304,36 +24859,48 @@ def get_endpoint_gateway( response = self.send(request, **kwargs) return response - def update_endpoint_gateway( + def update_load_balancer_listener_policy_rule( self, + load_balancer_id: str, + listener_id: str, + policy_id: str, id: str, - endpoint_gateway_patch: 'EndpointGatewayPatch', + load_balancer_listener_policy_rule_patch: 'LoadBalancerListenerPolicyRulePatch', **kwargs, ) -> DetailedResponse: """ - Update an endpoint gateway. + Update a load balancer listener policy rule. - This request updates an endpoint gateway's name. + Updates a rule of the load balancer listener policy. - :param str id: The endpoint gateway identifier. - :param EndpointGatewayPatch endpoint_gateway_patch: The endpoint gateway - patch. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. + :param str id: The rule identifier. + :param LoadBalancerListenerPolicyRulePatch + load_balancer_listener_policy_rule_patch: The listener policy rule patch. :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 `EndpointGateway` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_id must be provided') if not id: raise ValueError('id must be provided') - if endpoint_gateway_patch is None: - raise ValueError('endpoint_gateway_patch must be provided') - if isinstance(endpoint_gateway_patch, EndpointGatewayPatch): - endpoint_gateway_patch = convert_model(endpoint_gateway_patch) + if load_balancer_listener_policy_rule_patch is None: + raise ValueError('load_balancer_listener_policy_rule_patch must be provided') + if isinstance(load_balancer_listener_policy_rule_patch, LoadBalancerListenerPolicyRulePatch): + load_balancer_listener_policy_rule_patch = convert_model(load_balancer_listener_policy_rule_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_endpoint_gateway', + operation_id='update_load_balancer_listener_policy_rule', ) headers.update(sdk_headers) @@ -24342,7 +24909,7 @@ def update_endpoint_gateway( 'generation': self.generation, } - data = json.dumps(endpoint_gateway_patch) + data = json.dumps(load_balancer_listener_policy_rule_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -24350,10 +24917,10 @@ def update_endpoint_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -24365,78 +24932,35 @@ def update_endpoint_gateway( response = self.send(request, **kwargs) return response - ######################### - # Flow log collectors - ######################### - - def list_flow_log_collectors( + def list_load_balancer_pools( self, - *, - start: Optional[str] = None, - limit: Optional[int] = None, - resource_group_id: Optional[str] = None, - name: Optional[str] = None, - vpc_id: Optional[str] = None, - vpc_crn: Optional[str] = None, - vpc_name: Optional[str] = None, - target_id: Optional[str] = None, - target_resource_type: Optional[str] = None, + load_balancer_id: str, **kwargs, ) -> DetailedResponse: """ - List flow log collectors. + List pools of a load balancer. - This request lists flow log collectors in the region. A [flow log - collector](https://cloud.ibm.com/docs/vpc?topic=vpc-flow-logs) summarizes data - sent over the instance network interfaces and instance network attachments - contained within its target. The collected flow logs are written to a cloud object - storage bucket, where they can be - [viewed](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). + This request lists pools of a load balancer. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param str name: (optional) Filters the collection to resources with a - `name` property matching the exact specified name. - :param str vpc_id: (optional) Filters the collection to resources with a - `vpc.id` property matching the specified identifier. - :param str vpc_crn: (optional) Filters the collection to resources with a - `vpc.crn` property matching the specified CRN. - :param str vpc_name: (optional) Filters the collection to resources with a - `vpc.name` property matching the exact specified name. - :param str target_id: (optional) Filters the collection to resources with a - `target.id` property matching the specified identifier. - :param str target_resource_type: (optional) Filters the collection to - resources with a `target.resource_type` property matching the specified - value. + :param str load_balancer_id: The load balancer 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 `FlowLogCollectorCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolCollection` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_flow_log_collectors', + operation_id='list_load_balancer_pools', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, - 'name': name, - 'vpc.id': vpc_id, - 'vpc.crn': vpc_crn, - 'vpc.name': vpc_name, - 'target.id': target_id, - 'target.resource_type': target_resource_type, } if 'headers' in kwargs: @@ -24444,7 +24968,10 @@ def list_flow_log_collectors( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/flow_log_collectors' + path_param_keys = ['load_balancer_id'] + path_param_values = self.encode_path_vars(load_balancer_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -24455,68 +24982,78 @@ def list_flow_log_collectors( response = self.send(request, **kwargs) return response - def create_flow_log_collector( + def create_load_balancer_pool( self, - storage_bucket: 'LegacyCloudObjectStorageBucketIdentity', - target: 'FlowLogCollectorTargetPrototype', + load_balancer_id: str, + algorithm: str, + health_monitor: 'LoadBalancerPoolHealthMonitorPrototype', + protocol: str, *, - active: Optional[bool] = None, + members: Optional[List['LoadBalancerPoolMemberPrototype']] = None, name: Optional[str] = None, - resource_group: Optional['ResourceGroupIdentity'] = None, + proxy_protocol: Optional[str] = None, + session_persistence: Optional['LoadBalancerPoolSessionPersistencePrototype'] = None, **kwargs, ) -> DetailedResponse: """ - Create a flow log collector. + Create a load balancer pool. - This request creates and starts a new flow log collector from a flow log collector - prototype object. The prototype object is structured in the same way as a - retrieved flow log collector, and contains the information necessary to create and - start the new flow log collector. + This request creates a new pool from a pool prototype object. - :param LegacyCloudObjectStorageBucketIdentity storage_bucket: The Cloud - Object Storage bucket where the collected flows will be logged. - The bucket must exist and an IAM service authorization must grant - `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer - access to the bucket. For more information, see [Creating a flow log - collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector). - :param FlowLogCollectorTargetPrototype target: The target this collector - will collect flow logs for. - If the target is an instance, subnet, or VPC, flow logs will not be - collected for any - instance network attachments, virtual network interfaces or instance - network interfaces - within the target that are themselves the target of a more specific flow - log collector. - The target must not be a virtual network interface that is attached to a - bare metal server - network attachment or to a file share mount target. - :param bool active: (optional) Indicates whether this collector will be - active upon creation. - :param str name: (optional) The name for this flow log collector. The name - must not be used by another flow log collector in the VPC. If unspecified, - the name will be a hyphenated list of randomly-selected words. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. + :param str load_balancer_id: The load balancer identifier. + :param str algorithm: The load balancing algorithm. The `least_connections` + algorithm is only supported for load balancers that have `availability` + with value `subnet` in the profile. + :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health + monitor of this pool. + :param str protocol: The protocol used for this load balancer pool. Load + balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the + `application` family support `tcp`, `http`, and `https`. + :param List[LoadBalancerPoolMemberPrototype] members: (optional) The + members for this load balancer pool. For load balancers in the `network` + family, the same `port` and `target` tuple cannot be shared by a pool + member of any other load balancer in the same VPC. + :param str name: (optional) The name for this load balancer pool. The name + must not be used by another pool for the load balancer. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param str proxy_protocol: (optional) The PROXY protocol setting for this + pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + For load balancers in the `network` family, this property must be + `disabled`. + :param LoadBalancerPoolSessionPersistencePrototype session_persistence: + (optional) The session persistence of this pool. If specified, the load + balancer must have + `source_ip_session_persistence_supported` set to `true` in its profile. If + unspecified, session persistence will be disabled, and traffic will be + distributed + across backend server members of the pool. :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 `FlowLogCollector` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ - if storage_bucket is None: - raise ValueError('storage_bucket must be provided') - if target is None: - raise ValueError('target must be provided') - storage_bucket = convert_model(storage_bucket) - target = convert_model(target) - if resource_group is not None: - resource_group = convert_model(resource_group) + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if algorithm is None: + raise ValueError('algorithm must be provided') + if health_monitor is None: + raise ValueError('health_monitor must be provided') + if protocol is None: + raise ValueError('protocol must be provided') + health_monitor = convert_model(health_monitor) + if members is not None: + members = [convert_model(x) for x in members] + if session_persistence is not None: + session_persistence = convert_model(session_persistence) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_flow_log_collector', + operation_id='create_load_balancer_pool', ) headers.update(sdk_headers) @@ -24526,11 +25063,13 @@ def create_flow_log_collector( } data = { - 'storage_bucket': storage_bucket, - 'target': target, - 'active': active, + 'algorithm': algorithm, + 'health_monitor': health_monitor, + 'protocol': protocol, + 'members': members, 'name': name, - 'resource_group': resource_group, + 'proxy_protocol': proxy_protocol, + 'session_persistence': session_persistence, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -24541,7 +25080,10 @@ def create_flow_log_collector( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/flow_log_collectors' + path_param_keys = ['load_balancer_id'] + path_param_values = self.encode_path_vars(load_balancer_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -24553,32 +25095,34 @@ def create_flow_log_collector( response = self.send(request, **kwargs) return response - def delete_flow_log_collector( + def delete_load_balancer_pool( self, + load_balancer_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a flow log collector. + Delete a load balancer pool. - This request stops and deletes a flow log collector. This operation cannot be - reversed. - Collected flow logs remain available within the flow log collector's Cloud Object - Storage bucket. + This request deletes a load balancer pool. This operation cannot be reversed. The + pool must not currently be the default pool for any listener in the load balancer. - :param str id: The flow log collector identifier. + :param str load_balancer_id: The load balancer identifier. + :param str id: The pool 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 load_balancer_id: + raise ValueError('load_balancer_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_flow_log_collector', + operation_id='delete_load_balancer_pool', ) headers.update(sdk_headers) @@ -24591,10 +25135,10 @@ def delete_flow_log_collector( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/flow_log_collectors/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -24605,30 +25149,33 @@ def delete_flow_log_collector( response = self.send(request, **kwargs) return response - def get_flow_log_collector( + def get_load_balancer_pool( self, + load_balancer_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a flow log collector. + Retrieve a load balancer pool. - This request retrieves a single flow log collector specified by the identifier in - the URL. + This request retrieves a single pool specified by the identifier in the URL path. - :param str id: The flow log collector identifier. + :param str load_balancer_id: The load balancer identifier. + :param str id: The pool 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 `FlowLogCollector` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ + if not load_balancer_id: + raise ValueError('load_balancer_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_flow_log_collector', + operation_id='get_load_balancer_pool', ) headers.update(sdk_headers) @@ -24642,10 +25189,10 @@ def get_flow_log_collector( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/flow_log_collectors/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -24656,39 +25203,40 @@ def get_flow_log_collector( response = self.send(request, **kwargs) return response - def update_flow_log_collector( + def update_load_balancer_pool( self, + load_balancer_id: str, id: str, - flow_log_collector_patch: 'FlowLogCollectorPatch', + load_balancer_pool_patch: 'LoadBalancerPoolPatch', **kwargs, ) -> DetailedResponse: """ - Update a flow log collector. + Update a load balancer pool. - This request updates a flow log collector with the information in a provided flow - log collector patch. The flow log collector patch object is structured in the same - way as a retrieved flow log collector and contains only the information to be - updated. + This request updates a load balancer pool from a pool patch. - :param str id: The flow log collector identifier. - :param FlowLogCollectorPatch flow_log_collector_patch: The flow log - collector patch. + :param str load_balancer_id: The load balancer identifier. + :param str id: The pool identifier. + :param LoadBalancerPoolPatch load_balancer_pool_patch: The load balancer + pool patch. :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 `FlowLogCollector` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - if flow_log_collector_patch is None: - raise ValueError('flow_log_collector_patch must be provided') - if isinstance(flow_log_collector_patch, FlowLogCollectorPatch): - flow_log_collector_patch = convert_model(flow_log_collector_patch) + if load_balancer_pool_patch is None: + raise ValueError('load_balancer_pool_patch must be provided') + if isinstance(load_balancer_pool_patch, LoadBalancerPoolPatch): + load_balancer_pool_patch = convert_model(load_balancer_pool_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_flow_log_collector', + operation_id='update_load_balancer_pool', ) headers.update(sdk_headers) @@ -24697,7 +25245,7 @@ def update_flow_log_collector( 'generation': self.generation, } - data = json.dumps(flow_log_collector_patch) + data = json.dumps(load_balancer_pool_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -24705,10 +25253,10 @@ def update_flow_log_collector( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/flow_log_collectors/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -24720,57 +25268,39 @@ def update_flow_log_collector( response = self.send(request, **kwargs) return response - ######################### - # Private path service gateways - ######################### - - def list_private_path_service_gateways( + def list_load_balancer_pool_members( self, - *, - start: Optional[str] = None, - limit: Optional[int] = None, - resource_group_id: Optional[str] = None, + load_balancer_id: str, + pool_id: str, **kwargs, ) -> DetailedResponse: """ - List private path service gateways. + List members of a load balancer pool. - This request lists private path service gateways in the region. Private path - service gateways allow - [service - providers](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components) - to make their services available using - [private path - connectivity](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components). - Private path service gateways are used to facilitate and manage the private path - connectivity between private path network load balancers and their associated - endpoint gateways. + This request lists members of a load balancer pool. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool 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 `PrivatePathServiceGatewayCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMemberCollection` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_private_path_service_gateways', + operation_id='list_load_balancer_pool_members', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, } if 'headers' in kwargs: @@ -24778,7 +25308,10 @@ def list_private_path_service_gateways( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/private_path_service_gateways' + path_param_keys = ['load_balancer_id', 'pool_id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -24789,69 +25322,60 @@ def list_private_path_service_gateways( response = self.send(request, **kwargs) return response - def create_private_path_service_gateway( + def create_load_balancer_pool_member( self, - load_balancer: 'LoadBalancerIdentity', - service_endpoints: List[str], + load_balancer_id: str, + pool_id: str, + port: int, + target: 'LoadBalancerPoolMemberTargetPrototype', *, - default_access_policy: Optional[str] = None, - name: Optional[str] = None, - resource_group: Optional['ResourceGroupIdentity'] = None, - zonal_affinity: Optional[bool] = None, + weight: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - Create a private path service gateway. + Create a member in a load balancer pool. - This request creates a private path service gateway from a private path service - gateway prototype object. The prototype object is structured in the same way as a - retrieved private path service gateway, and contains the information necessary to - create the new private path service gateway. + This request creates a new member and adds the member to the pool. - :param LoadBalancerIdentity load_balancer: The load balancer for this - private path service gateway. The load balancer must - have `is_private_path` set to `true`. - The private path service gateway will reside in the same VPC as the - specified load - balancer. - :param List[str] service_endpoints: The fully qualified domain names for - this private path service gateway. Any uppercase letters will be converted - to lowercase. - :param str default_access_policy: (optional) The policy to use for bindings - from accounts without an explicit account policy. - :param str name: (optional) The name for this private path service gateway. - The name must not be used by another private path service gateway in the - VPC. If unspecified, the name will be a hyphenated list of - randomly-selected words. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. - :param bool zonal_affinity: (optional) Indicates whether this private path - service gateway has zonal affinity. - - `true`: Traffic to the service from a zone the service resides in will - remain in - that zone. - - `false`: Traffic to the service from a zone will be load balanced across - all zones - in the region the service resides in. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param int port: The port the member will receive load balancer traffic on. + Applies only to load balancer traffic received on a listener with a single + port. (If the traffic is received on a listener with a port range, the + member will receive the traffic on the same port the listener received it + on.) + This port will also be used for health checks unless the `port` property of + `health_monitor` property is specified. + The port must be unique across all members for all pools associated with + this pool's listener. + :param LoadBalancerPoolMemberTargetPrototype target: The pool member + target. Load balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. + If the load + balancer has route mode enabled, the member must be in a zone the load + balancer has a + subnet in. + :param int weight: (optional) The weight of the server member. + If specified, the pool algorithm must be `weighted_round_robin`. :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 `PrivatePathServiceGateway` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ - if load_balancer is None: - raise ValueError('load_balancer must be provided') - if service_endpoints is None: - raise ValueError('service_endpoints must be provided') - load_balancer = convert_model(load_balancer) - if resource_group is not None: - resource_group = convert_model(resource_group) + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + if port is None: + raise ValueError('port must be provided') + if target is None: + raise ValueError('target must be provided') + target = convert_model(target) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_private_path_service_gateway', + operation_id='create_load_balancer_pool_member', ) headers.update(sdk_headers) @@ -24861,12 +25385,9 @@ def create_private_path_service_gateway( } data = { - 'load_balancer': load_balancer, - 'service_endpoints': service_endpoints, - 'default_access_policy': default_access_policy, - 'name': name, - 'resource_group': resource_group, - 'zonal_affinity': zonal_affinity, + 'port': port, + 'target': target, + 'weight': weight, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -24877,7 +25398,10 @@ def create_private_path_service_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/private_path_service_gateways' + path_param_keys = ['load_balancer_id', 'pool_id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -24889,31 +25413,40 @@ def create_private_path_service_gateway( response = self.send(request, **kwargs) return response - def delete_private_path_service_gateway( + def replace_load_balancer_pool_members( self, - id: str, + load_balancer_id: str, + pool_id: str, + members: List['LoadBalancerPoolMemberPrototype'], **kwargs, ) -> DetailedResponse: """ - Delete a private path service gateway. + Replace load balancer pool members. - This request deletes a private path service gateway. For this request to succeed, - the value of `endpoint_gateway_count` must be `0`. This operation cannot be - reversed. + This request replaces the existing members of the load balancer pool with new + members created from the collection of member prototype objects. - :param str id: The private path service gateway identifier. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param List[LoadBalancerPoolMemberPrototype] members: The member prototype + objects for this pool. :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 `LoadBalancerPoolMemberCollection` object """ - if not id: - raise ValueError('id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + if members is None: + raise ValueError('members must be provided') + members = [convert_model(x) for x in members] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_private_path_service_gateway', + operation_id='replace_load_balancer_pool_members', ) headers.update(sdk_headers) @@ -24922,48 +25455,64 @@ def delete_private_path_service_gateway( 'generation': self.generation, } + data = { + 'members': members, + } + 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 = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'pool_id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='PUT', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def get_private_path_service_gateway( + def delete_load_balancer_pool_member( self, + load_balancer_id: str, + pool_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a private path service gateway. + Delete a load balancer pool member. - This request retrieves the private path service gateway specified by the - identifier in the URL. + This request deletes a member from the pool. This operation cannot be reversed. - :param str id: The private path service gateway identifier. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param str id: The member 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 `PrivatePathServiceGateway` object + :rtype: DetailedResponse """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_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_private_path_service_gateway', + operation_id='delete_load_balancer_pool_member', ) headers.update(sdk_headers) @@ -24975,14 +25524,13 @@ def get_private_path_service_gateway( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'pool_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -24991,39 +25539,38 @@ def get_private_path_service_gateway( response = self.send(request, **kwargs) return response - def update_private_path_service_gateway( + def get_load_balancer_pool_member( self, + load_balancer_id: str, + pool_id: str, id: str, - private_path_service_gateway_patch: 'PrivatePathServiceGatewayPatch', **kwargs, ) -> DetailedResponse: """ - Update a private path service gateway. + Retrieve a load balancer pool member. - This request updates a private path service gateway with the information provided - in a private path service gateway patch object. The private path service gateway - patch object is structured in the same way as a retrieved private path service - gateway and contains only the information to be updated. + This request retrieves a single member specified by the identifier in the URL + path. - :param str id: The private path service gateway identifier. - :param PrivatePathServiceGatewayPatch private_path_service_gateway_patch: - The private path service gateway patch. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param str id: The member 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 `PrivatePathServiceGateway` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') if not id: raise ValueError('id must be provided') - if private_path_service_gateway_patch is None: - raise ValueError('private_path_service_gateway_patch must be provided') - if isinstance(private_path_service_gateway_patch, PrivatePathServiceGatewayPatch): - private_path_service_gateway_patch = convert_model(private_path_service_gateway_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_private_path_service_gateway', + operation_id='get_load_balancer_pool_member', ) headers.update(sdk_headers) @@ -25032,87 +25579,171 @@ def update_private_path_service_gateway( 'generation': self.generation, } - data = json.dumps(private_path_service_gateway_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'pool_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_private_path_service_gateway_account_policies( + def update_load_balancer_pool_member( self, - private_path_service_gateway_id: str, - *, - start: Optional[str] = None, - limit: Optional[int] = None, - account_id: Optional[str] = None, + load_balancer_id: str, + pool_id: str, + id: str, + load_balancer_pool_member_patch: 'LoadBalancerPoolMemberPatch', **kwargs, ) -> DetailedResponse: """ - List account policies for a private path service gateway. + Update a load balancer pool member. - This request lists account policies for a private path service gateway. Each - policy defines how requests to use the private path service gateway from that - account will be handled. - The account policies will be sorted by their `created_at` property values, with - newest account policies first. Account policies with identical `created_at` - property values will in turn be sorted by ascending `id` property values. + This request updates an existing member from a member patch. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str account_id: (optional) Filters the collection to resources with - an `account.id` property matching the specified identifier. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param str id: The member identifier. + :param LoadBalancerPoolMemberPatch load_balancer_pool_member_patch: The + load balancer pool member patch. :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 `PrivatePathServiceGatewayAccountPolicyCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + if not id: + raise ValueError('id must be provided') + if load_balancer_pool_member_patch is None: + raise ValueError('load_balancer_pool_member_patch must be provided') + if isinstance(load_balancer_pool_member_patch, LoadBalancerPoolMemberPatch): + load_balancer_pool_member_patch = convert_model(load_balancer_pool_member_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_private_path_service_gateway_account_policies', + operation_id='update_load_balancer_pool_member', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'account.id': account_id, } + data = json.dumps(load_balancer_pool_member_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_keys = ['load_balancer_id', 'pool_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + ######################### + # Endpoint gateways + ######################### + + def list_endpoint_gateways( + self, + *, + name: Optional[str] = None, + start: Optional[str] = None, + limit: Optional[int] = None, + resource_group_id: Optional[str] = None, + lifecycle_state: Optional[List[str]] = None, + vpc_id: Optional[str] = None, + vpc_crn: Optional[str] = None, + vpc_name: Optional[str] = None, + allow_dns_resolution_binding: Optional[bool] = None, + **kwargs, + ) -> DetailedResponse: + """ + List endpoint gateways. + + This request lists endpoint gateways in the region. An endpoint gateway maps one + or more reserved IPs in a VPC to a target outside the VPC. + + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param List[str] lifecycle_state: (optional) Filters the collection to + resources with a `lifecycle_state` property matching one of the specified + comma-separated values. + :param str vpc_id: (optional) Filters the collection to resources with a + `vpc.id` property matching the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources with a + `vpc.crn` property matching the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources with a + `vpc.name` property matching the exact specified name. + :param bool allow_dns_resolution_binding: (optional) Filters the collection + to endpoint gateways with an `allow_dns_resolution_binding` property + matching the specified value. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `EndpointGatewayCollection` object + """ + + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_endpoint_gateways', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'name': name, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'lifecycle_state': convert_list(lifecycle_state), + 'vpc.id': vpc_id, + 'vpc.crn': vpc_crn, + 'vpc.name': vpc_name, + 'allow_dns_resolution_binding': allow_dns_resolution_binding, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/endpoint_gateways' request = self.prepare_request( method='GET', url=url, @@ -25123,56 +25754,72 @@ def list_private_path_service_gateway_account_policies( response = self.send(request, **kwargs) return response - def create_private_path_service_gateway_account_policy( + def create_endpoint_gateway( self, - private_path_service_gateway_id: str, - access_policy: str, - account: 'AccountIdentity', + target: 'EndpointGatewayTargetPrototype', + vpc: 'VPCIdentity', + *, + allow_dns_resolution_binding: Optional[bool] = None, + ips: Optional[List['EndpointGatewayReservedIP']] = None, + name: Optional[str] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, + security_groups: Optional[List['SecurityGroupIdentity']] = None, **kwargs, ) -> DetailedResponse: """ - Create an account policy for a private path service gateway. + Create an endpoint gateway. - This request creates an account policy from an account policy prototype object. - The prototype object is structured in the same way as a retrieved account policy, - and contains the information necessary to create the new account policy. + This request creates a new endpoint gateway. An endpoint gateway maps one or more + reserved IPs in a VPC to a target outside the VPC. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str access_policy: The access policy for the account. Updating the - access policy only affects pending and future endpoint gateway bindings. - - permit: access will be permitted - - deny: access will be denied - - review: access will be manually reviewed - - Updating to `review` sets the status of future endpoint gateway bindings - from - this account to `pending`. - - Updating to `permit` updates both the status of any `pending` and future - endpoint - gateway bindings from this account to `permitted`. - - Updating to `deny` updates both the status of any `pending` and future - endpoint - gateway bindings from this account to `denied`. - :param AccountIdentity account: The account for this access policy. The - account must be unique across all account - policies for this private path service gateway. + :param EndpointGatewayTargetPrototype target: The target to use for this + endpoint gateway. The target: + - Must not already be the target of another endpoint gateway in the VPC + - Must not have a service endpoint that duplicates or overlaps with any + `service_endpoints` + of another endpoint gateway in the VPC. + :param VPCIdentity vpc: The VPC this endpoint gateway will reside in. + :param bool allow_dns_resolution_binding: (optional) Indicates whether to + allow DNS resolution for this endpoint gateway when the VPC this endpoint + gateway resides in has a DNS resolution binding to a VPC with + `dns.enable_hub` set to `true`. + Must be `true` if the VPC this endpoint gateway resides in has + `dns.enable_hub` set to + `true`. + :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to + bind to this endpoint gateway. At most one reserved IP per zone is allowed. + :param str name: (optional) The name for this endpoint gateway. The name + must not be used by another endpoint gateway in the VPC. If unspecified, + the name will be a hyphenated list of randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this endpoint gateway. If unspecified, the VPC's default + security group is used. :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 `PrivatePathServiceGatewayAccountPolicy` object + :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') - if access_policy is None: - raise ValueError('access_policy must be provided') - if account is None: - raise ValueError('account must be provided') - account = convert_model(account) + if target is None: + raise ValueError('target must be provided') + if vpc is None: + raise ValueError('vpc must be provided') + target = convert_model(target) + vpc = convert_model(vpc) + if ips is not None: + ips = [convert_model(x) for x in ips] + if resource_group is not None: + resource_group = convert_model(resource_group) + if security_groups is not None: + security_groups = [convert_model(x) for x in security_groups] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_private_path_service_gateway_account_policy', + operation_id='create_endpoint_gateway', ) headers.update(sdk_headers) @@ -25182,8 +25829,13 @@ def create_private_path_service_gateway_account_policy( } data = { - 'access_policy': access_policy, - 'account': account, + 'target': target, + 'vpc': vpc, + 'allow_dns_resolution_binding': allow_dns_resolution_binding, + 'ips': ips, + 'name': name, + 'resource_group': resource_group, + 'security_groups': security_groups, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -25194,10 +25846,7 @@ def create_private_path_service_gateway_account_policy( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies'.format(**path_param_dict) + url = '/endpoint_gateways' request = self.prepare_request( method='POST', url=url, @@ -25209,53 +25858,63 @@ def create_private_path_service_gateway_account_policy( response = self.send(request, **kwargs) return response - def delete_private_path_service_gateway_account_policy( + def list_endpoint_gateway_ips( self, - private_path_service_gateway_id: str, - id: str, + endpoint_gateway_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Delete an account policy for a private path service gateway. + List reserved IPs bound to an endpoint gateway. - This request deletes an account policy. This operation cannot be reversed and it - does not affect the `status` of any existing endpoint gateway bindings. + This request lists reserved IPs bound to an endpoint gateway. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str id: The account policy identifier. + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :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 `ReservedIPCollectionEndpointGatewayContext` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') + if not endpoint_gateway_id: + raise ValueError('endpoint_gateway_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_private_path_service_gateway_account_policy', + operation_id='list_endpoint_gateway_ips', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'sort': sort, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id', 'id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_keys = ['endpoint_gateway_id'] + path_param_values = self.encode_path_vars(endpoint_gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}'.format(**path_param_dict) + url = '/endpoint_gateways/{endpoint_gateway_id}/ips'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -25264,35 +25923,35 @@ def delete_private_path_service_gateway_account_policy( response = self.send(request, **kwargs) return response - def get_private_path_service_gateway_account_policy( + def remove_endpoint_gateway_ip( self, - private_path_service_gateway_id: str, + endpoint_gateway_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve an account policy for a private path service gateway. + Unbind a reserved IP from an endpoint gateway. - This request retrieves a single account policy specified by the identifier in the - URL. + This request unbinds the specified reserved IP from the specified endpoint + gateway. If the reserved IP has `auto_delete` set to `true`, the reserved IP will + be deleted. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str id: The account policy identifier. + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param str id: The reserved IP 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 `PrivatePathServiceGatewayAccountPolicy` object + :rtype: DetailedResponse """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') + if not endpoint_gateway_id: + raise ValueError('endpoint_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_private_path_service_gateway_account_policy', + operation_id='remove_endpoint_gateway_ip', ) headers.update(sdk_headers) @@ -25304,14 +25963,13 @@ def get_private_path_service_gateway_account_policy( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id', 'id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_keys = ['endpoint_gateway_id', 'id'] + path_param_values = self.encode_path_vars(endpoint_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}'.format(**path_param_dict) + url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -25320,44 +25978,34 @@ def get_private_path_service_gateway_account_policy( response = self.send(request, **kwargs) return response - def update_private_path_service_gateway_account_policy( + def get_endpoint_gateway_ip( self, - private_path_service_gateway_id: str, + endpoint_gateway_id: str, id: str, - private_path_service_gateway_account_policy_patch: 'PrivatePathServiceGatewayAccountPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Update an account policy for a private path service gateway. + Retrieve a reserved IP bound to an endpoint gateway. - This request updates an account policy with the information in a provided account - policy patch. The account policy patch object is structured in the same way as a - retrieved account policy and contains only the information to be updated. + This request retrieves the specified reserved IP address if it is bound to the + endpoint gateway specified in the URL. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str id: The account policy identifier. - :param PrivatePathServiceGatewayAccountPolicyPatch - private_path_service_gateway_account_policy_patch: The account policy - patch. + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param str id: The reserved IP 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 `PrivatePathServiceGatewayAccountPolicy` object + :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') + if not endpoint_gateway_id: + raise ValueError('endpoint_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if private_path_service_gateway_account_policy_patch is None: - raise ValueError('private_path_service_gateway_account_policy_patch must be provided') - if isinstance(private_path_service_gateway_account_policy_patch, PrivatePathServiceGatewayAccountPolicyPatch): - private_path_service_gateway_account_policy_patch = convert_model(private_path_service_gateway_account_policy_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_private_path_service_gateway_account_policy', + operation_id='get_endpoint_gateway_ip', ) headers.update(sdk_headers) @@ -25366,84 +26014,62 @@ def update_private_path_service_gateway_account_policy( 'generation': self.generation, } - data = json.dumps(private_path_service_gateway_account_policy_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id', 'id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_keys = ['endpoint_gateway_id', 'id'] + path_param_values = self.encode_path_vars(endpoint_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}'.format(**path_param_dict) + url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_private_path_service_gateway_endpoint_gateway_bindings( + def add_endpoint_gateway_ip( self, - private_path_service_gateway_id: str, - *, - start: Optional[str] = None, - limit: Optional[int] = None, - status: Optional[str] = None, - account_id: Optional[str] = None, + endpoint_gateway_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List endpoint gateway bindings for a private path service gateway. + Bind a reserved IP to an endpoint gateway. - This request lists endpoint gateway bindings for a private path service gateway. - Each endpoint gateway binding is implicitly created when an endpoint gateway is - created targeting the private path service gateway. The associated account policy - is applied to all new endpoint gateway bindings. If an associated account policy - doesn't exist, the private path service gateway's `default_access_policy` is used. - The endpoint gateway bindings will be sorted by their `created_at` property - values, with newest endpoint gateway bindings first. Endpoint gateway bindings - with identical - `created_at` property values will in turn be sorted by ascending `name` property - values. + This request binds the specified reserved IP to the specified endpoint gateway. + The reserved IP: + - must currently be unbound, or not required by its target + - must not be in the same zone as any other reserved IP bound to the endpoint + gateway. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str status: (optional) Filters the collection to endpoint gateway - bindings with a `status` property matching the specified value. - :param str account_id: (optional) Filters the collection to resources with - an `account.id` property matching the specified identifier. + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param str id: The reserved IP 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 `PrivatePathServiceGatewayEndpointGatewayBindingCollection` object + :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') + if not endpoint_gateway_id: + raise ValueError('endpoint_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_private_path_service_gateway_endpoint_gateway_bindings', + operation_id='add_endpoint_gateway_ip', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'status': status, - 'account.id': account_id, } if 'headers' in kwargs: @@ -25451,12 +26077,12 @@ def list_private_path_service_gateway_endpoint_gateway_bindings( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_keys = ['endpoint_gateway_id', 'id'] + path_param_values = self.encode_path_vars(endpoint_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings'.format(**path_param_dict) + url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, params=params, @@ -25465,35 +26091,31 @@ def list_private_path_service_gateway_endpoint_gateway_bindings( response = self.send(request, **kwargs) return response - def get_private_path_service_gateway_endpoint_gateway_binding( + def delete_endpoint_gateway( self, - private_path_service_gateway_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve an endpoint gateway binding for a private path service gateway. + Delete an endpoint gateway. - This request retrieves a single endpoint gateway binding specified by the - identifier in the URL. + This request deletes an endpoint gateway. This operation cannot be reversed. + Reserved IPs that were bound to the endpoint gateway will be released if their + `auto_delete` property is set to true. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str id: The endpoint gateway binding identifier. + :param str id: The endpoint 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 `PrivatePathServiceGatewayEndpointGatewayBinding` object + :rtype: DetailedResponse """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_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_private_path_service_gateway_endpoint_gateway_binding', + operation_id='delete_endpoint_gateway', ) headers.update(sdk_headers) @@ -25505,14 +26127,13 @@ def get_private_path_service_gateway_endpoint_gateway_binding( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id', 'id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}'.format(**path_param_dict) + url = '/endpoint_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -25521,49 +26142,30 @@ def get_private_path_service_gateway_endpoint_gateway_binding( response = self.send(request, **kwargs) return response - def deny_private_path_service_gateway_endpoint_gateway_binding( + def get_endpoint_gateway( self, - private_path_service_gateway_id: str, id: str, - *, - set_account_policy: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ - Deny an endpoint gateway binding for a private path service gateway. + Retrieve an endpoint gateway. - This request denies a `pending` endpoint gateway request, and optionally sets the - policy to deny future requests from the same account. + This request retrieves a single endpoint gateway specified by the identifier in + the URL. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str id: The endpoint gateway binding identifier. - :param bool set_account_policy: (optional) Indicates whether this will - become the access policy for any `pending` and future endpoint gateway - bindings from the same account. - If set to `true`: - - If the account has an existing access policy, that policy will be updated - to `deny`. - Otherwise, a new `deny` access policy will be created for the account. - - All `pending` endpoint gateway bindings for the account will be denied. - If set to `false`: - - No access policies will be created or updated - - All `pending` endpoint gateway bindings for the account will remain - `pending`. + :param str id: The endpoint gateway 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 `EndpointGateway` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_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='deny_private_path_service_gateway_endpoint_gateway_binding', + operation_id='get_endpoint_gateway', ) headers.update(sdk_headers) @@ -25572,77 +26174,55 @@ def deny_private_path_service_gateway_endpoint_gateway_binding( 'generation': self.generation, } - data = { - 'set_account_policy': set_account_policy, - } - 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 = ['private_path_service_gateway_id', 'id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}/deny'.format(**path_param_dict) + url = '/endpoint_gateways/{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 permit_private_path_service_gateway_endpoint_gateway_binding( + def update_endpoint_gateway( self, - private_path_service_gateway_id: str, id: str, - *, - set_account_policy: Optional[bool] = None, + endpoint_gateway_patch: 'EndpointGatewayPatch', **kwargs, ) -> DetailedResponse: """ - Permit an endpoint gateway binding for a private path service gateway. + Update an endpoint gateway. - This request permits a `pending` endpoint gateway request, and optionally sets the - policy to permit future requests from the same account. + This request updates an endpoint gateway's name. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param str id: The endpoint gateway binding identifier. - :param bool set_account_policy: (optional) Indicates whether this will - become the access policy for any `pending` and future endpoint gateway - bindings from the same account. - If set to `true`: - - If the account has an existing access policy, that policy will be updated - to - `permit`. Otherwise, a new `permit` access policy will be created for the - account. - - All `pending` endpoint gateway bindings for the account will be - permitted. - If set to `false`: - - No access policies will be created or updated - - All `pending` endpoint gateway bindings for the account will remain - `pending`. + :param str id: The endpoint gateway identifier. + :param EndpointGatewayPatch endpoint_gateway_patch: The endpoint gateway + patch. :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 `EndpointGateway` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if endpoint_gateway_patch is None: + raise ValueError('endpoint_gateway_patch must be provided') + if isinstance(endpoint_gateway_patch, EndpointGatewayPatch): + endpoint_gateway_patch = convert_model(endpoint_gateway_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='permit_private_path_service_gateway_endpoint_gateway_binding', + operation_id='update_endpoint_gateway', ) headers.update(sdk_headers) @@ -25651,23 +26231,20 @@ def permit_private_path_service_gateway_endpoint_gateway_binding( 'generation': self.generation, } - data = { - 'set_account_policy': set_account_policy, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' + data = json.dumps(endpoint_gateway_patch) + headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id', 'id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}/permit'.format(**path_param_dict) + url = '/endpoint_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='PATCH', url=url, headers=headers, params=params, @@ -25677,49 +26254,88 @@ def permit_private_path_service_gateway_endpoint_gateway_binding( response = self.send(request, **kwargs) return response - def publish_private_path_service_gateway( + ######################### + # Flow log collectors + ######################### + + def list_flow_log_collectors( self, - private_path_service_gateway_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + resource_group_id: Optional[str] = None, + name: Optional[str] = None, + vpc_id: Optional[str] = None, + vpc_crn: Optional[str] = None, + vpc_name: Optional[str] = None, + target_id: Optional[str] = None, + target_resource_type: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ - Publish a private path service gateway. + List flow log collectors. - This request publishes a private path service gateway, allowing any account to - request access to it. + This request lists flow log collectors in the region. A [flow log + collector](https://cloud.ibm.com/docs/vpc?topic=vpc-flow-logs) summarizes data + sent over the instance network interfaces and instance network attachments + contained within its target. The collected flow logs are written to a cloud object + storage bucket, where they can be + [viewed](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). - :param str private_path_service_gateway_id: The private path service - gateway identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str vpc_id: (optional) Filters the collection to resources with a + `vpc.id` property matching the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources with a + `vpc.crn` property matching the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources with a + `vpc.name` property matching the exact specified name. + :param str target_id: (optional) Filters the collection to resources with a + `target.id` property matching the specified identifier. + :param str target_resource_type: (optional) Filters the collection to + resources with a `target.resource_type` property matching the specified + value. :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 `FlowLogCollectorCollection` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='publish_private_path_service_gateway', + operation_id='list_flow_log_collectors', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'name': name, + 'vpc.id': vpc_id, + 'vpc.crn': vpc_crn, + 'vpc.name': vpc_name, + 'target.id': target_id, + 'target.resource_type': target_resource_type, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/publish'.format(**path_param_dict) + url = '/flow_log_collectors' request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, @@ -25728,40 +26344,68 @@ def publish_private_path_service_gateway( response = self.send(request, **kwargs) return response - def revoke_account_for_private_path_service_gateway( + def create_flow_log_collector( self, - private_path_service_gateway_id: str, - account: 'AccountIdentity', + storage_bucket: 'LegacyCloudObjectStorageBucketIdentity', + target: 'FlowLogCollectorTargetPrototype', + *, + active: Optional[bool] = None, + name: Optional[str] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, **kwargs, ) -> DetailedResponse: """ - Revoke access to a private path service gateway for an account. + Create a flow log collector. - This request revokes a consumer account. This operation cannot be reversed. The - `status` of all endpoint gateway bindings associated with the specified private - path service gateway become `denied`. If the specified account has an existing - access policy, that policy will be updated to `denied`. Otherwise, a new `deny` - access policy will be created for the account. + This request creates and starts a new flow log collector from a flow log collector + prototype object. The prototype object is structured in the same way as a + retrieved flow log collector, and contains the information necessary to create and + start the new flow log collector. - :param str private_path_service_gateway_id: The private path service - gateway identifier. - :param AccountIdentity account: The account that will be revoked access to - the private path service gateway. + :param LegacyCloudObjectStorageBucketIdentity storage_bucket: The Cloud + Object Storage bucket where the collected flows will be logged. + The bucket must exist and an IAM service authorization must grant + `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer + access to the bucket. For more information, see [Creating a flow log + collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector). + :param FlowLogCollectorTargetPrototype target: The target this collector + will collect flow logs for. + If the target is an instance, subnet, or VPC, flow logs will not be + collected for any + instance network attachments, virtual network interfaces or instance + network interfaces + within the target that are themselves the target of a more specific flow + log collector. + The target must not be a virtual network interface that is attached to a + bare metal server + network attachment or to a file share mount target. + :param bool active: (optional) Indicates whether this collector will be + active upon creation. + :param str name: (optional) The name for this flow log collector. The name + must not be used by another flow log collector in the VPC. If unspecified, + the name will be a hyphenated list of randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. :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 `FlowLogCollector` object """ - if not private_path_service_gateway_id: - raise ValueError('private_path_service_gateway_id must be provided') - if account is None: - raise ValueError('account must be provided') - account = convert_model(account) + if storage_bucket is None: + raise ValueError('storage_bucket must be provided') + if target is None: + raise ValueError('target must be provided') + storage_bucket = convert_model(storage_bucket) + target = convert_model(target) + if resource_group is not None: + resource_group = convert_model(resource_group) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='revoke_account_for_private_path_service_gateway', + operation_id='create_flow_log_collector', ) headers.update(sdk_headers) @@ -25771,7 +26415,11 @@ def revoke_account_for_private_path_service_gateway( } data = { - 'account': account, + 'storage_bucket': storage_bucket, + 'target': target, + 'active': active, + 'name': name, + 'resource_group': resource_group, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -25780,11 +26428,9 @@ def revoke_account_for_private_path_service_gateway( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['private_path_service_gateway_id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/revoke_account'.format(**path_param_dict) + url = '/flow_log_collectors' request = self.prepare_request( method='POST', url=url, @@ -25796,33 +26442,32 @@ def revoke_account_for_private_path_service_gateway( response = self.send(request, **kwargs) return response - def unpublish_private_path_service_gateway( + def delete_flow_log_collector( self, - private_path_service_gateway_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - Unpublish a private path service gateway. + Delete a flow log collector. - This request unpublishes a private path service gateway. For this request to - succeed, any existing access from other accounts must first be revoked. Once - unpublished, access will again be restricted to the account that created this - private path service gateway. + This request stops and deletes a flow log collector. This operation cannot be + reversed. + Collected flow logs remain available within the flow log collector's Cloud Object + Storage bucket. - :param str private_path_service_gateway_id: The private path service - gateway identifier. + :param str id: The flow log collector 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 private_path_service_gateway_id: - raise ValueError('private_path_service_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='unpublish_private_path_service_gateway', + operation_id='delete_flow_log_collector', ) headers.update(sdk_headers) @@ -25835,12 +26480,12 @@ def unpublish_private_path_service_gateway( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['private_path_service_gateway_id'] - path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/private_path_service_gateways/{private_path_service_gateway_id}/unpublish'.format(**path_param_dict) + url = '/flow_log_collectors/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='DELETE', url=url, headers=headers, params=params, @@ -25849,200 +26494,1717 @@ def unpublish_private_path_service_gateway( response = self.send(request, **kwargs) return response - -class ListVpcDnsResolutionBindingsEnums: - """ - Enums for list_vpc_dns_resolution_bindings parameters. - """ - - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + def get_flow_log_collector( + self, + id: str, + **kwargs, + ) -> DetailedResponse: """ + Retrieve a flow log collector. - CREATED_AT = 'created_at' - NAME = 'name' - - -class ListSubnetReservedIpsEnums: - """ - Enums for list_subnet_reserved_ips parameters. - """ + This request retrieves a single flow log collector specified by the identifier in + the URL. - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + :param str id: The flow log collector 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 `FlowLogCollector` object """ - ADDRESS = 'address' - CREATED_AT = 'created_at' - NAME = 'name' + 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_flow_log_collector', + ) + headers.update(sdk_headers) + params = { + 'version': self.version, + 'generation': self.generation, + } -class ListImagesEnums: - """ - Enums for list_images parameters. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - class Status(str, Enum): - """ - Filters the collection to images with a `status` property matching one of the - specified comma-separated values. - """ + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/flow_log_collectors/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) - AVAILABLE = 'available' - DELETING = 'deleting' - DEPRECATED = 'deprecated' - FAILED = 'failed' - OBSOLETE = 'obsolete' - PENDING = 'pending' - UNUSABLE = 'unusable' - class Visibility(str, Enum): - """ - Filters the collection to images with a `visibility` property matching the - specified value. - """ + response = self.send(request, **kwargs) + return response - PRIVATE = 'private' - PUBLIC = 'public' - class UserDataFormat(str, Enum): - """ - Filters the collection to images with a `user_data_format` property matching one - of the specified comma-separated values. + def update_flow_log_collector( + self, + id: str, + flow_log_collector_patch: 'FlowLogCollectorPatch', + **kwargs, + ) -> DetailedResponse: """ + Update a flow log collector. - CLOUD_INIT = 'cloud_init' - ESXI_KICKSTART = 'esxi_kickstart' - IPXE = 'ipxe' - - -class ListVolumesEnums: - """ - Enums for list_volumes parameters. - """ - - class AttachmentState(str, Enum): - """ - Filters the collection to volumes with an `attachment_state` property matching the - specified value. - """ + This request updates a flow log collector with the information in a provided flow + log collector patch. The flow log collector patch object is structured in the same + way as a retrieved flow log collector and contains only the information to be + updated. - ATTACHED = 'attached' - UNATTACHED = 'unattached' - UNUSABLE = 'unusable' - class Encryption(str, Enum): - """ - Filters the collection to resources with an `encryption` property matching the - specified value. + :param str id: The flow log collector identifier. + :param FlowLogCollectorPatch flow_log_collector_patch: The flow log + collector patch. + :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 `FlowLogCollector` object """ - PROVIDER_MANAGED = 'provider_managed' - USER_MANAGED = 'user_managed' + if not id: + raise ValueError('id must be provided') + if flow_log_collector_patch is None: + raise ValueError('flow_log_collector_patch must be provided') + if isinstance(flow_log_collector_patch, FlowLogCollectorPatch): + flow_log_collector_patch = convert_model(flow_log_collector_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_flow_log_collector', + ) + headers.update(sdk_headers) + params = { + 'version': self.version, + 'generation': self.generation, + } -class ListSnapshotConsistencyGroupsEnums: - """ - Enums for list_snapshot_consistency_groups parameters. - """ + data = json.dumps(flow_log_collector_patch) + headers['content-type'] = 'application/merge-patch+json' - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - CREATED_AT = 'created_at' - NAME = 'name' + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/flow_log_collectors/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + response = self.send(request, **kwargs) + return response -class ListSnapshotsEnums: - """ - Enums for list_snapshots parameters. - """ + ######################### + # Private path service gateways + ######################### - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + def list_private_path_service_gateways( + self, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + resource_group_id: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: """ + List private path service gateways. - CREATED_AT = 'created_at' - NAME = 'name' - - -class ListShareProfilesEnums: - """ - Enums for list_share_profiles parameters. - """ + This request lists private path service gateways in the region. Private path + service gateways allow + [service + providers](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components) + to make their services available using + [private path + connectivity](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components). + Private path service gateways are used to facilitate and manage the private path + connectivity between private path network load balancers and their associated + endpoint gateways. - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + 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 `PrivatePathServiceGatewayCollection` object """ - CREATED_AT = 'created_at' - NAME = 'name' - - -class ListSharesEnums: - """ - Enums for list_shares parameters. - """ - - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. - """ + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_private_path_service_gateways', + ) + headers.update(sdk_headers) - CREATED_AT = 'created_at' - NAME = 'name' - class ReplicationRole(str, Enum): - """ - Filters the collection to file shares with a `replication_role` property matching - the specified value. - """ + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + } - NONE = 'none' - REPLICA = 'replica' - SOURCE = 'source' + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + url = '/private_path_service_gateways' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) -class ListBackupPolicyJobsEnums: - """ - Enums for list_backup_policy_jobs parameters. - """ + response = self.send(request, **kwargs) + return response - class Status(str, Enum): - """ - Filters the collection to backup policy jobs with a `status` property matching the - specified value. + def create_private_path_service_gateway( + self, + load_balancer: 'LoadBalancerIdentity', + service_endpoints: List[str], + *, + default_access_policy: Optional[str] = None, + name: Optional[str] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, + zonal_affinity: Optional[bool] = None, + **kwargs, + ) -> DetailedResponse: """ + Create a private path service gateway. + This request creates a private path service gateway from a private path service + gateway prototype object. The prototype object is structured in the same way as a + retrieved private path service gateway, and contains the information necessary to + create the new private path service gateway. + + :param LoadBalancerIdentity load_balancer: The load balancer for this + private path service gateway. The load balancer must + have `is_private_path` set to `true`. + The private path service gateway will reside in the same VPC as the + specified load + balancer. + :param List[str] service_endpoints: The fully qualified domain names for + this private path service gateway. Any uppercase letters will be converted + to lowercase. + :param str default_access_policy: (optional) The policy to use for bindings + from accounts without an explicit account policy. + :param str name: (optional) The name for this private path service gateway. + The name must not be used by another private path service gateway in the + VPC. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. + :param bool zonal_affinity: (optional) Indicates whether this private path + service gateway has zonal affinity. + - `true`: Traffic to the service from a zone the service resides in will + remain in + that zone. + - `false`: Traffic to the service from a zone will be load balanced across + all zones + in the region the service resides in. + :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 `PrivatePathServiceGateway` object + """ + + if load_balancer is None: + raise ValueError('load_balancer must be provided') + if service_endpoints is None: + raise ValueError('service_endpoints must be provided') + load_balancer = convert_model(load_balancer) + if resource_group is not None: + resource_group = convert_model(resource_group) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_private_path_service_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = { + 'load_balancer': load_balancer, + 'service_endpoints': service_endpoints, + 'default_access_policy': default_access_policy, + 'name': name, + 'resource_group': resource_group, + 'zonal_affinity': zonal_affinity, + } + 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' + + url = '/private_path_service_gateways' + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def delete_private_path_service_gateway( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Delete a private path service gateway. + + This request deletes a private path service gateway. For this request to succeed, + the value of `endpoint_gateway_count` must be `0`. This operation cannot be + reversed. + + :param str id: The private path service gateway 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 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_private_path_service_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{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_private_path_service_gateway( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve a private path service gateway. + + This request retrieves the private path service gateway specified by the + identifier in the URL. + + :param str id: The private path service 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 `PrivatePathServiceGateway` object + """ + + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_private_path_service_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def update_private_path_service_gateway( + self, + id: str, + private_path_service_gateway_patch: 'PrivatePathServiceGatewayPatch', + **kwargs, + ) -> DetailedResponse: + """ + Update a private path service gateway. + + This request updates a private path service gateway with the information provided + in a private path service gateway patch object. The private path service gateway + patch object is structured in the same way as a retrieved private path service + gateway and contains only the information to be updated. + + :param str id: The private path service gateway identifier. + :param PrivatePathServiceGatewayPatch private_path_service_gateway_patch: + The private path service gateway patch. + :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 `PrivatePathServiceGateway` object + """ + + if not id: + raise ValueError('id must be provided') + if private_path_service_gateway_patch is None: + raise ValueError('private_path_service_gateway_patch must be provided') + if isinstance(private_path_service_gateway_patch, PrivatePathServiceGatewayPatch): + private_path_service_gateway_patch = convert_model(private_path_service_gateway_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_private_path_service_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = json.dumps(private_path_service_gateway_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def list_private_path_service_gateway_account_policies( + self, + private_path_service_gateway_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + account_id: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + List account policies for a private path service gateway. + + This request lists account policies for a private path service gateway. Each + policy defines how requests to use the private path service gateway from that + account will be handled. + The account policies will be sorted by their `created_at` property values, with + newest account policies first. Account policies with identical `created_at` + property values will in turn be sorted by ascending `id` property values. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str account_id: (optional) Filters the collection to resources with + an `account.id` property matching the specified 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 `PrivatePathServiceGatewayAccountPolicyCollection` object + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_private_path_service_gateway_account_policies', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit, + 'account.id': account_id, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['private_path_service_gateway_id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies'.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_private_path_service_gateway_account_policy( + self, + private_path_service_gateway_id: str, + access_policy: str, + account: 'AccountIdentity', + **kwargs, + ) -> DetailedResponse: + """ + Create an account policy for a private path service gateway. + + This request creates an account policy from an account policy prototype object. + The prototype object is structured in the same way as a retrieved account policy, + and contains the information necessary to create the new account policy. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str access_policy: The access policy for the account. Updating the + access policy only affects pending and future endpoint gateway bindings. + - permit: access will be permitted + - deny: access will be denied + - review: access will be manually reviewed + - Updating to `review` sets the status of future endpoint gateway bindings + from + this account to `pending`. + - Updating to `permit` updates both the status of any `pending` and future + endpoint + gateway bindings from this account to `permitted`. + - Updating to `deny` updates both the status of any `pending` and future + endpoint + gateway bindings from this account to `denied`. + :param AccountIdentity account: The account for this access policy. The + account must be unique across all account + policies for this private path service gateway. + :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 `PrivatePathServiceGatewayAccountPolicy` object + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_gateway_id must be provided') + if access_policy is None: + raise ValueError('access_policy must be provided') + if account is None: + raise ValueError('account must be provided') + account = convert_model(account) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_private_path_service_gateway_account_policy', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = { + 'access_policy': access_policy, + 'account': account, + } + 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 = ['private_path_service_gateway_id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def delete_private_path_service_gateway_account_policy( + self, + private_path_service_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Delete an account policy for a private path service gateway. + + This request deletes an account policy. This operation cannot be reversed and it + does not affect the `status` of any existing endpoint gateway bindings. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str id: The account policy 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 private_path_service_gateway_id: + raise ValueError('private_path_service_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_private_path_service_gateway_account_policy', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['private_path_service_gateway_id', 'id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{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_private_path_service_gateway_account_policy( + self, + private_path_service_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve an account policy for a private path service gateway. + + This request retrieves a single account policy specified by the identifier in the + URL. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str id: The account policy 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 `PrivatePathServiceGatewayAccountPolicy` object + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_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_private_path_service_gateway_account_policy', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['private_path_service_gateway_id', 'id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def update_private_path_service_gateway_account_policy( + self, + private_path_service_gateway_id: str, + id: str, + private_path_service_gateway_account_policy_patch: 'PrivatePathServiceGatewayAccountPolicyPatch', + **kwargs, + ) -> DetailedResponse: + """ + Update an account policy for a private path service gateway. + + This request updates an account policy with the information in a provided account + policy patch. The account policy patch object is structured in the same way as a + retrieved account policy and contains only the information to be updated. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str id: The account policy identifier. + :param PrivatePathServiceGatewayAccountPolicyPatch + private_path_service_gateway_account_policy_patch: The account policy + patch. + :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 `PrivatePathServiceGatewayAccountPolicy` object + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if private_path_service_gateway_account_policy_patch is None: + raise ValueError('private_path_service_gateway_account_policy_patch must be provided') + if isinstance(private_path_service_gateway_account_policy_patch, PrivatePathServiceGatewayAccountPolicyPatch): + private_path_service_gateway_account_policy_patch = convert_model(private_path_service_gateway_account_policy_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_private_path_service_gateway_account_policy', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = json.dumps(private_path_service_gateway_account_policy_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['private_path_service_gateway_id', 'id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def list_private_path_service_gateway_endpoint_gateway_bindings( + self, + private_path_service_gateway_id: str, + *, + start: Optional[str] = None, + limit: Optional[int] = None, + status: Optional[str] = None, + account_id: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + List endpoint gateway bindings for a private path service gateway. + + This request lists endpoint gateway bindings for a private path service gateway. + Each endpoint gateway binding is implicitly created when an endpoint gateway is + created targeting the private path service gateway. The associated account policy + is applied to all new endpoint gateway bindings. If an associated account policy + doesn't exist, the private path service gateway's `default_access_policy` is used. + The endpoint gateway bindings will be sorted by their `created_at` property + values, with newest endpoint gateway bindings first. Endpoint gateway bindings + with identical + `created_at` property values will in turn be sorted by ascending `name` property + values. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str status: (optional) Filters the collection to endpoint gateway + bindings with a `status` property matching the specified value. + :param str account_id: (optional) Filters the collection to resources with + an `account.id` property matching the specified 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 `PrivatePathServiceGatewayEndpointGatewayBindingCollection` object + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_private_path_service_gateway_endpoint_gateway_bindings', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit, + 'status': status, + 'account.id': account_id, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['private_path_service_gateway_id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_private_path_service_gateway_endpoint_gateway_binding( + self, + private_path_service_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve an endpoint gateway binding for a private path service gateway. + + This request retrieves a single endpoint gateway binding specified by the + identifier in the URL. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str id: The endpoint gateway binding 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 `PrivatePathServiceGatewayEndpointGatewayBinding` object + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_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_private_path_service_gateway_endpoint_gateway_binding', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['private_path_service_gateway_id', 'id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def deny_private_path_service_gateway_endpoint_gateway_binding( + self, + private_path_service_gateway_id: str, + id: str, + *, + set_account_policy: Optional[bool] = None, + **kwargs, + ) -> DetailedResponse: + """ + Deny an endpoint gateway binding for a private path service gateway. + + This request denies a `pending` endpoint gateway request, and optionally sets the + policy to deny future requests from the same account. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str id: The endpoint gateway binding identifier. + :param bool set_account_policy: (optional) Indicates whether this will + become the access policy for any `pending` and future endpoint gateway + bindings from the same account. + If set to `true`: + - If the account has an existing access policy, that policy will be updated + to `deny`. + Otherwise, a new `deny` access policy will be created for the account. + - All `pending` endpoint gateway bindings for the account will be denied. + If set to `false`: + - No access policies will be created or updated + - All `pending` endpoint gateway bindings for the account will remain + `pending`. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_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='deny_private_path_service_gateway_endpoint_gateway_binding', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = { + 'set_account_policy': set_account_policy, + } + 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'] + + path_param_keys = ['private_path_service_gateway_id', 'id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}/deny'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def permit_private_path_service_gateway_endpoint_gateway_binding( + self, + private_path_service_gateway_id: str, + id: str, + *, + set_account_policy: Optional[bool] = None, + **kwargs, + ) -> DetailedResponse: + """ + Permit an endpoint gateway binding for a private path service gateway. + + This request permits a `pending` endpoint gateway request, and optionally sets the + policy to permit future requests from the same account. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param str id: The endpoint gateway binding identifier. + :param bool set_account_policy: (optional) Indicates whether this will + become the access policy for any `pending` and future endpoint gateway + bindings from the same account. + If set to `true`: + - If the account has an existing access policy, that policy will be updated + to + `permit`. Otherwise, a new `permit` access policy will be created for the + account. + - All `pending` endpoint gateway bindings for the account will be + permitted. + If set to `false`: + - No access policies will be created or updated + - All `pending` endpoint gateway bindings for the account will remain + `pending`. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_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='permit_private_path_service_gateway_endpoint_gateway_binding', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = { + 'set_account_policy': set_account_policy, + } + 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'] + + path_param_keys = ['private_path_service_gateway_id', 'id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}/permit'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def publish_private_path_service_gateway( + self, + private_path_service_gateway_id: str, + **kwargs, + ) -> DetailedResponse: + """ + Publish a private path service gateway. + + This request publishes a private path service gateway, allowing any account to + request access to it. + + :param str private_path_service_gateway_id: The private path service + gateway 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 private_path_service_gateway_id: + raise ValueError('private_path_service_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='publish_private_path_service_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['private_path_service_gateway_id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/publish'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def revoke_account_for_private_path_service_gateway( + self, + private_path_service_gateway_id: str, + account: 'AccountIdentity', + **kwargs, + ) -> DetailedResponse: + """ + Revoke access to a private path service gateway for an account. + + This request revokes a consumer account. This operation cannot be reversed. The + `status` of all endpoint gateway bindings associated with the specified private + path service gateway become `denied`. If the specified account has an existing + access policy, that policy will be updated to `denied`. Otherwise, a new `deny` + access policy will be created for the account. + + :param str private_path_service_gateway_id: The private path service + gateway identifier. + :param AccountIdentity account: The account that will be revoked access to + the private path service gateway. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not private_path_service_gateway_id: + raise ValueError('private_path_service_gateway_id must be provided') + if account is None: + raise ValueError('account must be provided') + account = convert_model(account) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='revoke_account_for_private_path_service_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = { + 'account': account, + } + 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'] + + path_param_keys = ['private_path_service_gateway_id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/revoke_account'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def unpublish_private_path_service_gateway( + self, + private_path_service_gateway_id: str, + **kwargs, + ) -> DetailedResponse: + """ + Unpublish a private path service gateway. + + This request unpublishes a private path service gateway. For this request to + succeed, any existing access from other accounts must first be revoked. Once + unpublished, access will again be restricted to the account that created this + private path service gateway. + + :param str private_path_service_gateway_id: The private path service + gateway 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 private_path_service_gateway_id: + raise ValueError('private_path_service_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='unpublish_private_path_service_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['private_path_service_gateway_id'] + path_param_values = self.encode_path_vars(private_path_service_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/private_path_service_gateways/{private_path_service_gateway_id}/unpublish'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + +class ListVpcDnsResolutionBindingsEnums: + """ + Enums for list_vpc_dns_resolution_bindings parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListSubnetReservedIpsEnums: + """ + Enums for list_subnet_reserved_ips parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + ADDRESS = 'address' + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListImagesEnums: + """ + Enums for list_images parameters. + """ + + class Status(str, Enum): + """ + Filters the collection to images with a `status` property matching one of the + specified comma-separated values. + """ + + AVAILABLE = 'available' + DELETING = 'deleting' + DEPRECATED = 'deprecated' + FAILED = 'failed' + OBSOLETE = 'obsolete' + PENDING = 'pending' + UNUSABLE = 'unusable' + class Visibility(str, Enum): + """ + Filters the collection to images with a `visibility` property matching the + specified value. + """ + + PRIVATE = 'private' + PUBLIC = 'public' + class UserDataFormat(str, Enum): + """ + Filters the collection to images with a `user_data_format` property matching one + of the specified comma-separated values. + """ + + CLOUD_INIT = 'cloud_init' + ESXI_KICKSTART = 'esxi_kickstart' + IPXE = 'ipxe' + + +class ListVolumesEnums: + """ + Enums for list_volumes parameters. + """ + + class AttachmentState(str, Enum): + """ + Filters the collection to volumes with an `attachment_state` property matching the + specified value. + """ + + ATTACHED = 'attached' + UNATTACHED = 'unattached' + UNUSABLE = 'unusable' + class Encryption(str, Enum): + """ + Filters the collection to resources with an `encryption` property matching the + specified value. + """ + + PROVIDER_MANAGED = 'provider_managed' + USER_MANAGED = 'user_managed' + + +class ListSnapshotConsistencyGroupsEnums: + """ + Enums for list_snapshot_consistency_groups parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListSnapshotsEnums: + """ + Enums for list_snapshots parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListShareProfilesEnums: + """ + Enums for list_share_profiles parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListSharesEnums: + """ + Enums for list_shares parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + class ReplicationRole(str, Enum): + """ + Filters the collection to file shares with a `replication_role` property matching + the specified value. + """ + + NONE = 'none' + REPLICA = 'replica' + SOURCE = 'source' + + +class ListBackupPolicyJobsEnums: + """ + Enums for list_backup_policy_jobs parameters. + """ + + class Status(str, Enum): + """ + Filters the collection to backup policy jobs with a `status` property matching the + specified value. + """ + + FAILED = 'failed' + RUNNING = 'running' + SUCCEEDED = 'succeeded' + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListNetworkInterfaceFloatingIpsEnums: + """ + Enums for list_network_interface_floating_ips parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value + `-name` sorts the collection by the `name` property in descending order, and the + value `name` sorts it by the `name` property in ascending order. + """ + + ADDRESS = 'address' + NAME = 'name' + + +class ListVirtualNetworkInterfaceIpsEnums: + """ + Enums for list_virtual_network_interface_ips parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value + `-name` sorts the collection by the `name` property in descending order, and the + value `name` sorts it by the `name` property in ascending order. + """ + + ADDRESS = 'address' + NAME = 'name' + + +class ListClusterNetworksEnums: + """ + Enums for list_cluster_networks parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListClusterNetworkInterfacesEnums: + """ + Enums for list_cluster_network_interfaces parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListClusterNetworkSubnetsEnums: + """ + Enums for list_cluster_network_subnets parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListClusterNetworkSubnetReservedIpsEnums: + """ + Enums for list_cluster_network_subnet_reserved_ips parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + ADDRESS = 'address' + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListFloatingIpsEnums: + """ + Enums for list_floating_ips parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListNetworkAclRulesEnums: + """ + Enums for list_network_acl_rules parameters. + """ + + class Direction(str, Enum): + """ + Filters the collection to rules with a `direction` property matching the specified + value. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + +class ListVpnGatewaysEnums: + """ + Enums for list_vpn_gateways parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + class Mode(str, Enum): + """ + Filters the collection to VPN gateways with a `mode` property matching the + specified value. + """ + + POLICY = 'policy' + ROUTE = 'route' + + +class ListVpnGatewayConnectionsEnums: + """ + Enums for list_vpn_gateway_connections parameters. + """ + + class Status(str, Enum): + """ + Filters the collection to VPN gateway connections with a `status` property + matching the specified value. + """ + + DOWN = 'down' + UP = 'up' + + +class ListVpnServersEnums: + """ + Enums for list_vpn_servers parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListVpnServerClientsEnums: + """ + Enums for list_vpn_server_clients parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order. + """ + + CREATED_AT = 'created_at' + + +class ListVpnServerRoutesEnums: + """ + Enums for list_vpn_server_routes parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListEndpointGatewaysEnums: + """ + Enums for list_endpoint_gateways parameters. + """ + + class LifecycleState(str, Enum): + """ + Filters the collection to resources with a `lifecycle_state` property matching one + of the specified comma-separated values. + """ + + DELETING = 'deleting' FAILED = 'failed' - RUNNING = 'running' - SUCCEEDED = 'succeeded' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + +class ListEndpointGatewayIpsEnums: + """ + Enums for list_endpoint_gateway_ips parameters. + """ + class Sort(str, Enum): """ Sorts the returned collection by the specified property name in ascending order. A @@ -26052,299 +28214,1664 @@ class Sort(str, Enum): ascending order. """ + ADDRESS = 'address' CREATED_AT = 'created_at' NAME = 'name' -class ListNetworkInterfaceFloatingIpsEnums: - """ - Enums for list_network_interface_floating_ips parameters. - """ +class ListPrivatePathServiceGatewayEndpointGatewayBindingsEnums: + """ + Enums for list_private_path_service_gateway_endpoint_gateway_bindings parameters. + """ + + class Status(str, Enum): + """ + Filters the collection to endpoint gateway bindings with a `status` property + matching the specified value. + """ + + ABANDONED = 'abandoned' + DENIED = 'denied' + EXPIRED = 'expired' + PENDING = 'pending' + PERMITTED = 'permitted' + + +############################################################################## +# Models +############################################################################## + + +class AccountIdentity: + """ + Identifies an account by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a AccountIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['AccountIdentityById']) + ) + raise Exception(msg) + + +class AccountReference: + """ + AccountReference. + + :param str id: The unique identifier for this account. + :param str resource_type: The resource type. + """ + + def __init__( + self, + id: str, + resource_type: str, + ) -> None: + """ + Initialize a AccountReference object. + + :param str id: The unique identifier for this account. + :param str resource_type: The resource type. + """ + self.id = id + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountReference': + """Initialize a AccountReference object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in AccountReference JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in AccountReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AccountReference 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + 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 AccountReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountReference') -> 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: 'AccountReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + ACCOUNT = 'account' + + + +class AddressPrefix: + """ + AddressPrefix. + + :param str cidr: The CIDR block for this prefix. + :param datetime created_at: The date and time that the prefix was created. + :param bool has_subnets: Indicates whether subnets exist with addresses from + this prefix. + :param str href: The URL for this address prefix. + :param str id: The unique identifier for this address prefix. + :param bool is_default: Indicates whether this is the default prefix for this + zone in this VPC. If a default prefix was automatically created when the VPC was + created, the prefix is automatically named using a hyphenated list of + randomly-selected words, but may be changed. + :param str name: The name for this address prefix. The name must not be used by + another address prefix for the VPC. + :param ZoneReference zone: The zone this address prefix resides in. + """ + + def __init__( + self, + cidr: str, + created_at: datetime, + has_subnets: bool, + href: str, + id: str, + is_default: bool, + name: str, + zone: 'ZoneReference', + ) -> None: + """ + Initialize a AddressPrefix object. + + :param str cidr: The CIDR block for this prefix. + :param datetime created_at: The date and time that the prefix was created. + :param bool has_subnets: Indicates whether subnets exist with addresses + from this prefix. + :param str href: The URL for this address prefix. + :param str id: The unique identifier for this address prefix. + :param bool is_default: Indicates whether this is the default prefix for + this zone in this VPC. If a default prefix was automatically created when + the VPC was created, the prefix is automatically named using a hyphenated + list of randomly-selected words, but may be changed. + :param str name: The name for this address prefix. The name must not be + used by another address prefix for the VPC. + :param ZoneReference zone: The zone this address prefix resides in. + """ + self.cidr = cidr + self.created_at = created_at + self.has_subnets = has_subnets + self.href = href + self.id = id + self.is_default = is_default + self.name = name + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AddressPrefix': + """Initialize a AddressPrefix object from a json dictionary.""" + args = {} + if (cidr := _dict.get('cidr')) is not None: + args['cidr'] = cidr + else: + raise ValueError('Required property \'cidr\' not present in AddressPrefix JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in AddressPrefix JSON') + if (has_subnets := _dict.get('has_subnets')) is not None: + args['has_subnets'] = has_subnets + else: + raise ValueError('Required property \'has_subnets\' not present in AddressPrefix JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in AddressPrefix JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in AddressPrefix JSON') + if (is_default := _dict.get('is_default')) is not None: + args['is_default'] = is_default + else: + raise ValueError('Required property \'is_default\' not present in AddressPrefix JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in AddressPrefix JSON') + if (zone := _dict.get('zone')) is not None: + args['zone'] = ZoneReference.from_dict(zone) + else: + raise ValueError('Required property \'zone\' not present in AddressPrefix JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AddressPrefix 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, 'cidr') and self.cidr is not None: + _dict['cidr'] = self.cidr + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'has_subnets') and self.has_subnets is not None: + _dict['has_subnets'] = self.has_subnets + 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 + if hasattr(self, 'is_default') and self.is_default is not None: + _dict['is_default'] = self.is_default + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AddressPrefix object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AddressPrefix') -> 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: 'AddressPrefix') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AddressPrefixCollection: + """ + AddressPrefixCollection. + + :param List[AddressPrefix] address_prefixes: A page of address prefixes for the + VPC. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. + """ + + def __init__( + self, + address_prefixes: List['AddressPrefix'], + first: 'PageLink', + limit: int, + total_count: int, + *, + next: Optional['PageLink'] = None, + ) -> None: + """ + Initialize a AddressPrefixCollection object. + + :param List[AddressPrefix] address_prefixes: A page of address prefixes for + the VPC. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + """ + self.address_prefixes = address_prefixes + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollection': + """Initialize a AddressPrefixCollection object from a json dictionary.""" + args = {} + if (address_prefixes := _dict.get('address_prefixes')) is not None: + args['address_prefixes'] = [AddressPrefix.from_dict(v) for v in address_prefixes] + else: + raise ValueError('Required property \'address_prefixes\' not present in AddressPrefixCollection JSON') + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in AddressPrefixCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in AddressPrefixCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in AddressPrefixCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AddressPrefixCollection 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, 'address_prefixes') and self.address_prefixes is not None: + address_prefixes_list = [] + for v in self.address_prefixes: + if isinstance(v, dict): + address_prefixes_list.append(v) + else: + address_prefixes_list.append(v.to_dict()) + _dict['address_prefixes'] = address_prefixes_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + 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 AddressPrefixCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AddressPrefixCollection') -> 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: 'AddressPrefixCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AddressPrefixPatch: + """ + AddressPrefixPatch. + + :param bool is_default: (optional) Indicates whether this is the default prefix + for this zone in this VPC. Updating to true makes this prefix the default prefix + for this zone in this VPC, provided the VPC currently has no default address + prefix for this zone. Updating to false removes the default prefix for this zone + in this VPC. + :param str name: (optional) The name for this address prefix. The name must not + be used by another address prefix for the VPC. + """ + + def __init__( + self, + *, + is_default: Optional[bool] = None, + name: Optional[str] = None, + ) -> None: + """ + Initialize a AddressPrefixPatch object. + + :param bool is_default: (optional) Indicates whether this is the default + prefix for this zone in this VPC. Updating to true makes this prefix the + default prefix for this zone in this VPC, provided the VPC currently has no + default address prefix for this zone. Updating to false removes the default + prefix for this zone in this VPC. + :param str name: (optional) The name for this address prefix. The name must + not be used by another address prefix for the VPC. + """ + self.is_default = is_default + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AddressPrefixPatch': + """Initialize a AddressPrefixPatch object from a json dictionary.""" + args = {} + if (is_default := _dict.get('is_default')) is not None: + args['is_default'] = is_default + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AddressPrefixPatch 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, 'is_default') and self.is_default is not None: + _dict['is_default'] = self.is_default + 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 AddressPrefixPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AddressPrefixPatch') -> 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: 'AddressPrefixPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicy: + """ + BackupPolicy. + + :param datetime created_at: The date and time that the backup policy was + created. + :param str crn: The CRN for this backup policy. + :param List[BackupPolicyHealthReason] health_reasons: The reasons for the + current `health_state` (if any). + :param str health_state: The health of this resource: + - `ok`: No abnormal behavior detected + - `degraded`: Experiencing compromised performance, capacity, or connectivity + - `faulted`: Completely unreachable, inoperative, or otherwise entirely + incapacitated + - `inapplicable`: The health state does not apply because of the current + lifecycle + state. A resource with a lifecycle state of `failed` or `deleting` will have + a + health state of `inapplicable`. A `pending` resource may also have this + state. + :param str href: The URL for this backup policy. + :param str id: The unique identifier for this backup policy. + :param datetime last_job_completed_at: (optional) The date and time that the + most recent job for this backup policy completed. + If absent, no job has yet completed for this backup policy. + :param str lifecycle_state: The lifecycle state of the backup policy. + :param str match_resource_type: The resource type this backup policy applies to. + Resources that have both a matching type and a matching user tag will be subject + to the backup policy. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param List[str] match_user_tags: The user tags this backup policy applies to. + Resources that have both a matching user tag and a matching type will be subject + to the backup policy. + :param str name: The name for this backup policy. The name is unique across all + backup policies in the region. + :param List[BackupPolicyPlanReference] plans: The plans for the backup policy. + :param ResourceGroupReference resource_group: The resource group for this backup + policy. + :param str resource_type: The resource type. + :param BackupPolicyScope scope: The scope for this backup policy. + """ + + def __init__( + self, + created_at: datetime, + crn: str, + health_reasons: List['BackupPolicyHealthReason'], + health_state: str, + href: str, + id: str, + lifecycle_state: str, + match_resource_type: str, + match_user_tags: List[str], + name: str, + plans: List['BackupPolicyPlanReference'], + resource_group: 'ResourceGroupReference', + resource_type: str, + scope: 'BackupPolicyScope', + *, + last_job_completed_at: Optional[datetime] = None, + ) -> None: + """ + Initialize a BackupPolicy object. + + :param datetime created_at: The date and time that the backup policy was + created. + :param str crn: The CRN for this backup policy. + :param List[BackupPolicyHealthReason] health_reasons: The reasons for the + current `health_state` (if any). + :param str health_state: The health of this resource: + - `ok`: No abnormal behavior detected + - `degraded`: Experiencing compromised performance, capacity, or + connectivity + - `faulted`: Completely unreachable, inoperative, or otherwise entirely + incapacitated + - `inapplicable`: The health state does not apply because of the current + lifecycle + state. A resource with a lifecycle state of `failed` or `deleting` will + have a + health state of `inapplicable`. A `pending` resource may also have this + state. + :param str href: The URL for this backup policy. + :param str id: The unique identifier for this backup policy. + :param str lifecycle_state: The lifecycle state of the backup policy. + :param str match_resource_type: The resource type this backup policy + applies to. Resources that have both a matching type and a matching user + tag will be subject to the backup policy. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param List[str] match_user_tags: The user tags this backup policy applies + to. Resources that have both a matching user tag and a matching type will + be subject to the backup policy. + :param str name: The name for this backup policy. The name is unique across + all backup policies in the region. + :param List[BackupPolicyPlanReference] plans: The plans for the backup + policy. + :param ResourceGroupReference resource_group: The resource group for this + backup policy. + :param str resource_type: The resource type. + :param BackupPolicyScope scope: The scope for this backup policy. + :param datetime last_job_completed_at: (optional) The date and time that + the most recent job for this backup policy completed. + If absent, no job has yet completed for this backup policy. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BackupPolicyMatchResourceTypeInstance', 'BackupPolicyMatchResourceTypeVolume']) + ) + raise Exception(msg) + + class HealthStateEnum(str, Enum): + """ + The health of this resource: + - `ok`: No abnormal behavior detected + - `degraded`: Experiencing compromised performance, capacity, or connectivity + - `faulted`: Completely unreachable, inoperative, or otherwise entirely + incapacitated + - `inapplicable`: The health state does not apply because of the current lifecycle + state. A resource with a lifecycle state of `failed` or `deleting` will have a + health state of `inapplicable`. A `pending` resource may also have this state. + """ + + DEGRADED = 'degraded' + FAULTED = 'faulted' + INAPPLICABLE = 'inapplicable' + OK = 'ok' + + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the backup policy. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class MatchResourceTypeEnum(str, Enum): + """ + The resource type this backup policy applies to. Resources that have both a + matching type and a matching user tag will be subject to the backup policy. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + INSTANCE = 'instance' + VOLUME = 'volume' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BACKUP_POLICY = 'backup_policy' + + + +class BackupPolicyCollection: + """ + BackupPolicyCollection. + + :param List[BackupPolicy] backup_policies: A page of backup policies. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. + """ + + def __init__( + self, + backup_policies: List['BackupPolicy'], + first: 'PageLink', + limit: int, + total_count: int, + *, + next: Optional['PageLink'] = None, + ) -> None: + """ + Initialize a BackupPolicyCollection object. + + :param List[BackupPolicy] backup_policies: A page of backup policies. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + """ + self.backup_policies = backup_policies + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollection': + """Initialize a BackupPolicyCollection object from a json dictionary.""" + args = {} + if (backup_policies := _dict.get('backup_policies')) is not None: + args['backup_policies'] = backup_policies + else: + raise ValueError('Required property \'backup_policies\' not present in BackupPolicyCollection JSON') + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in BackupPolicyCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in BackupPolicyCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in BackupPolicyCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyCollection 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, 'backup_policies') and self.backup_policies is not None: + backup_policies_list = [] + for v in self.backup_policies: + if isinstance(v, dict): + backup_policies_list.append(v) + else: + backup_policies_list.append(v.to_dict()) + _dict['backup_policies'] = backup_policies_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + 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 BackupPolicyCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyCollection') -> 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: 'BackupPolicyCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyHealthReason: + """ + BackupPolicyHealthReason. + + :param str code: A reason code for this health state. + :param str message: An explanation of the reason for this health state. + :param str more_info: (optional) Link to documentation about the reason for this + health state. + """ + + def __init__( + self, + code: str, + message: str, + *, + more_info: Optional[str] = None, + ) -> None: + """ + Initialize a BackupPolicyHealthReason object. + + :param str code: A reason code for this health state. + :param str message: An explanation of the reason for this health state. + :param str more_info: (optional) Link to documentation about the reason for + this health state. + """ + self.code = code + self.message = message + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyHealthReason': + """Initialize a BackupPolicyHealthReason object from a json dictionary.""" + args = {} + if (code := _dict.get('code')) is not None: + args['code'] = code + else: + raise ValueError('Required property \'code\' not present in BackupPolicyHealthReason JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message + else: + raise ValueError('Required property \'message\' not present in BackupPolicyHealthReason JSON') + if (more_info := _dict.get('more_info')) is not None: + args['more_info'] = more_info + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyHealthReason 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, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + 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 BackupPolicyHealthReason object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyHealthReason') -> 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: 'BackupPolicyHealthReason') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class CodeEnum(str, Enum): + """ + A reason code for this health state. + """ + + MISSING_SERVICE_AUTHORIZATION_POLICIES = 'missing_service_authorization_policies' + + + +class BackupPolicyJob: + """ + BackupPolicyJob. + + :param bool auto_delete: Indicates whether this backup policy job will be + automatically deleted after it completes. At present, this is always `true`, but + may be modifiable in the future. + :param int auto_delete_after: If `auto_delete` is `true`, the days after + completion that this backup policy job will be deleted. This value may be + modifiable in the future. + :param BackupPolicyPlanReference backup_policy_plan: The backup policy plan + operated this backup policy job (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param datetime completed_at: (optional) The date and time that the backup + policy job was completed. + If absent, the backup policy job has not yet completed. + :param datetime created_at: The date and time that the backup policy job was + created. + :param str href: The URL for this backup policy job. + :param str id: The unique identifier for this backup policy job. + :param str job_type: The type of backup policy job. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str resource_type: The resource type. + :param BackupPolicyJobSource source: The source this backup was created from + (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param str status: The status of the backup policy job. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param List[BackupPolicyJobStatusReason] status_reasons: The reasons for the + current status (if any). + :param List[SnapshotReference] target_snapshots: The snapshots operated on by + this backup policy job (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + """ + + def __init__( + self, + auto_delete: bool, + auto_delete_after: int, + backup_policy_plan: 'BackupPolicyPlanReference', + created_at: datetime, + href: str, + id: str, + job_type: str, + resource_type: str, + source: 'BackupPolicyJobSource', + status: str, + status_reasons: List['BackupPolicyJobStatusReason'], + target_snapshots: List['SnapshotReference'], + *, + completed_at: Optional[datetime] = None, + ) -> None: + """ + Initialize a BackupPolicyJob object. + + :param bool auto_delete: Indicates whether this backup policy job will be + automatically deleted after it completes. At present, this is always + `true`, but may be modifiable in the future. + :param int auto_delete_after: If `auto_delete` is `true`, the days after + completion that this backup policy job will be deleted. This value may be + modifiable in the future. + :param BackupPolicyPlanReference backup_policy_plan: The backup policy plan + operated this backup policy job (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param datetime created_at: The date and time that the backup policy job + was created. + :param str href: The URL for this backup policy job. + :param str id: The unique identifier for this backup policy job. + :param str job_type: The type of backup policy job. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str resource_type: The resource type. + :param BackupPolicyJobSource source: The source this backup was created + from (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param str status: The status of the backup policy job. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param List[BackupPolicyJobStatusReason] status_reasons: The reasons for + the current status (if any). + :param List[SnapshotReference] target_snapshots: The snapshots operated on + by this backup policy job (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param datetime completed_at: (optional) The date and time that the backup + policy job was completed. + If absent, the backup policy job has not yet completed. + """ + self.auto_delete = auto_delete + self.auto_delete_after = auto_delete_after + self.backup_policy_plan = backup_policy_plan + self.completed_at = completed_at + self.created_at = created_at + self.href = href + self.id = id + self.job_type = job_type + self.resource_type = resource_type + self.source = source + self.status = status + self.status_reasons = status_reasons + self.target_snapshots = target_snapshots + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJob': + """Initialize a BackupPolicyJob object from a json dictionary.""" + args = {} + if (auto_delete := _dict.get('auto_delete')) is not None: + args['auto_delete'] = auto_delete + else: + raise ValueError('Required property \'auto_delete\' not present in BackupPolicyJob JSON') + if (auto_delete_after := _dict.get('auto_delete_after')) is not None: + args['auto_delete_after'] = auto_delete_after + else: + raise ValueError('Required property \'auto_delete_after\' not present in BackupPolicyJob JSON') + if (backup_policy_plan := _dict.get('backup_policy_plan')) is not None: + args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(backup_policy_plan) + else: + raise ValueError('Required property \'backup_policy_plan\' not present in BackupPolicyJob JSON') + if (completed_at := _dict.get('completed_at')) is not None: + args['completed_at'] = string_to_datetime(completed_at) + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in BackupPolicyJob JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in BackupPolicyJob JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in BackupPolicyJob JSON') + if (job_type := _dict.get('job_type')) is not None: + args['job_type'] = job_type + else: + raise ValueError('Required property \'job_type\' not present in BackupPolicyJob JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in BackupPolicyJob JSON') + if (source := _dict.get('source')) is not None: + args['source'] = source + else: + raise ValueError('Required property \'source\' not present in BackupPolicyJob JSON') + if (status := _dict.get('status')) is not None: + args['status'] = status + else: + raise ValueError('Required property \'status\' not present in BackupPolicyJob JSON') + if (status_reasons := _dict.get('status_reasons')) is not None: + args['status_reasons'] = [BackupPolicyJobStatusReason.from_dict(v) for v in status_reasons] + else: + raise ValueError('Required property \'status_reasons\' not present in BackupPolicyJob JSON') + if (target_snapshots := _dict.get('target_snapshots')) is not None: + args['target_snapshots'] = [SnapshotReference.from_dict(v) for v in target_snapshots] + else: + raise ValueError('Required property \'target_snapshots\' not present in BackupPolicyJob JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJob 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, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'auto_delete_after') and self.auto_delete_after is not None: + _dict['auto_delete_after'] = self.auto_delete_after + if hasattr(self, 'backup_policy_plan') and self.backup_policy_plan is not None: + if isinstance(self.backup_policy_plan, dict): + _dict['backup_policy_plan'] = self.backup_policy_plan + else: + _dict['backup_policy_plan'] = self.backup_policy_plan.to_dict() + if hasattr(self, 'completed_at') and self.completed_at is not None: + _dict['completed_at'] = datetime_to_string(self.completed_at) + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + 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 + if hasattr(self, 'job_type') and self.job_type is not None: + _dict['job_type'] = self.job_type + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'status_reasons') and self.status_reasons is not None: + status_reasons_list = [] + for v in self.status_reasons: + if isinstance(v, dict): + status_reasons_list.append(v) + else: + status_reasons_list.append(v.to_dict()) + _dict['status_reasons'] = status_reasons_list + if hasattr(self, 'target_snapshots') and self.target_snapshots is not None: + target_snapshots_list = [] + for v in self.target_snapshots: + if isinstance(v, dict): + target_snapshots_list.append(v) + else: + target_snapshots_list.append(v.to_dict()) + _dict['target_snapshots'] = target_snapshots_list + return _dict - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value - `-name` sorts the collection by the `name` property in descending order, and the - value `name` sorts it by the `name` property in ascending order. - """ + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - ADDRESS = 'address' - NAME = 'name' + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyJob object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'BackupPolicyJob') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class ListVirtualNetworkInterfaceIpsEnums: - """ - Enums for list_virtual_network_interface_ips parameters. - """ + def __ne__(self, other: 'BackupPolicyJob') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - class Sort(str, Enum): + class JobTypeEnum(str, Enum): """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value - `-name` sorts the collection by the `name` property in descending order, and the - value `name` sorts it by the `name` property in ascending order. + The type of backup policy job. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - ADDRESS = 'address' - NAME = 'name' - + CREATION = 'creation' + DELETION = 'deletion' -class ListFloatingIpsEnums: - """ - Enums for list_floating_ips parameters. - """ - class Sort(str, Enum): + class ResourceTypeEnum(str, Enum): """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + The resource type. """ - CREATED_AT = 'created_at' - NAME = 'name' - + BACKUP_POLICY_JOB = 'backup_policy_job' -class ListNetworkAclRulesEnums: - """ - Enums for list_network_acl_rules parameters. - """ - class Direction(str, Enum): + class StatusEnum(str, Enum): """ - Filters the collection to rules with a `direction` property matching the specified - value. + The status of the backup policy job. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' + FAILED = 'failed' + RUNNING = 'running' + SUCCEEDED = 'succeeded' -class ListVpnGatewaysEnums: + +class BackupPolicyJobCollection: """ - Enums for list_vpn_gateways parameters. + BackupPolicyJobCollection. + + :param PageLink first: A link to the first page of resources. + :param List[BackupPolicyJob] jobs: A page of jobs for the backup policy. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. """ - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + def __init__( + self, + first: 'PageLink', + jobs: List['BackupPolicyJob'], + limit: int, + total_count: int, + *, + next: Optional['PageLink'] = None, + ) -> None: """ + Initialize a BackupPolicyJobCollection object. - CREATED_AT = 'created_at' - NAME = 'name' - class Mode(str, Enum): - """ - Filters the collection to VPN gateways with a `mode` property matching the - specified value. + :param PageLink first: A link to the first page of resources. + :param List[BackupPolicyJob] jobs: A page of jobs for the backup policy. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ + self.first = first + self.jobs = jobs + self.limit = limit + self.next = next + self.total_count = total_count - POLICY = 'policy' - ROUTE = 'route' - - -class ListVpnGatewayConnectionsEnums: - """ - Enums for list_vpn_gateway_connections parameters. - """ + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollection': + """Initialize a BackupPolicyJobCollection object from a json dictionary.""" + args = {} + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in BackupPolicyJobCollection JSON') + if (jobs := _dict.get('jobs')) is not None: + args['jobs'] = [BackupPolicyJob.from_dict(v) for v in jobs] + else: + raise ValueError('Required property \'jobs\' not present in BackupPolicyJobCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in BackupPolicyJobCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in BackupPolicyJobCollection JSON') + return cls(**args) - class Status(str, Enum): - """ - Filters the collection to VPN gateway connections with a `status` property - matching the specified value. - """ + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJobCollection object from a json dictionary.""" + return cls.from_dict(_dict) - DOWN = 'down' - UP = 'up' + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'jobs') and self.jobs is not None: + jobs_list = [] + for v in self.jobs: + if isinstance(v, dict): + jobs_list.append(v) + else: + jobs_list.append(v.to_dict()) + _dict['jobs'] = jobs_list + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() -class ListVpnServersEnums: - """ - Enums for list_vpn_servers parameters. - """ + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyJobCollection object.""" + return json.dumps(self.to_dict(), indent=2) - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. - """ + def __eq__(self, other: 'BackupPolicyJobCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - CREATED_AT = 'created_at' - NAME = 'name' + def __ne__(self, other: 'BackupPolicyJobCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class ListVpnServerClientsEnums: +class BackupPolicyJobSource: """ - Enums for list_vpn_server_clients parameters. + The source this backup was created from (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + """ - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order. + def __init__( + self, + ) -> None: """ + Initialize a BackupPolicyJobSource object. - CREATED_AT = 'created_at' + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BackupPolicyJobSourceVolumeReference', 'BackupPolicyJobSourceInstanceReference']) + ) + raise Exception(msg) -class ListVpnServerRoutesEnums: +class BackupPolicyJobStatusReason: """ - Enums for list_vpn_server_routes parameters. + BackupPolicyJobStatusReason. + + :param str code: A reason code for the status: + - `internal_error`: Internal error (contact IBM support) + - `snapshot_encryption_key_invalid`: The provided encryption key is unavailable + - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle + state + - `snapshot_volume_limit`: The snapshot limit for the source volume has been + reached + - `source_volume_busy`: The source volume has `busy` set (after multiple + retries) + - `source_volume_too_large`: The source volume exceeds the [maximum supported + size](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-about&interface=api#snapshots-vpc-limitations) + - `source_volume_unavailable`: The source volume is not attached to a running + instance + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status reason. """ - class Sort(str, Enum): + def __init__( + self, + code: str, + message: str, + *, + more_info: Optional[str] = None, + ) -> None: """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + Initialize a BackupPolicyJobStatusReason object. + + :param str code: A reason code for the status: + - `internal_error`: Internal error (contact IBM support) + - `snapshot_encryption_key_invalid`: The provided encryption key is + unavailable + - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` + lifecycle state + - `snapshot_volume_limit`: The snapshot limit for the source volume has + been reached + - `source_volume_busy`: The source volume has `busy` set (after multiple + retries) + - `source_volume_too_large`: The source volume exceeds the [maximum + supported + size](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-about&interface=api#snapshots-vpc-limitations) + - `source_volume_unavailable`: The source volume is not attached to a + running instance + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status + reason. """ + self.code = code + self.message = message + self.more_info = more_info - CREATED_AT = 'created_at' - NAME = 'name' + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobStatusReason': + """Initialize a BackupPolicyJobStatusReason object from a json dictionary.""" + args = {} + if (code := _dict.get('code')) is not None: + args['code'] = code + else: + raise ValueError('Required property \'code\' not present in BackupPolicyJobStatusReason JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message + else: + raise ValueError('Required property \'message\' not present in BackupPolicyJobStatusReason JSON') + if (more_info := _dict.get('more_info')) is not None: + args['more_info'] = more_info + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJobStatusReason object from a json dictionary.""" + return cls.from_dict(_dict) -class ListEndpointGatewaysEnums: - """ - Enums for list_endpoint_gateways parameters. - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict - class LifecycleState(str, Enum): - """ - Filters the collection to resources with a `lifecycle_state` property matching one - of the specified comma-separated values. - """ + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyJobStatusReason object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'BackupPolicyJobStatusReason') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class ListEndpointGatewayIpsEnums: - """ - Enums for list_endpoint_gateway_ips parameters. - """ + def __ne__(self, other: 'BackupPolicyJobStatusReason') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - class Sort(str, Enum): + class CodeEnum(str, Enum): """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + A reason code for the status: + - `internal_error`: Internal error (contact IBM support) + - `snapshot_encryption_key_invalid`: The provided encryption key is unavailable + - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle + state + - `snapshot_volume_limit`: The snapshot limit for the source volume has been + reached + - `source_volume_busy`: The source volume has `busy` set (after multiple retries) + - `source_volume_too_large`: The source volume exceeds the [maximum supported + size](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-about&interface=api#snapshots-vpc-limitations) + - `source_volume_unavailable`: The source volume is not attached to a running + instance + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - ADDRESS = 'address' - CREATED_AT = 'created_at' - NAME = 'name' + INTERNAL_ERROR = 'internal_error' + SNAPSHOT_ENCRYPTION_KEY_INVALID = 'snapshot_encryption_key_invalid' + SNAPSHOT_PENDING = 'snapshot_pending' + SNAPSHOT_VOLUME_LIMIT = 'snapshot_volume_limit' + SOURCE_VOLUME_BUSY = 'source_volume_busy' + SOURCE_VOLUME_TOO_LARGE = 'source_volume_too_large' + SOURCE_VOLUME_UNAVAILABLE = 'source_volume_unavailable' -class ListPrivatePathServiceGatewayEndpointGatewayBindingsEnums: + +class BackupPolicyPatch: """ - Enums for list_private_path_service_gateway_endpoint_gateway_bindings parameters. + BackupPolicyPatch. + + :param List[str] included_content: (optional) The included content for backups + created using this policy: + - `boot_volume`: Include the instance's boot volume. + - `data_volumes`: Include the instance's data volumes. + :param List[str] match_user_tags: (optional) The user tags this backup policy + will apply to (replacing any existing tags). Resources that have both a matching + user tag and a matching type will be subject to the backup policy. + :param str name: (optional) The name for this backup policy. The name must not + be used by another backup policy in the region. """ - class Status(str, Enum): + def __init__( + self, + *, + included_content: Optional[List[str]] = None, + match_user_tags: Optional[List[str]] = None, + name: Optional[str] = None, + ) -> None: """ - Filters the collection to endpoint gateway bindings with a `status` property - matching the specified value. + Initialize a BackupPolicyPatch object. + + :param List[str] included_content: (optional) The included content for + backups created using this policy: + - `boot_volume`: Include the instance's boot volume. + - `data_volumes`: Include the instance's data volumes. + :param List[str] match_user_tags: (optional) The user tags this backup + policy will apply to (replacing any existing tags). Resources that have + both a matching user tag and a matching type will be subject to the backup + policy. + :param str name: (optional) The name for this backup policy. The name must + not be used by another backup policy in the region. """ + self.included_content = included_content + self.match_user_tags = match_user_tags + self.name = name - ABANDONED = 'abandoned' - DENIED = 'denied' - EXPIRED = 'expired' - PENDING = 'pending' - PERMITTED = 'permitted' + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPatch': + """Initialize a BackupPolicyPatch object from a json dictionary.""" + args = {} + if (included_content := _dict.get('included_content')) is not None: + args['included_content'] = included_content + if (match_user_tags := _dict.get('match_user_tags')) is not None: + args['match_user_tags'] = match_user_tags + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPatch 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, 'included_content') and self.included_content is not None: + _dict['included_content'] = self.included_content + if hasattr(self, 'match_user_tags') and self.match_user_tags is not None: + _dict['match_user_tags'] = self.match_user_tags + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict -############################################################################## -# Models -############################################################################## + 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 BackupPolicyPatch object.""" + return json.dumps(self.to_dict(), indent=2) -class AccountIdentity: - """ - Identifies an account by a unique property. + def __eq__(self, other: 'BackupPolicyPatch') -> 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: 'BackupPolicyPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - def __init__( - self, - ) -> None: + class IncludedContentEnum(str, Enum): """ - Initialize a AccountIdentity object. - + An item to include. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['AccountIdentityById']) - ) - raise Exception(msg) + + BOOT_VOLUME = 'boot_volume' + DATA_VOLUMES = 'data_volumes' -class AccountReference: + +class BackupPolicyPlan: """ - AccountReference. + BackupPolicyPlan. - :param str id: The unique identifier for this account. + :param bool active: Indicates whether the plan is active. + :param List[str] attach_user_tags: The user tags to attach to backups + (snapshots) created by this plan. + :param BackupPolicyPlanClonePolicy clone_policy: + :param bool copy_user_tags: Indicates whether to copy the source's user tags to + the created backups (snapshots). + :param datetime created_at: The date and time that the backup policy plan was + created. + :param str cron_spec: The cron specification for the backup schedule. The backup + policy jobs + (which create and delete backups for this plan) will not start until this time, + and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param BackupPolicyPlanDeletionTrigger deletion_trigger: + :param str href: The URL for this backup policy plan. + :param str id: The unique identifier for this backup policy plan. + :param str lifecycle_state: The lifecycle state of this backup policy plan. + :param str name: The name for this backup policy plan. The name is unique across + all plans in the backup policy. + :param List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The + policies for additional backups in remote regions. :param str resource_type: The resource type. """ def __init__( self, + active: bool, + attach_user_tags: List[str], + clone_policy: 'BackupPolicyPlanClonePolicy', + copy_user_tags: bool, + created_at: datetime, + cron_spec: str, + deletion_trigger: 'BackupPolicyPlanDeletionTrigger', + href: str, id: str, + lifecycle_state: str, + name: str, + remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicy'], resource_type: str, ) -> None: """ - Initialize a AccountReference object. + Initialize a BackupPolicyPlan object. - :param str id: The unique identifier for this account. + :param bool active: Indicates whether the plan is active. + :param List[str] attach_user_tags: The user tags to attach to backups + (snapshots) created by this plan. + :param BackupPolicyPlanClonePolicy clone_policy: + :param bool copy_user_tags: Indicates whether to copy the source's user + tags to the created backups (snapshots). + :param datetime created_at: The date and time that the backup policy plan + was created. + :param str cron_spec: The cron specification for the backup schedule. The + backup policy jobs + (which create and delete backups for this plan) will not start until this + time, and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param BackupPolicyPlanDeletionTrigger deletion_trigger: + :param str href: The URL for this backup policy plan. + :param str id: The unique identifier for this backup policy plan. + :param str lifecycle_state: The lifecycle state of this backup policy plan. + :param str name: The name for this backup policy plan. The name is unique + across all plans in the backup policy. + :param List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The + policies for additional backups in remote regions. :param str resource_type: The resource type. """ + self.active = active + self.attach_user_tags = attach_user_tags + self.clone_policy = clone_policy + self.copy_user_tags = copy_user_tags + self.created_at = created_at + self.cron_spec = cron_spec + self.deletion_trigger = deletion_trigger + self.href = href self.id = id + self.lifecycle_state = lifecycle_state + self.name = name + self.remote_region_policies = remote_region_policies self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountReference': - """Initialize a AccountReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlan': + """Initialize a BackupPolicyPlan object from a json dictionary.""" args = {} + if (active := _dict.get('active')) is not None: + args['active'] = active + else: + raise ValueError('Required property \'active\' not present in BackupPolicyPlan JSON') + if (attach_user_tags := _dict.get('attach_user_tags')) is not None: + args['attach_user_tags'] = attach_user_tags + else: + raise ValueError('Required property \'attach_user_tags\' not present in BackupPolicyPlan JSON') + if (clone_policy := _dict.get('clone_policy')) is not None: + args['clone_policy'] = BackupPolicyPlanClonePolicy.from_dict(clone_policy) + else: + raise ValueError('Required property \'clone_policy\' not present in BackupPolicyPlan JSON') + if (copy_user_tags := _dict.get('copy_user_tags')) is not None: + args['copy_user_tags'] = copy_user_tags + else: + raise ValueError('Required property \'copy_user_tags\' not present in BackupPolicyPlan JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in BackupPolicyPlan JSON') + if (cron_spec := _dict.get('cron_spec')) is not None: + args['cron_spec'] = cron_spec + else: + raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlan JSON') + if (deletion_trigger := _dict.get('deletion_trigger')) is not None: + args['deletion_trigger'] = BackupPolicyPlanDeletionTrigger.from_dict(deletion_trigger) + else: + raise ValueError('Required property \'deletion_trigger\' not present in BackupPolicyPlan JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in BackupPolicyPlan JSON') if (id := _dict.get('id')) is not None: args['id'] = id else: - raise ValueError('Required property \'id\' not present in AccountReference JSON') + raise ValueError('Required property \'id\' not present in BackupPolicyPlan JSON') + if (lifecycle_state := _dict.get('lifecycle_state')) is not None: + args['lifecycle_state'] = lifecycle_state + else: + raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicyPlan JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in BackupPolicyPlan JSON') + if (remote_region_policies := _dict.get('remote_region_policies')) is not None: + args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicy.from_dict(v) for v in remote_region_policies] + else: + raise ValueError('Required property \'remote_region_policies\' not present in BackupPolicyPlan JSON') if (resource_type := _dict.get('resource_type')) is not None: args['resource_type'] = resource_type else: - raise ValueError('Required property \'resource_type\' not present in AccountReference JSON') + raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlan JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountReference object from a json dictionary.""" + """Initialize a BackupPolicyPlan 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, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: + _dict['attach_user_tags'] = self.attach_user_tags + if hasattr(self, 'clone_policy') and self.clone_policy is not None: + if isinstance(self.clone_policy, dict): + _dict['clone_policy'] = self.clone_policy + else: + _dict['clone_policy'] = self.clone_policy.to_dict() + if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: + _dict['copy_user_tags'] = self.copy_user_tags + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_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 + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: + remote_region_policies_list = [] + for v in self.remote_region_policies: + if isinstance(v, dict): + remote_region_policies_list.append(v) + else: + remote_region_policies_list.append(v.to_dict()) + _dict['remote_region_policies'] = remote_region_policies_list if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type return _dict @@ -26354,149 +29881,256 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountReference object.""" + """Return a `str` version of this BackupPolicyPlan object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountReference') -> bool: + def __eq__(self, other: 'BackupPolicyPlan') -> 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: 'AccountReference') -> bool: + def __ne__(self, other: 'BackupPolicyPlan') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of this backup policy plan. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + class ResourceTypeEnum(str, Enum): """ The resource type. """ - ACCOUNT = 'account' + BACKUP_POLICY_PLAN = 'backup_policy_plan' -class AddressPrefix: +class BackupPolicyPlanClonePolicy: """ - AddressPrefix. + BackupPolicyPlanClonePolicy. - :param str cidr: The CIDR block for this prefix. - :param datetime created_at: The date and time that the prefix was created. - :param bool has_subnets: Indicates whether subnets exist with addresses from - this prefix. - :param str href: The URL for this address prefix. - :param str id: The unique identifier for this address prefix. - :param bool is_default: Indicates whether this is the default prefix for this - zone in this VPC. If a default prefix was automatically created when the VPC was - created, the prefix is automatically named using a hyphenated list of - randomly-selected words, but may be changed. - :param str name: The name for this address prefix. The name must not be used by - another address prefix for the VPC. - :param ZoneReference zone: The zone this address prefix resides in. + :param int max_snapshots: The maximum number of recent snapshots (per source) + that will keep clones. + :param List[ZoneReference] zones: The zone this backup policy plan will create + snapshot clones in. """ def __init__( self, - cidr: str, - created_at: datetime, - has_subnets: bool, - href: str, - id: str, - is_default: bool, - name: str, - zone: 'ZoneReference', + max_snapshots: int, + zones: List['ZoneReference'], ) -> None: """ - Initialize a AddressPrefix object. + Initialize a BackupPolicyPlanClonePolicy object. - :param str cidr: The CIDR block for this prefix. - :param datetime created_at: The date and time that the prefix was created. - :param bool has_subnets: Indicates whether subnets exist with addresses - from this prefix. - :param str href: The URL for this address prefix. - :param str id: The unique identifier for this address prefix. - :param bool is_default: Indicates whether this is the default prefix for - this zone in this VPC. If a default prefix was automatically created when - the VPC was created, the prefix is automatically named using a hyphenated - list of randomly-selected words, but may be changed. - :param str name: The name for this address prefix. The name must not be - used by another address prefix for the VPC. - :param ZoneReference zone: The zone this address prefix resides in. + :param int max_snapshots: The maximum number of recent snapshots (per + source) that will keep clones. + :param List[ZoneReference] zones: The zone this backup policy plan will + create snapshot clones in. """ - self.cidr = cidr - self.created_at = created_at - self.has_subnets = has_subnets - self.href = href - self.id = id - self.is_default = is_default - self.name = name - self.zone = zone + self.max_snapshots = max_snapshots + self.zones = zones @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefix': - """Initialize a AddressPrefix object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicy': + """Initialize a BackupPolicyPlanClonePolicy object from a json dictionary.""" args = {} - if (cidr := _dict.get('cidr')) is not None: - args['cidr'] = cidr - else: - raise ValueError('Required property \'cidr\' not present in AddressPrefix JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - else: - raise ValueError('Required property \'created_at\' not present in AddressPrefix JSON') - if (has_subnets := _dict.get('has_subnets')) is not None: - args['has_subnets'] = has_subnets - else: - raise ValueError('Required property \'has_subnets\' not present in AddressPrefix JSON') - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in AddressPrefix JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in AddressPrefix JSON') - if (is_default := _dict.get('is_default')) is not None: - args['is_default'] = is_default + if (max_snapshots := _dict.get('max_snapshots')) is not None: + args['max_snapshots'] = max_snapshots else: - raise ValueError('Required property \'is_default\' not present in AddressPrefix JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name + raise ValueError('Required property \'max_snapshots\' not present in BackupPolicyPlanClonePolicy JSON') + if (zones := _dict.get('zones')) is not None: + args['zones'] = [ZoneReference.from_dict(v) for v in zones] else: - raise ValueError('Required property \'name\' not present in AddressPrefix JSON') - if (zone := _dict.get('zone')) is not None: - args['zone'] = ZoneReference.from_dict(zone) + raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicy JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanClonePolicy 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, 'max_snapshots') and self.max_snapshots is not None: + _dict['max_snapshots'] = self.max_snapshots + 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 BackupPolicyPlanClonePolicy object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanClonePolicy') -> 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: 'BackupPolicyPlanClonePolicy') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanClonePolicyPatch: + """ + BackupPolicyPlanClonePolicyPatch. + + :param int max_snapshots: (optional) The maximum number of recent snapshots (per + source) that will keep clones. + :param List[ZoneIdentity] zones: (optional) The zones this backup policy plan + will create snapshot clones in. Updating this value does not change the clones + for snapshots that have already been created by this plan. + """ + + def __init__( + self, + *, + max_snapshots: Optional[int] = None, + zones: Optional[List['ZoneIdentity']] = None, + ) -> None: + """ + Initialize a BackupPolicyPlanClonePolicyPatch object. + + :param int max_snapshots: (optional) The maximum number of recent snapshots + (per source) that will keep clones. + :param List[ZoneIdentity] zones: (optional) The zones this backup policy + plan will create snapshot clones in. Updating this value does not change + the clones for snapshots that have already been created by this plan. + """ + self.max_snapshots = max_snapshots + self.zones = zones + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPatch': + """Initialize a BackupPolicyPlanClonePolicyPatch object from a json dictionary.""" + args = {} + if (max_snapshots := _dict.get('max_snapshots')) is not None: + args['max_snapshots'] = max_snapshots + if (zones := _dict.get('zones')) is not None: + args['zones'] = zones + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanClonePolicyPatch 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, 'max_snapshots') and self.max_snapshots is not None: + _dict['max_snapshots'] = self.max_snapshots + 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 BackupPolicyPlanClonePolicyPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanClonePolicyPatch') -> 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: 'BackupPolicyPlanClonePolicyPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanClonePolicyPrototype: + """ + BackupPolicyPlanClonePolicyPrototype. + + :param int max_snapshots: (optional) The maximum number of recent snapshots (per + source) that will keep clones. + :param List[ZoneIdentity] zones: The zone this backup policy plan will create + snapshot clones in. + """ + + def __init__( + self, + zones: List['ZoneIdentity'], + *, + max_snapshots: Optional[int] = None, + ) -> None: + """ + Initialize a BackupPolicyPlanClonePolicyPrototype object. + + :param List[ZoneIdentity] zones: The zone this backup policy plan will + create snapshot clones in. + :param int max_snapshots: (optional) The maximum number of recent snapshots + (per source) that will keep clones. + """ + self.max_snapshots = max_snapshots + self.zones = zones + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPrototype': + """Initialize a BackupPolicyPlanClonePolicyPrototype object from a json dictionary.""" + args = {} + if (max_snapshots := _dict.get('max_snapshots')) is not None: + args['max_snapshots'] = max_snapshots + if (zones := _dict.get('zones')) is not None: + args['zones'] = zones else: - raise ValueError('Required property \'zone\' not present in AddressPrefix JSON') + raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicyPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefix object from a json dictionary.""" + """Initialize a BackupPolicyPlanClonePolicyPrototype 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, 'cidr') and self.cidr is not None: - _dict['cidr'] = self.cidr - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'has_subnets') and self.has_subnets is not None: - _dict['has_subnets'] = self.has_subnets - 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 - if hasattr(self, 'is_default') and self.is_default is not None: - _dict['is_default'] = self.is_default - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - 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() + if hasattr(self, 'max_snapshots') and self.max_snapshots is not None: + _dict['max_snapshots'] = self.max_snapshots + 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): @@ -26504,105 +30138,93 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefix object.""" + """Return a `str` version of this BackupPolicyPlanClonePolicyPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefix') -> bool: + def __eq__(self, other: 'BackupPolicyPlanClonePolicyPrototype') -> 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: 'AddressPrefix') -> bool: + def __ne__(self, other: 'BackupPolicyPlanClonePolicyPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AddressPrefixCollection: +class BackupPolicyPlanCollection: """ - AddressPrefixCollection. + BackupPolicyPlanCollection. - :param List[AddressPrefix] address_prefixes: A page of address prefixes for the - VPC. - :param AddressPrefixCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param AddressPrefixCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. + :param List[BackupPolicyPlan] plans: A page of plans for the backup policy. :param int total_count: The total number of resources across all pages. """ def __init__( self, - address_prefixes: List['AddressPrefix'], - first: 'AddressPrefixCollectionFirst', + first: 'PageLink', limit: int, + plans: List['BackupPolicyPlan'], total_count: int, *, - next: Optional['AddressPrefixCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a AddressPrefixCollection object. + Initialize a BackupPolicyPlanCollection object. - :param List[AddressPrefix] address_prefixes: A page of address prefixes for - the VPC. - :param AddressPrefixCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. + :param List[BackupPolicyPlan] plans: A page of plans for the backup policy. :param int total_count: The total number of resources across all pages. - :param AddressPrefixCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ - self.address_prefixes = address_prefixes self.first = first self.limit = limit self.next = next + self.plans = plans self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollection': - """Initialize a AddressPrefixCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanCollection': + """Initialize a BackupPolicyPlanCollection object from a json dictionary.""" args = {} - if (address_prefixes := _dict.get('address_prefixes')) is not None: - args['address_prefixes'] = [AddressPrefix.from_dict(v) for v in address_prefixes] - else: - raise ValueError('Required property \'address_prefixes\' not present in AddressPrefixCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = AddressPrefixCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'first\' not present in AddressPrefixCollection JSON') + raise ValueError('Required property \'first\' not present in BackupPolicyPlanCollection JSON') if (limit := _dict.get('limit')) is not None: args['limit'] = limit else: - raise ValueError('Required property \'limit\' not present in AddressPrefixCollection JSON') + raise ValueError('Required property \'limit\' not present in BackupPolicyPlanCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = AddressPrefixCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) + if (plans := _dict.get('plans')) is not None: + args['plans'] = [BackupPolicyPlan.from_dict(v) for v in plans] + else: + raise ValueError('Required property \'plans\' not present in BackupPolicyPlanCollection JSON') if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: - raise ValueError('Required property \'total_count\' not present in AddressPrefixCollection JSON') + raise ValueError('Required property \'total_count\' not present in BackupPolicyPlanCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefixCollection object from a json dictionary.""" + """Initialize a BackupPolicyPlanCollection 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, 'address_prefixes') and self.address_prefixes is not None: - address_prefixes_list = [] - for v in self.address_prefixes: - if isinstance(v, dict): - address_prefixes_list.append(v) - else: - address_prefixes_list.append(v.to_dict()) - _dict['address_prefixes'] = address_prefixes_list if hasattr(self, 'first') and self.first is not None: if isinstance(self.first, dict): _dict['first'] = self.first @@ -26615,6 +30237,14 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() + if hasattr(self, 'plans') and self.plans is not None: + plans_list = [] + for v in self.plans: + if isinstance(v, dict): + plans_list.append(v) + else: + plans_list.append(v.to_dict()) + _dict['plans'] = plans_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -26624,58 +30254,71 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefixCollection object.""" + """Return a `str` version of this BackupPolicyPlanCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefixCollection') -> bool: + def __eq__(self, other: 'BackupPolicyPlanCollection') -> 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: 'AddressPrefixCollection') -> bool: + def __ne__(self, other: 'BackupPolicyPlanCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AddressPrefixCollectionFirst: +class BackupPolicyPlanDeletionTrigger: """ - A link to the first page of resources. + BackupPolicyPlanDeletionTrigger. - :param str href: The URL for a page of resources. + :param int delete_after: The maximum number of days to keep each backup after + creation. + :param int delete_over_count: (optional) The maximum number of recent backups to + keep. If absent, there is no maximum. """ def __init__( self, - href: str, + delete_after: int, + *, + delete_over_count: Optional[int] = None, ) -> None: """ - Initialize a AddressPrefixCollectionFirst object. + Initialize a BackupPolicyPlanDeletionTrigger object. - :param str href: The URL for a page of resources. + :param int delete_after: The maximum number of days to keep each backup + after creation. + :param int delete_over_count: (optional) The maximum number of recent + backups to keep. If absent, there is no maximum. """ - self.href = href + self.delete_after = delete_after + self.delete_over_count = delete_over_count @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollectionFirst': - """Initialize a AddressPrefixCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTrigger': + """Initialize a BackupPolicyPlanDeletionTrigger object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (delete_after := _dict.get('delete_after')) is not None: + args['delete_after'] = delete_after else: - raise ValueError('Required property \'href\' not present in AddressPrefixCollectionFirst JSON') + raise ValueError('Required property \'delete_after\' not present in BackupPolicyPlanDeletionTrigger JSON') + if (delete_over_count := _dict.get('delete_over_count')) is not None: + args['delete_over_count'] = delete_over_count return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefixCollectionFirst object from a json dictionary.""" + """Initialize a BackupPolicyPlanDeletionTrigger 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, 'delete_after') and self.delete_after is not None: + _dict['delete_after'] = self.delete_after + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count return _dict def _to_dict(self): @@ -26683,59 +30326,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefixCollectionFirst object.""" + """Return a `str` version of this BackupPolicyPlanDeletionTrigger object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefixCollectionFirst') -> bool: + def __eq__(self, other: 'BackupPolicyPlanDeletionTrigger') -> 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: 'AddressPrefixCollectionFirst') -> bool: + def __ne__(self, other: 'BackupPolicyPlanDeletionTrigger') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AddressPrefixCollectionNext: +class BackupPolicyPlanDeletionTriggerPatch: """ - A link to the next page of resources. This property is present for all pages except - the last page. + BackupPolicyPlanDeletionTriggerPatch. - :param str href: The URL for a page of resources. + :param int delete_after: (optional) The maximum number of days to keep each + backup after creation. + :param int delete_over_count: (optional) The maximum number of recent backups to + keep. Specify `null` to remove any existing maximum. """ def __init__( self, - href: str, + *, + delete_after: Optional[int] = None, + delete_over_count: Optional[int] = None, ) -> None: """ - Initialize a AddressPrefixCollectionNext object. + Initialize a BackupPolicyPlanDeletionTriggerPatch object. - :param str href: The URL for a page of resources. + :param int delete_after: (optional) The maximum number of days to keep each + backup after creation. + :param int delete_over_count: (optional) The maximum number of recent + backups to keep. Specify `null` to remove any existing maximum. """ - self.href = href + self.delete_after = delete_after + self.delete_over_count = delete_over_count @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollectionNext': - """Initialize a AddressPrefixCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPatch': + """Initialize a BackupPolicyPlanDeletionTriggerPatch object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in AddressPrefixCollectionNext JSON') + if (delete_after := _dict.get('delete_after')) is not None: + args['delete_after'] = delete_after + if (delete_over_count := _dict.get('delete_over_count')) is not None: + args['delete_over_count'] = delete_over_count return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefixCollectionNext object from a json dictionary.""" + """Initialize a BackupPolicyPlanDeletionTriggerPatch 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, 'delete_after') and self.delete_after is not None: + _dict['delete_after'] = self.delete_after + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count return _dict def _to_dict(self): @@ -26743,75 +30396,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefixCollectionNext object.""" + """Return a `str` version of this BackupPolicyPlanDeletionTriggerPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefixCollectionNext') -> bool: + def __eq__(self, other: 'BackupPolicyPlanDeletionTriggerPatch') -> 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: 'AddressPrefixCollectionNext') -> bool: + def __ne__(self, other: 'BackupPolicyPlanDeletionTriggerPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AddressPrefixPatch: +class BackupPolicyPlanDeletionTriggerPrototype: """ - AddressPrefixPatch. + BackupPolicyPlanDeletionTriggerPrototype. - :param bool is_default: (optional) Indicates whether this is the default prefix - for this zone in this VPC. Updating to true makes this prefix the default prefix - for this zone in this VPC, provided the VPC currently has no default address - prefix for this zone. Updating to false removes the default prefix for this zone - in this VPC. - :param str name: (optional) The name for this address prefix. The name must not - be used by another address prefix for the VPC. + :param int delete_after: (optional) The maximum number of days to keep each + backup after creation. + :param int delete_over_count: (optional) The maximum number of recent backups to + keep. If unspecified, there will be no maximum. """ def __init__( self, *, - is_default: Optional[bool] = None, - name: Optional[str] = None, + delete_after: Optional[int] = None, + delete_over_count: Optional[int] = None, ) -> None: """ - Initialize a AddressPrefixPatch object. + Initialize a BackupPolicyPlanDeletionTriggerPrototype object. - :param bool is_default: (optional) Indicates whether this is the default - prefix for this zone in this VPC. Updating to true makes this prefix the - default prefix for this zone in this VPC, provided the VPC currently has no - default address prefix for this zone. Updating to false removes the default - prefix for this zone in this VPC. - :param str name: (optional) The name for this address prefix. The name must - not be used by another address prefix for the VPC. + :param int delete_after: (optional) The maximum number of days to keep each + backup after creation. + :param int delete_over_count: (optional) The maximum number of recent + backups to keep. If unspecified, there will be no maximum. """ - self.is_default = is_default - self.name = name + self.delete_after = delete_after + self.delete_over_count = delete_over_count @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefixPatch': - """Initialize a AddressPrefixPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPrototype': + """Initialize a BackupPolicyPlanDeletionTriggerPrototype object from a json dictionary.""" args = {} - if (is_default := _dict.get('is_default')) is not None: - args['is_default'] = is_default - if (name := _dict.get('name')) is not None: - args['name'] = name + if (delete_after := _dict.get('delete_after')) is not None: + args['delete_after'] = delete_after + if (delete_over_count := _dict.get('delete_over_count')) is not None: + args['delete_over_count'] = delete_over_count return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefixPatch object from a json dictionary.""" + """Initialize a BackupPolicyPlanDeletionTriggerPrototype 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, 'is_default') and self.is_default is not None: - _dict['is_default'] = self.is_default - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'delete_after') and self.delete_after is not None: + _dict['delete_after'] = self.delete_after + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count return _dict def _to_dict(self): @@ -26819,282 +30466,421 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefixPatch object.""" + """Return a `str` version of this BackupPolicyPlanDeletionTriggerPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefixPatch') -> bool: + def __eq__(self, other: 'BackupPolicyPlanDeletionTriggerPrototype') -> 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: 'AddressPrefixPatch') -> bool: + def __ne__(self, other: 'BackupPolicyPlanDeletionTriggerPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicy: +class BackupPolicyPlanPatch: """ - BackupPolicy. + BackupPolicyPlanPatch. - :param datetime created_at: The date and time that the backup policy was - created. - :param str crn: The CRN for this backup policy. - :param List[BackupPolicyHealthReason] health_reasons: The reasons for the - current `health_state` (if any). - :param str health_state: The health of this resource: - - `ok`: No abnormal behavior detected - - `degraded`: Experiencing compromised performance, capacity, or connectivity - - `faulted`: Completely unreachable, inoperative, or otherwise entirely - incapacitated - - `inapplicable`: The health state does not apply because of the current - lifecycle - state. A resource with a lifecycle state of `failed` or `deleting` will have - a - health state of `inapplicable`. A `pending` resource may also have this - state. - :param str href: The URL for this backup policy. - :param str id: The unique identifier for this backup policy. - :param datetime last_job_completed_at: (optional) The date and time that the - most recent job for this backup policy completed. - If absent, no job has yet completed for this backup policy. - :param str lifecycle_state: The lifecycle state of the backup policy. - :param str match_resource_type: The resource type this backup policy applies to. - Resources that have both a matching type and a matching user tag will be subject - to the backup policy. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param List[str] match_user_tags: The user tags this backup policy applies to. - Resources that have both a matching user tag and a matching type will be subject - to the backup policy. - :param str name: The name for this backup policy. The name is unique across all - backup policies in the region. - :param List[BackupPolicyPlanReference] plans: The plans for the backup policy. - :param ResourceGroupReference resource_group: The resource group for this backup - policy. - :param str resource_type: The resource type. - :param BackupPolicyScope scope: The scope for this backup policy. + :param bool active: (optional) Indicates whether the plan is active. + :param List[str] attach_user_tags: (optional) The user tags to attach to backups + (snapshots) created by this plan. Updating this value does not change the user + tags for backups that have already been created by this plan. + :param BackupPolicyPlanClonePolicyPatch clone_policy: (optional) + :param bool copy_user_tags: (optional) Indicates whether to copy the source's + user tags to the created backups (snapshots). + :param str cron_spec: (optional) The cron specification for the backup schedule. + The backup policy jobs + (which create and delete backups for this plan) will not start until this time, + and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) + :param str name: (optional) The name for this backup policy plan. The name must + not be used by another plan for the backup policy. + :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies: + (optional) The policies for additional backups in remote regions (replacing any + existing policies). """ def __init__( self, - created_at: datetime, - crn: str, - health_reasons: List['BackupPolicyHealthReason'], - health_state: str, - href: str, - id: str, - lifecycle_state: str, - match_resource_type: str, - match_user_tags: List[str], - name: str, - plans: List['BackupPolicyPlanReference'], - resource_group: 'ResourceGroupReference', - resource_type: str, - scope: 'BackupPolicyScope', *, - last_job_completed_at: Optional[datetime] = None, + active: Optional[bool] = None, + attach_user_tags: Optional[List[str]] = None, + clone_policy: Optional['BackupPolicyPlanClonePolicyPatch'] = None, + copy_user_tags: Optional[bool] = None, + cron_spec: Optional[str] = None, + deletion_trigger: Optional['BackupPolicyPlanDeletionTriggerPatch'] = None, + name: Optional[str] = None, + remote_region_policies: Optional[List['BackupPolicyPlanRemoteRegionPolicyPrototype']] = None, ) -> None: """ - Initialize a BackupPolicy object. + Initialize a BackupPolicyPlanPatch object. - :param datetime created_at: The date and time that the backup policy was - created. - :param str crn: The CRN for this backup policy. - :param List[BackupPolicyHealthReason] health_reasons: The reasons for the - current `health_state` (if any). - :param str health_state: The health of this resource: - - `ok`: No abnormal behavior detected - - `degraded`: Experiencing compromised performance, capacity, or - connectivity - - `faulted`: Completely unreachable, inoperative, or otherwise entirely - incapacitated - - `inapplicable`: The health state does not apply because of the current - lifecycle - state. A resource with a lifecycle state of `failed` or `deleting` will - have a - health state of `inapplicable`. A `pending` resource may also have this - state. - :param str href: The URL for this backup policy. - :param str id: The unique identifier for this backup policy. - :param str lifecycle_state: The lifecycle state of the backup policy. - :param str match_resource_type: The resource type this backup policy - applies to. Resources that have both a matching type and a matching user - tag will be subject to the backup policy. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param List[str] match_user_tags: The user tags this backup policy applies - to. Resources that have both a matching user tag and a matching type will - be subject to the backup policy. - :param str name: The name for this backup policy. The name is unique across - all backup policies in the region. - :param List[BackupPolicyPlanReference] plans: The plans for the backup - policy. - :param ResourceGroupReference resource_group: The resource group for this - backup policy. - :param str resource_type: The resource type. - :param BackupPolicyScope scope: The scope for this backup policy. - :param datetime last_job_completed_at: (optional) The date and time that - the most recent job for this backup policy completed. - If absent, no job has yet completed for this backup policy. + :param bool active: (optional) Indicates whether the plan is active. + :param List[str] attach_user_tags: (optional) The user tags to attach to + backups (snapshots) created by this plan. Updating this value does not + change the user tags for backups that have already been created by this + plan. + :param BackupPolicyPlanClonePolicyPatch clone_policy: (optional) + :param bool copy_user_tags: (optional) Indicates whether to copy the + source's user tags to the created backups (snapshots). + :param str cron_spec: (optional) The cron specification for the backup + schedule. The backup policy jobs + (which create and delete backups for this plan) will not start until this + time, and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) + :param str name: (optional) The name for this backup policy plan. The name + must not be used by another plan for the backup policy. + :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] + remote_region_policies: (optional) The policies for additional backups in + remote regions (replacing any existing policies). """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BackupPolicyMatchResourceTypeInstance', 'BackupPolicyMatchResourceTypeVolume']) - ) - raise Exception(msg) + self.active = active + self.attach_user_tags = attach_user_tags + self.clone_policy = clone_policy + self.copy_user_tags = copy_user_tags + self.cron_spec = cron_spec + self.deletion_trigger = deletion_trigger + self.name = name + self.remote_region_policies = remote_region_policies - class HealthStateEnum(str, Enum): - """ - The health of this resource: - - `ok`: No abnormal behavior detected - - `degraded`: Experiencing compromised performance, capacity, or connectivity - - `faulted`: Completely unreachable, inoperative, or otherwise entirely - incapacitated - - `inapplicable`: The health state does not apply because of the current lifecycle - state. A resource with a lifecycle state of `failed` or `deleting` will have a - health state of `inapplicable`. A `pending` resource may also have this state. - """ + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPatch': + """Initialize a BackupPolicyPlanPatch object from a json dictionary.""" + args = {} + if (active := _dict.get('active')) is not None: + args['active'] = active + if (attach_user_tags := _dict.get('attach_user_tags')) is not None: + args['attach_user_tags'] = attach_user_tags + if (clone_policy := _dict.get('clone_policy')) is not None: + args['clone_policy'] = BackupPolicyPlanClonePolicyPatch.from_dict(clone_policy) + if (copy_user_tags := _dict.get('copy_user_tags')) is not None: + args['copy_user_tags'] = copy_user_tags + if (cron_spec := _dict.get('cron_spec')) is not None: + args['cron_spec'] = cron_spec + if (deletion_trigger := _dict.get('deletion_trigger')) is not None: + args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPatch.from_dict(deletion_trigger) + if (name := _dict.get('name')) is not None: + args['name'] = name + if (remote_region_policies := _dict.get('remote_region_policies')) is not None: + args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in remote_region_policies] + return cls(**args) - DEGRADED = 'degraded' - FAULTED = 'faulted' - INAPPLICABLE = 'inapplicable' - OK = 'ok' + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanPatch 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, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: + _dict['attach_user_tags'] = self.attach_user_tags + if hasattr(self, 'clone_policy') and self.clone_policy is not None: + if isinstance(self.clone_policy, dict): + _dict['clone_policy'] = self.clone_policy + else: + _dict['clone_policy'] = self.clone_policy.to_dict() + if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: + _dict['copy_user_tags'] = self.copy_user_tags + if hasattr(self, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: + remote_region_policies_list = [] + for v in self.remote_region_policies: + if isinstance(v, dict): + remote_region_policies_list.append(v) + else: + remote_region_policies_list.append(v.to_dict()) + _dict['remote_region_policies'] = remote_region_policies_list + return _dict - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the backup policy. - """ + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanPatch object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'BackupPolicyPlanPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - class MatchResourceTypeEnum(str, Enum): - """ - The resource type this backup policy applies to. Resources that have both a - matching type and a matching user tag will be subject to the backup policy. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ + def __ne__(self, other: 'BackupPolicyPlanPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - INSTANCE = 'instance' - VOLUME = 'volume' +class BackupPolicyPlanPrototype: + """ + BackupPolicyPlanPrototype. - class ResourceTypeEnum(str, Enum): + :param bool active: (optional) Indicates whether the plan is active. + :param List[str] attach_user_tags: (optional) User tags to attach to each backup + (snapshot) created by this plan. If unspecified, no user tags will be attached. + :param BackupPolicyPlanClonePolicyPrototype clone_policy: (optional) + :param bool copy_user_tags: (optional) Indicates whether to copy the source's + user tags to the created backups (snapshots). + :param str cron_spec: The cron specification for the backup schedule. The backup + policy jobs + (which create and delete backups for this plan) will not start until this time, + and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional) + :param str name: (optional) The name for this backup policy plan. The name must + not be used by another plan for the backup policy. If unspecified, the name will + be a hyphenated list of randomly-selected words. + :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies: + (optional) The policies for additional backups in remote regions. + """ + + def __init__( + self, + cron_spec: str, + *, + active: Optional[bool] = None, + attach_user_tags: Optional[List[str]] = None, + clone_policy: Optional['BackupPolicyPlanClonePolicyPrototype'] = None, + copy_user_tags: Optional[bool] = None, + deletion_trigger: Optional['BackupPolicyPlanDeletionTriggerPrototype'] = None, + name: Optional[str] = None, + remote_region_policies: Optional[List['BackupPolicyPlanRemoteRegionPolicyPrototype']] = None, + ) -> None: """ - The resource type. + Initialize a BackupPolicyPlanPrototype object. + + :param str cron_spec: The cron specification for the backup schedule. The + backup policy jobs + (which create and delete backups for this plan) will not start until this + time, and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param bool active: (optional) Indicates whether the plan is active. + :param List[str] attach_user_tags: (optional) User tags to attach to each + backup (snapshot) created by this plan. If unspecified, no user tags will + be attached. + :param BackupPolicyPlanClonePolicyPrototype clone_policy: (optional) + :param bool copy_user_tags: (optional) Indicates whether to copy the + source's user tags to the created backups (snapshots). + :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: + (optional) + :param str name: (optional) The name for this backup policy plan. The name + must not be used by another plan for the backup policy. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] + remote_region_policies: (optional) The policies for additional backups in + remote regions. """ + self.active = active + self.attach_user_tags = attach_user_tags + self.clone_policy = clone_policy + self.copy_user_tags = copy_user_tags + self.cron_spec = cron_spec + self.deletion_trigger = deletion_trigger + self.name = name + self.remote_region_policies = remote_region_policies - BACKUP_POLICY = 'backup_policy' + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPrototype': + """Initialize a BackupPolicyPlanPrototype object from a json dictionary.""" + args = {} + if (active := _dict.get('active')) is not None: + args['active'] = active + if (attach_user_tags := _dict.get('attach_user_tags')) is not None: + args['attach_user_tags'] = attach_user_tags + if (clone_policy := _dict.get('clone_policy')) is not None: + args['clone_policy'] = BackupPolicyPlanClonePolicyPrototype.from_dict(clone_policy) + if (copy_user_tags := _dict.get('copy_user_tags')) is not None: + args['copy_user_tags'] = copy_user_tags + if (cron_spec := _dict.get('cron_spec')) is not None: + args['cron_spec'] = cron_spec + else: + raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlanPrototype JSON') + if (deletion_trigger := _dict.get('deletion_trigger')) is not None: + args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPrototype.from_dict(deletion_trigger) + if (name := _dict.get('name')) is not None: + args['name'] = name + if (remote_region_policies := _dict.get('remote_region_policies')) is not None: + args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in remote_region_policies] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanPrototype 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, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: + _dict['attach_user_tags'] = self.attach_user_tags + if hasattr(self, 'clone_policy') and self.clone_policy is not None: + if isinstance(self.clone_policy, dict): + _dict['clone_policy'] = self.clone_policy + else: + _dict['clone_policy'] = self.clone_policy.to_dict() + if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: + _dict['copy_user_tags'] = self.copy_user_tags + if hasattr(self, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: + remote_region_policies_list = [] + for v in self.remote_region_policies: + if isinstance(v, dict): + remote_region_policies_list.append(v) + else: + remote_region_policies_list.append(v.to_dict()) + _dict['remote_region_policies'] = remote_region_policies_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 BackupPolicyPlanPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanPrototype') -> 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: 'BackupPolicyPlanPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class BackupPolicyCollection: +class BackupPolicyPlanReference: """ - BackupPolicyCollection. + BackupPolicyPlanReference. - :param List[BackupPolicy] backup_policies: A page of backup policies. - :param BackupPolicyCollectionFirst first: A link to the first page of resources. - :param int limit: The maximum number of resources that can be returned by the - request. - :param BackupPolicyCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :param int total_count: The total number of resources across all pages. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. + :param str href: The URL for this backup policy plan. + :param str id: The unique identifier for this backup policy plan. + :param str name: The name for this backup policy plan. The name is unique across + all plans in the backup policy. + :param BackupPolicyPlanRemote remote: (optional) If present, this property + indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. + :param str resource_type: The resource type. """ def __init__( self, - backup_policies: List['BackupPolicy'], - first: 'BackupPolicyCollectionFirst', - limit: int, - total_count: int, + href: str, + id: str, + name: str, + resource_type: str, *, - next: Optional['BackupPolicyCollectionNext'] = None, + deleted: Optional['Deleted'] = None, + remote: Optional['BackupPolicyPlanRemote'] = None, ) -> None: """ - Initialize a BackupPolicyCollection object. + Initialize a BackupPolicyPlanReference object. - :param List[BackupPolicy] backup_policies: A page of backup policies. - :param BackupPolicyCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param BackupPolicyCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. + :param str href: The URL for this backup policy plan. + :param str id: The unique identifier for this backup policy plan. + :param str name: The name for this backup policy plan. The name is unique + across all plans in the backup policy. + :param str resource_type: The resource type. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. + :param BackupPolicyPlanRemote remote: (optional) If present, this property + indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. """ - self.backup_policies = backup_policies - self.first = first - self.limit = limit - self.next = next - self.total_count = total_count + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.remote = remote + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollection': - """Initialize a BackupPolicyCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanReference': + """Initialize a BackupPolicyPlanReference object from a json dictionary.""" args = {} - if (backup_policies := _dict.get('backup_policies')) is not None: - args['backup_policies'] = backup_policies + if (deleted := _dict.get('deleted')) is not None: + args['deleted'] = Deleted.from_dict(deleted) + if (href := _dict.get('href')) is not None: + args['href'] = href else: - raise ValueError('Required property \'backup_policies\' not present in BackupPolicyCollection JSON') - if (first := _dict.get('first')) is not None: - args['first'] = BackupPolicyCollectionFirst.from_dict(first) + raise ValueError('Required property \'href\' not present in BackupPolicyPlanReference JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError('Required property \'first\' not present in BackupPolicyCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + raise ValueError('Required property \'id\' not present in BackupPolicyPlanReference JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name else: - raise ValueError('Required property \'limit\' not present in BackupPolicyCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = BackupPolicyCollectionNext.from_dict(next) - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count + raise ValueError('Required property \'name\' not present in BackupPolicyPlanReference JSON') + if (remote := _dict.get('remote')) is not None: + args['remote'] = BackupPolicyPlanRemote.from_dict(remote) + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type else: - raise ValueError('Required property \'total_count\' not present in BackupPolicyCollection JSON') + raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlanReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyCollection object from a json dictionary.""" + """Initialize a BackupPolicyPlanReference 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, 'backup_policies') and self.backup_policies is not None: - backup_policies_list = [] - for v in self.backup_policies: - if isinstance(v, dict): - backup_policies_list.append(v) - else: - backup_policies_list.append(v.to_dict()) - _dict['backup_policies'] = backup_policies_list - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next + _dict['deleted'] = self.deleted.to_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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -27102,58 +30888,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyCollection object.""" + """Return a `str` version of this BackupPolicyPlanReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyCollection') -> bool: + def __eq__(self, other: 'BackupPolicyPlanReference') -> 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: 'BackupPolicyCollection') -> bool: + def __ne__(self, other: 'BackupPolicyPlanReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BACKUP_POLICY_PLAN = 'backup_policy_plan' + + -class BackupPolicyCollectionFirst: +class BackupPolicyPlanRemote: """ - A link to the first page of resources. + If present, this property indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. - :param str href: The URL for a page of resources. + :param RegionReference region: (optional) If present, this property indicates + that the referenced resource is remote to this + region, and identifies the native region. """ def __init__( self, - href: str, + *, + region: Optional['RegionReference'] = None, ) -> None: """ - Initialize a BackupPolicyCollectionFirst object. + Initialize a BackupPolicyPlanRemote object. - :param str href: The URL for a page of resources. + :param RegionReference region: (optional) If present, this property + indicates that the referenced resource is remote to this + region, and identifies the native region. """ - self.href = href + self.region = region @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollectionFirst': - """Initialize a BackupPolicyCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemote': + """Initialize a BackupPolicyPlanRemote object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BackupPolicyCollectionFirst JSON') + if (region := _dict.get('region')) is not None: + args['region'] = RegionReference.from_dict(region) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyCollectionFirst object from a json dictionary.""" + """Initialize a BackupPolicyPlanRemote 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, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() return _dict def _to_dict(self): @@ -27161,59 +30962,90 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyCollectionFirst object.""" + """Return a `str` version of this BackupPolicyPlanRemote object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyCollectionFirst') -> bool: + def __eq__(self, other: 'BackupPolicyPlanRemote') -> 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: 'BackupPolicyCollectionFirst') -> bool: + def __ne__(self, other: 'BackupPolicyPlanRemote') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyCollectionNext: +class BackupPolicyPlanRemoteRegionPolicy: """ - A link to the next page of resources. This property is present for all pages except - the last page. + BackupPolicyPlanRemoteRegionPolicy. - :param str href: The URL for a page of resources. + :param int delete_over_count: The region this backup policy plan will create + backups in. + :param EncryptionKeyReference encryption_key: The root key used to rewrap the + data encryption key for the backup (snapshot). + :param RegionReference region: The region this backup policy plan will create + backups in. """ def __init__( self, - href: str, + delete_over_count: int, + encryption_key: 'EncryptionKeyReference', + region: 'RegionReference', ) -> None: """ - Initialize a BackupPolicyCollectionNext object. + Initialize a BackupPolicyPlanRemoteRegionPolicy object. - :param str href: The URL for a page of resources. + :param int delete_over_count: The region this backup policy plan will + create backups in. + :param EncryptionKeyReference encryption_key: The root key used to rewrap + the data encryption key for the backup (snapshot). + :param RegionReference region: The region this backup policy plan will + create backups in. """ - self.href = href + self.delete_over_count = delete_over_count + self.encryption_key = encryption_key + self.region = region @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollectionNext': - """Initialize a BackupPolicyCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicy': + """Initialize a BackupPolicyPlanRemoteRegionPolicy object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (delete_over_count := _dict.get('delete_over_count')) is not None: + args['delete_over_count'] = delete_over_count + else: + raise ValueError('Required property \'delete_over_count\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') + if (encryption_key := _dict.get('encryption_key')) is not None: + args['encryption_key'] = EncryptionKeyReference.from_dict(encryption_key) + else: + raise ValueError('Required property \'encryption_key\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') + if (region := _dict.get('region')) is not None: + args['region'] = RegionReference.from_dict(region) else: - raise ValueError('Required property \'href\' not present in BackupPolicyCollectionNext JSON') + raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyCollectionNext object from a json dictionary.""" + """Initialize a BackupPolicyPlanRemoteRegionPolicy 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, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count + if hasattr(self, 'encryption_key') and self.encryption_key is not None: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() return _dict def _to_dict(self): @@ -27221,79 +31053,91 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyCollectionNext object.""" + """Return a `str` version of this BackupPolicyPlanRemoteRegionPolicy object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyCollectionNext') -> bool: + def __eq__(self, other: 'BackupPolicyPlanRemoteRegionPolicy') -> 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: 'BackupPolicyCollectionNext') -> bool: + def __ne__(self, other: 'BackupPolicyPlanRemoteRegionPolicy') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyHealthReason: +class BackupPolicyPlanRemoteRegionPolicyPrototype: """ - BackupPolicyHealthReason. + BackupPolicyPlanRemoteRegionPolicyPrototype. - :param str code: A reason code for this health state. - :param str message: An explanation of the reason for this health state. - :param str more_info: (optional) Link to documentation about the reason for this - health state. + :param int delete_over_count: (optional) The region this backup policy plan will + create backups in. + :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to + rewrap the data encryption key for the backup (snapshot). + If unspecified, the source's `encryption_key` will be used. + The specified key may be in a different account, subject to IAM policies. + :param RegionIdentity region: The region this backup policy plan will create + backups in. """ def __init__( self, - code: str, - message: str, + region: 'RegionIdentity', *, - more_info: Optional[str] = None, + delete_over_count: Optional[int] = None, + encryption_key: Optional['EncryptionKeyIdentity'] = None, ) -> None: """ - Initialize a BackupPolicyHealthReason object. + Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object. - :param str code: A reason code for this health state. - :param str message: An explanation of the reason for this health state. - :param str more_info: (optional) Link to documentation about the reason for - this health state. + :param RegionIdentity region: The region this backup policy plan will + create backups in. + :param int delete_over_count: (optional) The region this backup policy plan + will create backups in. + :param EncryptionKeyIdentity encryption_key: (optional) The root key to use + to rewrap the data encryption key for the backup (snapshot). + If unspecified, the source's `encryption_key` will be used. + The specified key may be in a different account, subject to IAM policies. """ - self.code = code - self.message = message - self.more_info = more_info + self.delete_over_count = delete_over_count + self.encryption_key = encryption_key + self.region = region @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyHealthReason': - """Initialize a BackupPolicyHealthReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicyPrototype': + """Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object from a json dictionary.""" args = {} - if (code := _dict.get('code')) is not None: - args['code'] = code - else: - raise ValueError('Required property \'code\' not present in BackupPolicyHealthReason JSON') - if (message := _dict.get('message')) is not None: - args['message'] = message + if (delete_over_count := _dict.get('delete_over_count')) is not None: + args['delete_over_count'] = delete_over_count + if (encryption_key := _dict.get('encryption_key')) is not None: + args['encryption_key'] = encryption_key + if (region := _dict.get('region')) is not None: + args['region'] = region else: - raise ValueError('Required property \'message\' not present in BackupPolicyHealthReason JSON') - if (more_info := _dict.get('more_info')) is not None: - args['more_info'] = more_info + raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicyPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyHealthReason object from a json dictionary.""" + """Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype 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, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count + if hasattr(self, 'encryption_key') and self.encryption_key is not None: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() return _dict def _to_dict(self): @@ -27301,225 +31145,547 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyHealthReason object.""" + """Return a `str` version of this BackupPolicyPlanRemoteRegionPolicyPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyHealthReason') -> 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 __eq__(self, other: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> 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: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPrototype: + """ + BackupPolicyPrototype. + + :param str match_resource_type: The resource type this backup policy will apply + to. Resources that have both a matching type and a matching user tag will be + subject to the backup policy. + :param List[str] match_user_tags: The user tags this backup policy will apply + to. Resources that have both a matching user tag and a matching type will be + subject to the backup policy. + :param str name: (optional) The name for this backup policy. The name must not + be used by another backup policy in the region. If unspecified, the name will be + a hyphenated list of randomly-selected words. + :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype objects + for backup plans to be created for this backup policy. + :param ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. + :param BackupPolicyScopePrototype scope: (optional) The scope to use for this + backup policy. + If unspecified, the policy will be scoped to the account. + """ + + def __init__( + self, + match_resource_type: str, + match_user_tags: List[str], + *, + name: Optional[str] = None, + plans: Optional[List['BackupPolicyPlanPrototype']] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, + scope: Optional['BackupPolicyScopePrototype'] = None, + ) -> None: + """ + Initialize a BackupPolicyPrototype object. + + :param str match_resource_type: The resource type this backup policy will + apply to. Resources that have both a matching type and a matching user tag + will be subject to the backup policy. + :param List[str] match_user_tags: The user tags this backup policy will + apply to. Resources that have both a matching user tag and a matching type + will be subject to the backup policy. + :param str name: (optional) The name for this backup policy. The name must + not be used by another backup policy in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype + objects for backup plans to be created for this backup policy. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. + :param BackupPolicyScopePrototype scope: (optional) The scope to use for + this backup policy. + If unspecified, the policy will be scoped to the account. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype', 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype']) + ) + raise Exception(msg) + + class MatchResourceTypeEnum(str, Enum): + """ + The resource type this backup policy will apply to. Resources that have both a + matching type and a matching user tag will be subject to the backup policy. + """ + + INSTANCE = 'instance' + VOLUME = 'volume' + + + +class BackupPolicyScope: + """ + The scope for this backup policy. - def __ne__(self, other: 'BackupPolicyHealthReason') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + """ - class CodeEnum(str, Enum): + def __init__( + self, + ) -> None: """ - A reason code for this health state. + Initialize a BackupPolicyScope object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BackupPolicyScopeEnterpriseReference', 'BackupPolicyScopeAccountReference']) + ) + raise Exception(msg) - MISSING_SERVICE_AUTHORIZATION_POLICIES = 'missing_service_authorization_policies' +class BackupPolicyScopePrototype: + """ + The scope to use for this backup policy. + If unspecified, the policy will be scoped to the account. + """ -class BackupPolicyJob: + def __init__( + self, + ) -> None: + """ + Initialize a BackupPolicyScopePrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BackupPolicyScopePrototypeEnterpriseIdentity']) + ) + raise Exception(msg) + + +class BareMetalServer: """ - BackupPolicyJob. + BareMetalServer. - :param bool auto_delete: Indicates whether this backup policy job will be - automatically deleted after it completes. At present, this is always `true`, but - may be modifiable in the future. - :param int auto_delete_after: If `auto_delete` is `true`, the days after - completion that this backup policy job will be deleted. This value may be - modifiable in the future. - :param BackupPolicyPlanReference backup_policy_plan: The backup policy plan - operated this backup policy job (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - :param datetime completed_at: (optional) The date and time that the backup - policy job was completed. - If absent, the backup policy job has not yet completed. - :param datetime created_at: The date and time that the backup policy job was - created. - :param str href: The URL for this backup policy job. - :param str id: The unique identifier for this backup policy job. - :param str job_type: The type of backup policy job. - The enumerated values for this property may + :param int bandwidth: The total bandwidth (in megabits per second) shared across + the bare metal server network attachments or bare metal server network + interfaces. + :param BareMetalServerBootTarget boot_target: The resource from which this bare + metal server is booted. + The resources supported by this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + :param BareMetalServerCPU cpu: The bare metal server CPU configuration. + :param datetime created_at: The date and time that the bare metal server was + created. + :param str crn: The CRN for this bare metal server. + :param List[BareMetalServerDisk] disks: The disks for this bare metal server, + including any disks that are associated with the + `boot_target`. + :param bool enable_secure_boot: Indicates whether secure boot is enabled. If + enabled, the image must support secure boot or the server will fail to boot. + :param BareMetalServerFirmware firmware: Firmware information for the bare metal + server. + :param str href: The URL for this bare metal server. + :param str id: The unique identifier for this bare metal server. + :param List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons for + the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the bare metal server. + :param int memory: The amount of memory, truncated to whole gibibytes. + :param str name: The name for this bare metal server. The name is unique across + all bare metal servers in the region. + :param List[BareMetalServerNetworkAttachmentReference] network_attachments: + (optional) The network attachments for this bare metal server, including the + primary network attachment. + :param List[NetworkInterfaceBareMetalServerContextReference] network_interfaces: + The network interfaces for this bare metal server, including the primary network + interface. + If this bare metal server has network attachments, each network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface. + :param BareMetalServerNetworkAttachmentReference primary_network_attachment: + (optional) The primary network attachment for this bare metal server. + :param NetworkInterfaceBareMetalServerContextReference + primary_network_interface: The primary network interface for this bare metal + server. + If this bare metal server has network attachments, this primary network + interface is + a [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of the primary network attachment and its attached virtual network interface. + :param BareMetalServerProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + for this bare metal server. + :param ResourceGroupReference resource_group: The resource group for this bare + metal server. :param str resource_type: The resource type. - :param BackupPolicyJobSource source: The source this backup was created from - (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - :param str status: The status of the backup policy job. + :param str status: The status of this bare metal server: + - `deleting`: server is undergoing deletion + - `failed`: server is failed and not usable (see `status_reasons`) + - `maintenance`: server is undergoing maintenance (not usable) + - `pending`: server is being provisioned and not yet usable + - `reinitializing`: server is reinitializing and not yet usable + - `restarting`: server is restarting and not yet usable + - `running`: server is powered on + - `starting`: server is starting and not yet usable + - `stopped`: server is powered off The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param List[BackupPolicyJobStatusReason] status_reasons: The reasons for the + :param List[BareMetalServerStatusReason] status_reasons: The reasons for the current status (if any). - :param List[SnapshotReference] target_snapshots: The snapshots operated on by - this backup policy job (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param BareMetalServerTrustedPlatformModule trusted_platform_module: + :param VPCReference vpc: The VPC this bare metal server resides in. + :param ZoneReference zone: The zone this bare metal server resides in. """ def __init__( self, - auto_delete: bool, - auto_delete_after: int, - backup_policy_plan: 'BackupPolicyPlanReference', + bandwidth: int, + boot_target: 'BareMetalServerBootTarget', + cpu: 'BareMetalServerCPU', created_at: datetime, + crn: str, + disks: List['BareMetalServerDisk'], + enable_secure_boot: bool, + firmware: 'BareMetalServerFirmware', href: str, id: str, - job_type: str, + lifecycle_reasons: List['BareMetalServerLifecycleReason'], + lifecycle_state: str, + memory: int, + name: str, + network_interfaces: List['NetworkInterfaceBareMetalServerContextReference'], + primary_network_interface: 'NetworkInterfaceBareMetalServerContextReference', + profile: 'BareMetalServerProfileReference', + resource_group: 'ResourceGroupReference', resource_type: str, - source: 'BackupPolicyJobSource', status: str, - status_reasons: List['BackupPolicyJobStatusReason'], - target_snapshots: List['SnapshotReference'], + status_reasons: List['BareMetalServerStatusReason'], + trusted_platform_module: 'BareMetalServerTrustedPlatformModule', + vpc: 'VPCReference', + zone: 'ZoneReference', *, - completed_at: Optional[datetime] = None, + network_attachments: Optional[List['BareMetalServerNetworkAttachmentReference']] = None, + primary_network_attachment: Optional['BareMetalServerNetworkAttachmentReference'] = None, ) -> None: """ - Initialize a BackupPolicyJob object. + Initialize a BareMetalServer object. - :param bool auto_delete: Indicates whether this backup policy job will be - automatically deleted after it completes. At present, this is always - `true`, but may be modifiable in the future. - :param int auto_delete_after: If `auto_delete` is `true`, the days after - completion that this backup policy job will be deleted. This value may be - modifiable in the future. - :param BackupPolicyPlanReference backup_policy_plan: The backup policy plan - operated this backup policy job (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - :param datetime created_at: The date and time that the backup policy job - was created. - :param str href: The URL for this backup policy job. - :param str id: The unique identifier for this backup policy job. - :param str job_type: The type of backup policy job. - The enumerated values for this property may + :param int bandwidth: The total bandwidth (in megabits per second) shared + across the bare metal server network attachments or bare metal server + network interfaces. + :param BareMetalServerBootTarget boot_target: The resource from which this + bare metal server is booted. + The resources supported by this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + :param BareMetalServerCPU cpu: The bare metal server CPU configuration. + :param datetime created_at: The date and time that the bare metal server + was created. + :param str crn: The CRN for this bare metal server. + :param List[BareMetalServerDisk] disks: The disks for this bare metal + server, including any disks that are associated with the + `boot_target`. + :param bool enable_secure_boot: Indicates whether secure boot is enabled. + If enabled, the image must support secure boot or the server will fail to + boot. + :param BareMetalServerFirmware firmware: Firmware information for the bare + metal server. + :param str href: The URL for this bare metal server. + :param str id: The unique identifier for this bare metal server. + :param List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons + for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the bare metal server. + :param int memory: The amount of memory, truncated to whole gibibytes. + :param str name: The name for this bare metal server. The name is unique + across all bare metal servers in the region. + :param List[NetworkInterfaceBareMetalServerContextReference] + network_interfaces: The network interfaces for this bare metal server, + including the primary network interface. + If this bare metal server has network attachments, each network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface. + :param NetworkInterfaceBareMetalServerContextReference + primary_network_interface: The primary network interface for this bare + metal server. + If this bare metal server has network attachments, this primary network + interface is + a [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of the primary network attachment and its attached virtual network + interface. + :param BareMetalServerProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + for this bare metal server. + :param ResourceGroupReference resource_group: The resource group for this + bare metal server. :param str resource_type: The resource type. - :param BackupPolicyJobSource source: The source this backup was created - from (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - :param str status: The status of the backup policy job. + :param str status: The status of this bare metal server: + - `deleting`: server is undergoing deletion + - `failed`: server is failed and not usable (see `status_reasons`) + - `maintenance`: server is undergoing maintenance (not usable) + - `pending`: server is being provisioned and not yet usable + - `reinitializing`: server is reinitializing and not yet usable + - `restarting`: server is restarting and not yet usable + - `running`: server is powered on + - `starting`: server is starting and not yet usable + - `stopped`: server is powered off The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param List[BackupPolicyJobStatusReason] status_reasons: The reasons for + :param List[BareMetalServerStatusReason] status_reasons: The reasons for the current status (if any). - :param List[SnapshotReference] target_snapshots: The snapshots operated on - by this backup policy job (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - :param datetime completed_at: (optional) The date and time that the backup - policy job was completed. - If absent, the backup policy job has not yet completed. + :param BareMetalServerTrustedPlatformModule trusted_platform_module: + :param VPCReference vpc: The VPC this bare metal server resides in. + :param ZoneReference zone: The zone this bare metal server resides in. + :param List[BareMetalServerNetworkAttachmentReference] network_attachments: + (optional) The network attachments for this bare metal server, including + the primary network attachment. + :param BareMetalServerNetworkAttachmentReference + primary_network_attachment: (optional) The primary network attachment for + this bare metal server. """ - self.auto_delete = auto_delete - self.auto_delete_after = auto_delete_after - self.backup_policy_plan = backup_policy_plan - self.completed_at = completed_at + self.bandwidth = bandwidth + self.boot_target = boot_target + self.cpu = cpu self.created_at = created_at + self.crn = crn + self.disks = disks + self.enable_secure_boot = enable_secure_boot + self.firmware = firmware self.href = href self.id = id - self.job_type = job_type + self.lifecycle_reasons = lifecycle_reasons + self.lifecycle_state = lifecycle_state + self.memory = memory + self.name = name + self.network_attachments = network_attachments + self.network_interfaces = network_interfaces + self.primary_network_attachment = primary_network_attachment + self.primary_network_interface = primary_network_interface + self.profile = profile + self.resource_group = resource_group self.resource_type = resource_type - self.source = source self.status = status self.status_reasons = status_reasons - self.target_snapshots = target_snapshots + self.trusted_platform_module = trusted_platform_module + self.vpc = vpc + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJob': - """Initialize a BackupPolicyJob object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServer': + """Initialize a BareMetalServer object from a json dictionary.""" args = {} - if (auto_delete := _dict.get('auto_delete')) is not None: - args['auto_delete'] = auto_delete + if (bandwidth := _dict.get('bandwidth')) is not None: + args['bandwidth'] = bandwidth else: - raise ValueError('Required property \'auto_delete\' not present in BackupPolicyJob JSON') - if (auto_delete_after := _dict.get('auto_delete_after')) is not None: - args['auto_delete_after'] = auto_delete_after + raise ValueError('Required property \'bandwidth\' not present in BareMetalServer JSON') + if (boot_target := _dict.get('boot_target')) is not None: + args['boot_target'] = boot_target else: - raise ValueError('Required property \'auto_delete_after\' not present in BackupPolicyJob JSON') - if (backup_policy_plan := _dict.get('backup_policy_plan')) is not None: - args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(backup_policy_plan) + raise ValueError('Required property \'boot_target\' not present in BareMetalServer JSON') + if (cpu := _dict.get('cpu')) is not None: + args['cpu'] = BareMetalServerCPU.from_dict(cpu) else: - raise ValueError('Required property \'backup_policy_plan\' not present in BackupPolicyJob JSON') - if (completed_at := _dict.get('completed_at')) is not None: - args['completed_at'] = string_to_datetime(completed_at) + raise ValueError('Required property \'cpu\' not present in BareMetalServer JSON') if (created_at := _dict.get('created_at')) is not None: args['created_at'] = string_to_datetime(created_at) else: - raise ValueError('Required property \'created_at\' not present in BackupPolicyJob JSON') + raise ValueError('Required property \'created_at\' not present in BareMetalServer JSON') + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in BareMetalServer JSON') + if (disks := _dict.get('disks')) is not None: + args['disks'] = [BareMetalServerDisk.from_dict(v) for v in disks] + else: + raise ValueError('Required property \'disks\' not present in BareMetalServer JSON') + if (enable_secure_boot := _dict.get('enable_secure_boot')) is not None: + args['enable_secure_boot'] = enable_secure_boot + else: + raise ValueError('Required property \'enable_secure_boot\' not present in BareMetalServer JSON') + if (firmware := _dict.get('firmware')) is not None: + args['firmware'] = BareMetalServerFirmware.from_dict(firmware) + else: + raise ValueError('Required property \'firmware\' not present in BareMetalServer JSON') if (href := _dict.get('href')) is not None: args['href'] = href else: - raise ValueError('Required property \'href\' not present in BackupPolicyJob JSON') + raise ValueError('Required property \'href\' not present in BareMetalServer JSON') if (id := _dict.get('id')) is not None: args['id'] = id else: - raise ValueError('Required property \'id\' not present in BackupPolicyJob JSON') - if (job_type := _dict.get('job_type')) is not None: - args['job_type'] = job_type + raise ValueError('Required property \'id\' not present in BareMetalServer JSON') + if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None: + args['lifecycle_reasons'] = [BareMetalServerLifecycleReason.from_dict(v) for v in lifecycle_reasons] else: - raise ValueError('Required property \'job_type\' not present in BackupPolicyJob JSON') + raise ValueError('Required property \'lifecycle_reasons\' not present in BareMetalServer JSON') + if (lifecycle_state := _dict.get('lifecycle_state')) is not None: + args['lifecycle_state'] = lifecycle_state + else: + raise ValueError('Required property \'lifecycle_state\' not present in BareMetalServer JSON') + if (memory := _dict.get('memory')) is not None: + args['memory'] = memory + else: + raise ValueError('Required property \'memory\' not present in BareMetalServer JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in BareMetalServer JSON') + if (network_attachments := _dict.get('network_attachments')) is not None: + args['network_attachments'] = [BareMetalServerNetworkAttachmentReference.from_dict(v) for v in network_attachments] + if (network_interfaces := _dict.get('network_interfaces')) is not None: + args['network_interfaces'] = [NetworkInterfaceBareMetalServerContextReference.from_dict(v) for v in network_interfaces] + else: + raise ValueError('Required property \'network_interfaces\' not present in BareMetalServer JSON') + if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None: + args['primary_network_attachment'] = BareMetalServerNetworkAttachmentReference.from_dict(primary_network_attachment) + if (primary_network_interface := _dict.get('primary_network_interface')) is not None: + args['primary_network_interface'] = NetworkInterfaceBareMetalServerContextReference.from_dict(primary_network_interface) + else: + raise ValueError('Required property \'primary_network_interface\' not present in BareMetalServer JSON') + if (profile := _dict.get('profile')) is not None: + args['profile'] = BareMetalServerProfileReference.from_dict(profile) + else: + raise ValueError('Required property \'profile\' not present in BareMetalServer JSON') + if (resource_group := _dict.get('resource_group')) is not None: + args['resource_group'] = ResourceGroupReference.from_dict(resource_group) + else: + raise ValueError('Required property \'resource_group\' not present in BareMetalServer JSON') if (resource_type := _dict.get('resource_type')) is not None: args['resource_type'] = resource_type else: - raise ValueError('Required property \'resource_type\' not present in BackupPolicyJob JSON') - if (source := _dict.get('source')) is not None: - args['source'] = source - else: - raise ValueError('Required property \'source\' not present in BackupPolicyJob JSON') + raise ValueError('Required property \'resource_type\' not present in BareMetalServer JSON') if (status := _dict.get('status')) is not None: args['status'] = status else: - raise ValueError('Required property \'status\' not present in BackupPolicyJob JSON') + raise ValueError('Required property \'status\' not present in BareMetalServer JSON') if (status_reasons := _dict.get('status_reasons')) is not None: - args['status_reasons'] = [BackupPolicyJobStatusReason.from_dict(v) for v in status_reasons] + args['status_reasons'] = [BareMetalServerStatusReason.from_dict(v) for v in status_reasons] else: - raise ValueError('Required property \'status_reasons\' not present in BackupPolicyJob JSON') - if (target_snapshots := _dict.get('target_snapshots')) is not None: - args['target_snapshots'] = [SnapshotReference.from_dict(v) for v in target_snapshots] + raise ValueError('Required property \'status_reasons\' not present in BareMetalServer JSON') + if (trusted_platform_module := _dict.get('trusted_platform_module')) is not None: + args['trusted_platform_module'] = BareMetalServerTrustedPlatformModule.from_dict(trusted_platform_module) else: - raise ValueError('Required property \'target_snapshots\' not present in BackupPolicyJob JSON') + raise ValueError('Required property \'trusted_platform_module\' not present in BareMetalServer JSON') + if (vpc := _dict.get('vpc')) is not None: + args['vpc'] = VPCReference.from_dict(vpc) + else: + raise ValueError('Required property \'vpc\' not present in BareMetalServer JSON') + if (zone := _dict.get('zone')) is not None: + args['zone'] = ZoneReference.from_dict(zone) + else: + raise ValueError('Required property \'zone\' not present in BareMetalServer JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJob object from a json dictionary.""" + """Initialize a BareMetalServer 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, 'auto_delete') and self.auto_delete is not None: - _dict['auto_delete'] = self.auto_delete - if hasattr(self, 'auto_delete_after') and self.auto_delete_after is not None: - _dict['auto_delete_after'] = self.auto_delete_after - if hasattr(self, 'backup_policy_plan') and self.backup_policy_plan is not None: - if isinstance(self.backup_policy_plan, dict): - _dict['backup_policy_plan'] = self.backup_policy_plan + if hasattr(self, 'bandwidth') and self.bandwidth is not None: + _dict['bandwidth'] = self.bandwidth + if hasattr(self, 'boot_target') and self.boot_target is not None: + if isinstance(self.boot_target, dict): + _dict['boot_target'] = self.boot_target else: - _dict['backup_policy_plan'] = self.backup_policy_plan.to_dict() - if hasattr(self, 'completed_at') and self.completed_at is not None: - _dict['completed_at'] = datetime_to_string(self.completed_at) + _dict['boot_target'] = self.boot_target.to_dict() + if hasattr(self, 'cpu') and self.cpu is not None: + if isinstance(self.cpu, dict): + _dict['cpu'] = self.cpu + else: + _dict['cpu'] = self.cpu.to_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, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'disks') and self.disks is not None: + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list + if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: + _dict['enable_secure_boot'] = self.enable_secure_boot + if hasattr(self, 'firmware') and self.firmware is not None: + if isinstance(self.firmware, dict): + _dict['firmware'] = self.firmware + else: + _dict['firmware'] = self.firmware.to_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 - if hasattr(self, 'job_type') and self.job_type is not None: - _dict['job_type'] = self.job_type + if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: + lifecycle_reasons_list = [] + for v in self.lifecycle_reasons: + if isinstance(v, dict): + lifecycle_reasons_list.append(v) + else: + lifecycle_reasons_list.append(v.to_dict()) + _dict['lifecycle_reasons'] = lifecycle_reasons_list + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'memory') and self.memory is not None: + _dict['memory'] = self.memory + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'network_attachments') and self.network_attachments is not None: + network_attachments_list = [] + for v in self.network_attachments: + if isinstance(v, dict): + network_attachments_list.append(v) + else: + network_attachments_list.append(v.to_dict()) + _dict['network_attachments'] = network_attachments_list + if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None: + if isinstance(self.primary_network_attachment, dict): + _dict['primary_network_attachment'] = self.primary_network_attachment + else: + _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict() + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'source') and self.source is not None: - if isinstance(self.source, dict): - _dict['source'] = self.source - else: - _dict['source'] = self.source.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'status_reasons') and self.status_reasons is not None: @@ -27530,14 +31696,21 @@ def to_dict(self) -> Dict: else: status_reasons_list.append(v.to_dict()) _dict['status_reasons'] = status_reasons_list - if hasattr(self, 'target_snapshots') and self.target_snapshots is not None: - target_snapshots_list = [] - for v in self.target_snapshots: - if isinstance(v, dict): - target_snapshots_list.append(v) - else: - target_snapshots_list.append(v.to_dict()) - _dict['target_snapshots'] = target_snapshots_list + if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: + if isinstance(self.trusted_platform_module, dict): + _dict['trusted_platform_module'] = self.trusted_platform_module + else: + _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + 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): @@ -27545,29 +31718,31 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJob object.""" + """Return a `str` version of this BareMetalServer object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJob') -> bool: + def __eq__(self, other: 'BareMetalServer') -> 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: 'BackupPolicyJob') -> bool: + def __ne__(self, other: 'BareMetalServer') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class JobTypeEnum(str, Enum): + class LifecycleStateEnum(str, Enum): """ - The type of backup policy job. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. + The lifecycle state of the bare metal server. """ - CREATION = 'creation' - DELETION = 'deletion' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' class ResourceTypeEnum(str, Enum): @@ -27575,239 +31750,127 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - BACKUP_POLICY_JOB = 'backup_policy_job' + BARE_METAL_SERVER = 'bare_metal_server' class StatusEnum(str, Enum): """ - The status of the backup policy job. + The status of this bare metal server: + - `deleting`: server is undergoing deletion + - `failed`: server is failed and not usable (see `status_reasons`) + - `maintenance`: server is undergoing maintenance (not usable) + - `pending`: server is being provisioned and not yet usable + - `reinitializing`: server is reinitializing and not yet usable + - `restarting`: server is restarting and not yet usable + - `running`: server is powered on + - `starting`: server is starting and not yet usable + - `stopped`: server is powered off The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. """ + DELETING = 'deleting' FAILED = 'failed' + MAINTENANCE = 'maintenance' + PENDING = 'pending' + REINITIALIZING = 'reinitializing' + RESTARTING = 'restarting' RUNNING = 'running' - SUCCEEDED = 'succeeded' + STARTING = 'starting' + STOPPED = 'stopped' -class BackupPolicyJobCollection: +class BareMetalServerBootTarget: """ - BackupPolicyJobCollection. + The resource from which this bare metal server is booted. + The resources supported by this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param BackupPolicyJobCollectionFirst first: A link to the first page of - resources. - :param List[BackupPolicyJob] jobs: A page of jobs for the backup policy. - :param int limit: The maximum number of resources that can be returned by the - request. - :param BackupPolicyJobCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'BackupPolicyJobCollectionFirst', - jobs: List['BackupPolicyJob'], - limit: int, - total_count: int, - *, - next: Optional['BackupPolicyJobCollectionNext'] = None, ) -> None: """ - Initialize a BackupPolicyJobCollection object. + Initialize a BareMetalServerBootTarget object. - :param BackupPolicyJobCollectionFirst first: A link to the first page of - resources. - :param List[BackupPolicyJob] jobs: A page of jobs for the backup policy. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param BackupPolicyJobCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. """ - self.first = first - self.jobs = jobs - self.limit = limit - self.next = next - self.total_count = total_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollection': - """Initialize a BackupPolicyJobCollection object from a json dictionary.""" - args = {} - if (first := _dict.get('first')) is not None: - args['first'] = BackupPolicyJobCollectionFirst.from_dict(first) - else: - raise ValueError('Required property \'first\' not present in BackupPolicyJobCollection JSON') - if (jobs := _dict.get('jobs')) is not None: - args['jobs'] = [BackupPolicyJob.from_dict(v) for v in jobs] - else: - raise ValueError('Required property \'jobs\' not present in BackupPolicyJobCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - else: - raise ValueError('Required property \'limit\' not present in BackupPolicyJobCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = BackupPolicyJobCollectionNext.from_dict(next) - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count - else: - raise ValueError('Required property \'total_count\' not present in BackupPolicyJobCollection JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobCollection 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'jobs') and self.jobs is not None: - jobs_list = [] - for v in self.jobs: - if isinstance(v, dict): - jobs_list.append(v) - else: - jobs_list.append(v.to_dict()) - _dict['jobs'] = jobs_list - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count - 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 BackupPolicyJobCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BackupPolicyJobCollection') -> 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: 'BackupPolicyJobCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerBootTargetBareMetalServerDiskReference']) + ) + raise Exception(msg) -class BackupPolicyJobCollectionFirst: +class BareMetalServerCPU: """ - A link to the first page of resources. + The bare metal server CPU configuration. - :param str href: The URL for a page of resources. + :param str architecture: The CPU architecture. + :param int core_count: The total number of cores. + :param int socket_count: The total number of CPU sockets. + :param int threads_per_core: The total number of hardware threads per core. """ def __init__( self, - href: str, + architecture: str, + core_count: int, + socket_count: int, + threads_per_core: int, ) -> None: """ - Initialize a BackupPolicyJobCollectionFirst object. + Initialize a BareMetalServerCPU object. - :param str href: The URL for a page of resources. + :param str architecture: The CPU architecture. + :param int core_count: The total number of cores. + :param int socket_count: The total number of CPU sockets. + :param int threads_per_core: The total number of hardware threads per core. """ - self.href = href + self.architecture = architecture + self.core_count = core_count + self.socket_count = socket_count + self.threads_per_core = threads_per_core @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollectionFirst': - """Initialize a BackupPolicyJobCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerCPU': + """Initialize a BareMetalServerCPU object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (architecture := _dict.get('architecture')) is not None: + args['architecture'] = architecture else: - raise ValueError('Required property \'href\' not present in BackupPolicyJobCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobCollectionFirst 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 BackupPolicyJobCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BackupPolicyJobCollectionFirst') -> 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: 'BackupPolicyJobCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class BackupPolicyJobCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a BackupPolicyJobCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollectionNext': - """Initialize a BackupPolicyJobCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + raise ValueError('Required property \'architecture\' not present in BareMetalServerCPU JSON') + if (core_count := _dict.get('core_count')) is not None: + args['core_count'] = core_count + else: + raise ValueError('Required property \'core_count\' not present in BareMetalServerCPU JSON') + if (socket_count := _dict.get('socket_count')) is not None: + args['socket_count'] = socket_count + else: + raise ValueError('Required property \'socket_count\' not present in BareMetalServerCPU JSON') + if (threads_per_core := _dict.get('threads_per_core')) is not None: + args['threads_per_core'] = threads_per_core else: - raise ValueError('Required property \'href\' not present in BackupPolicyJobCollectionNext JSON') + raise ValueError('Required property \'threads_per_core\' not present in BareMetalServerCPU JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobCollectionNext object from a json dictionary.""" + """Initialize a BareMetalServerCPU 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, 'architecture') and self.architecture is not None: + _dict['architecture'] = self.architecture + if hasattr(self, 'core_count') and self.core_count is not None: + _dict['core_count'] = self.core_count + if hasattr(self, 'socket_count') and self.socket_count is not None: + _dict['socket_count'] = self.socket_count + if hasattr(self, 'threads_per_core') and self.threads_per_core is not None: + _dict['threads_per_core'] = self.threads_per_core return _dict def _to_dict(self): @@ -27815,130 +31878,116 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJobCollectionNext object.""" + """Return a `str` version of this BareMetalServerCPU object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJobCollectionNext') -> bool: + def __eq__(self, other: 'BareMetalServerCPU') -> 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: 'BackupPolicyJobCollectionNext') -> bool: + def __ne__(self, other: 'BareMetalServerCPU') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyJobSource: - """ - The source this backup was created from (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BackupPolicyJobSource object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BackupPolicyJobSourceVolumeReference', 'BackupPolicyJobSourceInstanceReference']) - ) - raise Exception(msg) - - -class BackupPolicyJobStatusReason: +class BareMetalServerCollection: """ - BackupPolicyJobStatusReason. + BareMetalServerCollection. - :param str code: A reason code for the status: - - `internal_error`: Internal error (contact IBM support) - - `snapshot_encryption_key_invalid`: The provided encryption key is unavailable - - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle - state - - `snapshot_volume_limit`: The snapshot limit for the source volume has been - reached - - `source_volume_busy`: The source volume has `busy` set (after multiple - retries) - - `source_volume_too_large`: The source volume exceeds the [maximum supported - size](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-about&interface=api#snapshots-vpc-limitations) - - `source_volume_unavailable`: The source volume is not attached to a running - instance - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param str message: An explanation of the status reason. - :param str more_info: (optional) Link to documentation about this status reason. + :param List[BareMetalServer] bare_metal_servers: A page of bare metal servers. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. """ def __init__( self, - code: str, - message: str, + bare_metal_servers: List['BareMetalServer'], + first: 'PageLink', + limit: int, + total_count: int, *, - more_info: Optional[str] = None, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a BackupPolicyJobStatusReason object. + Initialize a BareMetalServerCollection object. - :param str code: A reason code for the status: - - `internal_error`: Internal error (contact IBM support) - - `snapshot_encryption_key_invalid`: The provided encryption key is - unavailable - - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` - lifecycle state - - `snapshot_volume_limit`: The snapshot limit for the source volume has - been reached - - `source_volume_busy`: The source volume has `busy` set (after multiple - retries) - - `source_volume_too_large`: The source volume exceeds the [maximum - supported - size](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-about&interface=api#snapshots-vpc-limitations) - - `source_volume_unavailable`: The source volume is not attached to a - running instance - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param str message: An explanation of the status reason. - :param str more_info: (optional) Link to documentation about this status - reason. + :param List[BareMetalServer] bare_metal_servers: A page of bare metal + servers. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ - self.code = code - self.message = message - self.more_info = more_info + self.bare_metal_servers = bare_metal_servers + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobStatusReason': - """Initialize a BackupPolicyJobStatusReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollection': + """Initialize a BareMetalServerCollection object from a json dictionary.""" args = {} - if (code := _dict.get('code')) is not None: - args['code'] = code + if (bare_metal_servers := _dict.get('bare_metal_servers')) is not None: + args['bare_metal_servers'] = [BareMetalServer.from_dict(v) for v in bare_metal_servers] else: - raise ValueError('Required property \'code\' not present in BackupPolicyJobStatusReason JSON') - if (message := _dict.get('message')) is not None: - args['message'] = message + raise ValueError('Required property \'bare_metal_servers\' not present in BareMetalServerCollection JSON') + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'message\' not present in BackupPolicyJobStatusReason JSON') - if (more_info := _dict.get('more_info')) is not None: - args['more_info'] = more_info + raise ValueError('Required property \'first\' not present in BareMetalServerCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in BareMetalServerCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in BareMetalServerCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobStatusReason object from a json dictionary.""" + """Initialize a BareMetalServerCollection 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, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'bare_metal_servers') and self.bare_metal_servers is not None: + bare_metal_servers_list = [] + for v in self.bare_metal_servers: + if isinstance(v, dict): + bare_metal_servers_list.append(v) + else: + bare_metal_servers_list.append(v.to_dict()) + _dict['bare_metal_servers'] = bare_metal_servers_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -27946,114 +31995,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJobStatusReason object.""" + """Return a `str` version of this BareMetalServerCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJobStatusReason') -> bool: + def __eq__(self, other: 'BareMetalServerCollection') -> 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: 'BackupPolicyJobStatusReason') -> bool: + def __ne__(self, other: 'BareMetalServerCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class CodeEnum(str, Enum): - """ - A reason code for the status: - - `internal_error`: Internal error (contact IBM support) - - `snapshot_encryption_key_invalid`: The provided encryption key is unavailable - - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle - state - - `snapshot_volume_limit`: The snapshot limit for the source volume has been - reached - - `source_volume_busy`: The source volume has `busy` set (after multiple retries) - - `source_volume_too_large`: The source volume exceeds the [maximum supported - size](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-about&interface=api#snapshots-vpc-limitations) - - `source_volume_unavailable`: The source volume is not attached to a running - instance - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ - - INTERNAL_ERROR = 'internal_error' - SNAPSHOT_ENCRYPTION_KEY_INVALID = 'snapshot_encryption_key_invalid' - SNAPSHOT_PENDING = 'snapshot_pending' - SNAPSHOT_VOLUME_LIMIT = 'snapshot_volume_limit' - SOURCE_VOLUME_BUSY = 'source_volume_busy' - SOURCE_VOLUME_TOO_LARGE = 'source_volume_too_large' - SOURCE_VOLUME_UNAVAILABLE = 'source_volume_unavailable' - - -class BackupPolicyPatch: +class BareMetalServerConsoleAccessToken: """ - BackupPolicyPatch. + The bare metal server console access token information. - :param List[str] included_content: (optional) The included content for backups - created using this policy: - - `boot_volume`: Include the instance's boot volume. - - `data_volumes`: Include the instance's data volumes. - :param List[str] match_user_tags: (optional) The user tags this backup policy - will apply to (replacing any existing tags). Resources that have both a matching - user tag and a matching type will be subject to the backup policy. - :param str name: (optional) The name for this backup policy. The name must not - be used by another backup policy in the region. + :param str access_token: A URL safe single-use token used to access the console + WebSocket. + :param str console_type: The bare metal server console type for which this token + may be used. + :param datetime created_at: The date and time that the access token was created. + :param datetime expires_at: The date and time that the access token will expire. + :param bool force: Indicates whether to disconnect an existing serial console + session as the serial console cannot be shared. This has no effect on VNC + consoles. + :param str href: The URL to access this bare metal server console. """ def __init__( self, - *, - included_content: Optional[List[str]] = None, - match_user_tags: Optional[List[str]] = None, - name: Optional[str] = None, + access_token: str, + console_type: str, + created_at: datetime, + expires_at: datetime, + force: bool, + href: str, ) -> None: """ - Initialize a BackupPolicyPatch object. + Initialize a BareMetalServerConsoleAccessToken object. - :param List[str] included_content: (optional) The included content for - backups created using this policy: - - `boot_volume`: Include the instance's boot volume. - - `data_volumes`: Include the instance's data volumes. - :param List[str] match_user_tags: (optional) The user tags this backup - policy will apply to (replacing any existing tags). Resources that have - both a matching user tag and a matching type will be subject to the backup - policy. - :param str name: (optional) The name for this backup policy. The name must - not be used by another backup policy in the region. + :param str access_token: A URL safe single-use token used to access the + console WebSocket. + :param str console_type: The bare metal server console type for which this + token may be used. + :param datetime created_at: The date and time that the access token was + created. + :param datetime expires_at: The date and time that the access token will + expire. + :param bool force: Indicates whether to disconnect an existing serial + console session as the serial console cannot be shared. This has no effect + on VNC consoles. + :param str href: The URL to access this bare metal server console. """ - self.included_content = included_content - self.match_user_tags = match_user_tags - self.name = name + self.access_token = access_token + self.console_type = console_type + self.created_at = created_at + self.expires_at = expires_at + self.force = force + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPatch': - """Initialize a BackupPolicyPatch object from a json dictionary.""" - args = {} - if (included_content := _dict.get('included_content')) is not None: - args['included_content'] = included_content - if (match_user_tags := _dict.get('match_user_tags')) is not None: - args['match_user_tags'] = match_user_tags - if (name := _dict.get('name')) is not None: - args['name'] = name + def from_dict(cls, _dict: Dict) -> 'BareMetalServerConsoleAccessToken': + """Initialize a BareMetalServerConsoleAccessToken object from a json dictionary.""" + args = {} + if (access_token := _dict.get('access_token')) is not None: + args['access_token'] = access_token + else: + raise ValueError('Required property \'access_token\' not present in BareMetalServerConsoleAccessToken JSON') + if (console_type := _dict.get('console_type')) is not None: + args['console_type'] = console_type + else: + raise ValueError('Required property \'console_type\' not present in BareMetalServerConsoleAccessToken JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in BareMetalServerConsoleAccessToken JSON') + if (expires_at := _dict.get('expires_at')) is not None: + args['expires_at'] = string_to_datetime(expires_at) + else: + raise ValueError('Required property \'expires_at\' not present in BareMetalServerConsoleAccessToken JSON') + if (force := _dict.get('force')) is not None: + args['force'] = force + else: + raise ValueError('Required property \'force\' not present in BareMetalServerConsoleAccessToken JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in BareMetalServerConsoleAccessToken JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPatch object from a json dictionary.""" + """Initialize a BareMetalServerConsoleAccessToken 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, 'included_content') and self.included_content is not None: - _dict['included_content'] = self.included_content - if hasattr(self, 'match_user_tags') and self.match_user_tags is not None: - _dict['match_user_tags'] = self.match_user_tags - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'access_token') and self.access_token is not None: + _dict['access_token'] = self.access_token + if hasattr(self, 'console_type') and self.console_type is not None: + _dict['console_type'] = self.console_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, 'expires_at') and self.expires_at is not None: + _dict['expires_at'] = datetime_to_string(self.expires_at) + if hasattr(self, 'force') and self.force is not None: + _dict['force'] = self.force + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -28061,219 +32114,141 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPatch object.""" + """Return a `str` version of this BareMetalServerConsoleAccessToken object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPatch') -> bool: + def __eq__(self, other: 'BareMetalServerConsoleAccessToken') -> 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: 'BackupPolicyPatch') -> bool: + def __ne__(self, other: 'BareMetalServerConsoleAccessToken') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class IncludedContentEnum(str, Enum): + class ConsoleTypeEnum(str, Enum): """ - An item to include. + The bare metal server console type for which this token may be used. """ - BOOT_VOLUME = 'boot_volume' - DATA_VOLUMES = 'data_volumes' + SERIAL = 'serial' + VNC = 'vnc' -class BackupPolicyPlan: +class BareMetalServerDisk: """ - BackupPolicyPlan. + BareMetalServerDisk. - :param bool active: Indicates whether the plan is active. - :param List[str] attach_user_tags: The user tags to attach to backups - (snapshots) created by this plan. - :param BackupPolicyPlanClonePolicy clone_policy: - :param bool copy_user_tags: Indicates whether to copy the source's user tags to - the created backups (snapshots). - :param datetime created_at: The date and time that the backup policy plan was - created. - :param str cron_spec: The cron specification for the backup schedule. The backup - policy jobs - (which create and delete backups for this plan) will not start until this time, - and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param BackupPolicyPlanDeletionTrigger deletion_trigger: - :param str href: The URL for this backup policy plan. - :param str id: The unique identifier for this backup policy plan. - :param str lifecycle_state: The lifecycle state of this backup policy plan. - :param str name: The name for this backup policy plan. The name is unique across - all plans in the backup policy. - :param List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The - policies for additional backups in remote regions. + :param datetime created_at: The date and time that the disk was created. + :param str href: The URL for this bare metal server disk. + :param str id: The unique identifier for this bare metal server disk. + :param str interface_type: The disk attachment interface used: + - `fcp`: Fiber Channel Protocol + - `sata`: Serial Advanced Technology Attachment + - `nvme`: Non-Volatile Memory Express + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str name: The name for this bare metal server disk. The name is unique + across all disks on the bare metal server. :param str resource_type: The resource type. + :param int size: The size of the disk in GB (gigabytes). """ def __init__( self, - active: bool, - attach_user_tags: List[str], - clone_policy: 'BackupPolicyPlanClonePolicy', - copy_user_tags: bool, created_at: datetime, - cron_spec: str, - deletion_trigger: 'BackupPolicyPlanDeletionTrigger', href: str, id: str, - lifecycle_state: str, + interface_type: str, name: str, - remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicy'], resource_type: str, + size: int, ) -> None: """ - Initialize a BackupPolicyPlan object. + Initialize a BareMetalServerDisk object. - :param bool active: Indicates whether the plan is active. - :param List[str] attach_user_tags: The user tags to attach to backups - (snapshots) created by this plan. - :param BackupPolicyPlanClonePolicy clone_policy: - :param bool copy_user_tags: Indicates whether to copy the source's user - tags to the created backups (snapshots). - :param datetime created_at: The date and time that the backup policy plan - was created. - :param str cron_spec: The cron specification for the backup schedule. The - backup policy jobs - (which create and delete backups for this plan) will not start until this - time, and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param BackupPolicyPlanDeletionTrigger deletion_trigger: - :param str href: The URL for this backup policy plan. - :param str id: The unique identifier for this backup policy plan. - :param str lifecycle_state: The lifecycle state of this backup policy plan. - :param str name: The name for this backup policy plan. The name is unique - across all plans in the backup policy. - :param List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The - policies for additional backups in remote regions. + :param datetime created_at: The date and time that the disk was created. + :param str href: The URL for this bare metal server disk. + :param str id: The unique identifier for this bare metal server disk. + :param str interface_type: The disk attachment interface used: + - `fcp`: Fiber Channel Protocol + - `sata`: Serial Advanced Technology Attachment + - `nvme`: Non-Volatile Memory Express + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str name: The name for this bare metal server disk. The name is + unique across all disks on the bare metal server. :param str resource_type: The resource type. + :param int size: The size of the disk in GB (gigabytes). """ - self.active = active - self.attach_user_tags = attach_user_tags - self.clone_policy = clone_policy - self.copy_user_tags = copy_user_tags self.created_at = created_at - self.cron_spec = cron_spec - self.deletion_trigger = deletion_trigger self.href = href self.id = id - self.lifecycle_state = lifecycle_state + self.interface_type = interface_type self.name = name - self.remote_region_policies = remote_region_policies self.resource_type = resource_type + self.size = size @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlan': - """Initialize a BackupPolicyPlan object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerDisk': + """Initialize a BareMetalServerDisk object from a json dictionary.""" args = {} - if (active := _dict.get('active')) is not None: - args['active'] = active - else: - raise ValueError('Required property \'active\' not present in BackupPolicyPlan JSON') - if (attach_user_tags := _dict.get('attach_user_tags')) is not None: - args['attach_user_tags'] = attach_user_tags - else: - raise ValueError('Required property \'attach_user_tags\' not present in BackupPolicyPlan JSON') - if (clone_policy := _dict.get('clone_policy')) is not None: - args['clone_policy'] = BackupPolicyPlanClonePolicy.from_dict(clone_policy) - else: - raise ValueError('Required property \'clone_policy\' not present in BackupPolicyPlan JSON') - if (copy_user_tags := _dict.get('copy_user_tags')) is not None: - args['copy_user_tags'] = copy_user_tags - else: - raise ValueError('Required property \'copy_user_tags\' not present in BackupPolicyPlan JSON') if (created_at := _dict.get('created_at')) is not None: args['created_at'] = string_to_datetime(created_at) else: - raise ValueError('Required property \'created_at\' not present in BackupPolicyPlan JSON') - if (cron_spec := _dict.get('cron_spec')) is not None: - args['cron_spec'] = cron_spec - else: - raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlan JSON') - if (deletion_trigger := _dict.get('deletion_trigger')) is not None: - args['deletion_trigger'] = BackupPolicyPlanDeletionTrigger.from_dict(deletion_trigger) - else: - raise ValueError('Required property \'deletion_trigger\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'created_at\' not present in BareMetalServerDisk JSON') if (href := _dict.get('href')) is not None: args['href'] = href else: - raise ValueError('Required property \'href\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerDisk JSON') if (id := _dict.get('id')) is not None: args['id'] = id else: - raise ValueError('Required property \'id\' not present in BackupPolicyPlan JSON') - if (lifecycle_state := _dict.get('lifecycle_state')) is not None: - args['lifecycle_state'] = lifecycle_state + raise ValueError('Required property \'id\' not present in BareMetalServerDisk JSON') + if (interface_type := _dict.get('interface_type')) is not None: + args['interface_type'] = interface_type else: - raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'interface_type\' not present in BareMetalServerDisk JSON') if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in BackupPolicyPlan JSON') - if (remote_region_policies := _dict.get('remote_region_policies')) is not None: - args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicy.from_dict(v) for v in remote_region_policies] - else: - raise ValueError('Required property \'remote_region_policies\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'name\' not present in BareMetalServerDisk JSON') if (resource_type := _dict.get('resource_type')) is not None: args['resource_type'] = resource_type else: - raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'resource_type\' not present in BareMetalServerDisk JSON') + if (size := _dict.get('size')) is not None: + args['size'] = size + else: + raise ValueError('Required property \'size\' not present in BareMetalServerDisk JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlan object from a json dictionary.""" + """Initialize a BareMetalServerDisk 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, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: - _dict['attach_user_tags'] = self.attach_user_tags - if hasattr(self, 'clone_policy') and self.clone_policy is not None: - if isinstance(self.clone_policy, dict): - _dict['clone_policy'] = self.clone_policy - else: - _dict['clone_policy'] = self.clone_policy.to_dict() - if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: - _dict['copy_user_tags'] = self.copy_user_tags if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'cron_spec') and self.cron_spec is not None: - _dict['cron_spec'] = self.cron_spec - if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - if isinstance(self.deletion_trigger, dict): - _dict['deletion_trigger'] = self.deletion_trigger - else: - _dict['deletion_trigger'] = self.deletion_trigger.to_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 - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: - remote_region_policies_list = [] - for v in self.remote_region_policies: - if isinstance(v, dict): - remote_region_policies_list.append(v) - else: - remote_region_policies_list.append(v.to_dict()) - _dict['remote_region_policies'] = remote_region_policies_list if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size return _dict def _to_dict(self): @@ -28281,31 +32256,33 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlan object.""" + """Return a `str` version of this BareMetalServerDisk object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlan') -> bool: + def __eq__(self, other: 'BareMetalServerDisk') -> 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: 'BackupPolicyPlan') -> bool: + def __ne__(self, other: 'BareMetalServerDisk') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LifecycleStateEnum(str, Enum): + class InterfaceTypeEnum(str, Enum): """ - The lifecycle state of this backup policy plan. + The disk attachment interface used: + - `fcp`: Fiber Channel Protocol + - `sata`: Serial Advanced Technology Attachment + - `nvme`: Non-Volatile Memory Express + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + FCP = 'fcp' + NVME = 'nvme' + SATA = 'sata' class ResourceTypeEnum(str, Enum): @@ -28313,68 +32290,55 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - BACKUP_POLICY_PLAN = 'backup_policy_plan' + BARE_METAL_SERVER_DISK = 'bare_metal_server_disk' -class BackupPolicyPlanClonePolicy: +class BareMetalServerDiskCollection: """ - BackupPolicyPlanClonePolicy. + BareMetalServerDiskCollection. - :param int max_snapshots: The maximum number of recent snapshots (per source) - that will keep clones. - :param List[ZoneReference] zones: The zone this backup policy plan will create - snapshot clones in. + :param List[BareMetalServerDisk] disks: The disks for the bare metal server. """ def __init__( self, - max_snapshots: int, - zones: List['ZoneReference'], + disks: List['BareMetalServerDisk'], ) -> None: """ - Initialize a BackupPolicyPlanClonePolicy object. + Initialize a BareMetalServerDiskCollection object. - :param int max_snapshots: The maximum number of recent snapshots (per - source) that will keep clones. - :param List[ZoneReference] zones: The zone this backup policy plan will - create snapshot clones in. + :param List[BareMetalServerDisk] disks: The disks for the bare metal + server. """ - self.max_snapshots = max_snapshots - self.zones = zones + self.disks = disks @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicy': - """Initialize a BackupPolicyPlanClonePolicy object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskCollection': + """Initialize a BareMetalServerDiskCollection object from a json dictionary.""" args = {} - if (max_snapshots := _dict.get('max_snapshots')) is not None: - args['max_snapshots'] = max_snapshots - else: - raise ValueError('Required property \'max_snapshots\' not present in BackupPolicyPlanClonePolicy JSON') - if (zones := _dict.get('zones')) is not None: - args['zones'] = [ZoneReference.from_dict(v) for v in zones] + if (disks := _dict.get('disks')) is not None: + args['disks'] = [BareMetalServerDisk.from_dict(v) for v in disks] else: - raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicy JSON') + raise ValueError('Required property \'disks\' not present in BareMetalServerDiskCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanClonePolicy object from a json dictionary.""" + """Initialize a BareMetalServerDiskCollection 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, 'max_snapshots') and self.max_snapshots is not None: - _dict['max_snapshots'] = self.max_snapshots - if hasattr(self, 'zones') and self.zones is not None: - zones_list = [] - for v in self.zones: + if hasattr(self, 'disks') and self.disks is not None: + disks_list = [] + for v in self.disks: if isinstance(v, dict): - zones_list.append(v) + disks_list.append(v) else: - zones_list.append(v.to_dict()) - _dict['zones'] = zones_list + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list return _dict def _to_dict(self): @@ -28382,77 +32346,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanClonePolicy object.""" + """Return a `str` version of this BareMetalServerDiskCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanClonePolicy') -> bool: + def __eq__(self, other: 'BareMetalServerDiskCollection') -> 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: 'BackupPolicyPlanClonePolicy') -> bool: + def __ne__(self, other: 'BareMetalServerDiskCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanClonePolicyPatch: +class BareMetalServerDiskPatch: """ - BackupPolicyPlanClonePolicyPatch. + BareMetalServerDiskPatch. - :param int max_snapshots: (optional) The maximum number of recent snapshots (per - source) that will keep clones. - :param List[ZoneIdentity] zones: (optional) The zones this backup policy plan - will create snapshot clones in. Updating this value does not change the clones - for snapshots that have already been created by this plan. + :param str name: (optional) The name for this bare metal server disk. The name + must not be used by another disk on the bare metal server. """ def __init__( self, *, - max_snapshots: Optional[int] = None, - zones: Optional[List['ZoneIdentity']] = None, + name: Optional[str] = None, ) -> None: """ - Initialize a BackupPolicyPlanClonePolicyPatch object. + Initialize a BareMetalServerDiskPatch object. - :param int max_snapshots: (optional) The maximum number of recent snapshots - (per source) that will keep clones. - :param List[ZoneIdentity] zones: (optional) The zones this backup policy - plan will create snapshot clones in. Updating this value does not change - the clones for snapshots that have already been created by this plan. + :param str name: (optional) The name for this bare metal server disk. The + name must not be used by another disk on the bare metal server. """ - self.max_snapshots = max_snapshots - self.zones = zones + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPatch': - """Initialize a BackupPolicyPlanClonePolicyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskPatch': + """Initialize a BareMetalServerDiskPatch object from a json dictionary.""" args = {} - if (max_snapshots := _dict.get('max_snapshots')) is not None: - args['max_snapshots'] = max_snapshots - if (zones := _dict.get('zones')) is not None: - args['zones'] = zones + if (name := _dict.get('name')) is not None: + args['name'] = name return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanClonePolicyPatch object from a json dictionary.""" + """Initialize a BareMetalServerDiskPatch 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, 'max_snapshots') and self.max_snapshots is not None: - _dict['max_snapshots'] = self.max_snapshots - 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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -28460,77 +32406,64 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanClonePolicyPatch object.""" + """Return a `str` version of this BareMetalServerDiskPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanClonePolicyPatch') -> bool: + def __eq__(self, other: 'BareMetalServerDiskPatch') -> 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: 'BackupPolicyPlanClonePolicyPatch') -> bool: + def __ne__(self, other: 'BareMetalServerDiskPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanClonePolicyPrototype: +class BareMetalServerFirmware: """ - BackupPolicyPlanClonePolicyPrototype. + Firmware information for the bare metal server. - :param int max_snapshots: (optional) The maximum number of recent snapshots (per - source) that will keep clones. - :param List[ZoneIdentity] zones: The zone this backup policy plan will create - snapshot clones in. + :param str update: The type of update available. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ def __init__( self, - zones: List['ZoneIdentity'], - *, - max_snapshots: Optional[int] = None, + update: str, ) -> None: """ - Initialize a BackupPolicyPlanClonePolicyPrototype object. + Initialize a BareMetalServerFirmware object. - :param List[ZoneIdentity] zones: The zone this backup policy plan will - create snapshot clones in. - :param int max_snapshots: (optional) The maximum number of recent snapshots - (per source) that will keep clones. + :param str update: The type of update available. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - self.max_snapshots = max_snapshots - self.zones = zones + self.update = update @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPrototype': - """Initialize a BackupPolicyPlanClonePolicyPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerFirmware': + """Initialize a BareMetalServerFirmware object from a json dictionary.""" args = {} - if (max_snapshots := _dict.get('max_snapshots')) is not None: - args['max_snapshots'] = max_snapshots - if (zones := _dict.get('zones')) is not None: - args['zones'] = zones + if (update := _dict.get('update')) is not None: + args['update'] = update else: - raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicyPrototype JSON') + raise ValueError('Required property \'update\' not present in BareMetalServerFirmware JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanClonePolicyPrototype object from a json dictionary.""" + """Initialize a BareMetalServerFirmware 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, 'max_snapshots') and self.max_snapshots is not None: - _dict['max_snapshots'] = self.max_snapshots - 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 + if hasattr(self, 'update') and self.update is not None: + _dict['update'] = self.update return _dict def _to_dict(self): @@ -28538,117 +32471,112 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanClonePolicyPrototype object.""" + """Return a `str` version of this BareMetalServerFirmware object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanClonePolicyPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerFirmware') -> 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: 'BackupPolicyPlanClonePolicyPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerFirmware') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class UpdateEnum(str, Enum): + """ + The type of update available. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + NONE = 'none' + OPTIONAL = 'optional' + REQUIRED = 'required' + -class BackupPolicyPlanCollection: + +class BareMetalServerInitialization: """ - BackupPolicyPlanCollection. + BareMetalServerInitialization. - :param BackupPolicyPlanCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by the - request. - :param BackupPolicyPlanCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. - :param List[BackupPolicyPlan] plans: A page of plans for the backup policy. - :param int total_count: The total number of resources across all pages. + :param ImageReference image: The image the bare metal server was provisioned + from. + :param List[KeyReference] keys: The public SSH keys used at initialization. + :param List[BareMetalServerInitializationUserAccount] user_accounts: The user + accounts that are created at initialization. There can be multiple account types + distinguished by the `resource_type` property. """ def __init__( self, - first: 'BackupPolicyPlanCollectionFirst', - limit: int, - plans: List['BackupPolicyPlan'], - total_count: int, - *, - next: Optional['BackupPolicyPlanCollectionNext'] = None, + image: 'ImageReference', + keys: List['KeyReference'], + user_accounts: List['BareMetalServerInitializationUserAccount'], ) -> None: """ - Initialize a BackupPolicyPlanCollection object. + Initialize a BareMetalServerInitialization object. - :param BackupPolicyPlanCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[BackupPolicyPlan] plans: A page of plans for the backup policy. - :param int total_count: The total number of resources across all pages. - :param BackupPolicyPlanCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. + :param ImageReference image: The image the bare metal server was + provisioned from. + :param List[KeyReference] keys: The public SSH keys used at initialization. + :param List[BareMetalServerInitializationUserAccount] user_accounts: The + user accounts that are created at initialization. There can be multiple + account types distinguished by the `resource_type` property. """ - self.first = first - self.limit = limit - self.next = next - self.plans = plans - self.total_count = total_count + self.image = image + self.keys = keys + self.user_accounts = user_accounts @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanCollection': - """Initialize a BackupPolicyPlanCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitialization': + """Initialize a BareMetalServerInitialization object from a json dictionary.""" args = {} - if (first := _dict.get('first')) is not None: - args['first'] = BackupPolicyPlanCollectionFirst.from_dict(first) - else: - raise ValueError('Required property \'first\' not present in BackupPolicyPlanCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if (image := _dict.get('image')) is not None: + args['image'] = ImageReference.from_dict(image) else: - raise ValueError('Required property \'limit\' not present in BackupPolicyPlanCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = BackupPolicyPlanCollectionNext.from_dict(next) - if (plans := _dict.get('plans')) is not None: - args['plans'] = [BackupPolicyPlan.from_dict(v) for v in plans] + raise ValueError('Required property \'image\' not present in BareMetalServerInitialization JSON') + if (keys := _dict.get('keys')) is not None: + args['keys'] = [KeyReference.from_dict(v) for v in keys] else: - raise ValueError('Required property \'plans\' not present in BackupPolicyPlanCollection JSON') - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count + raise ValueError('Required property \'keys\' not present in BareMetalServerInitialization JSON') + if (user_accounts := _dict.get('user_accounts')) is not None: + args['user_accounts'] = user_accounts else: - raise ValueError('Required property \'total_count\' not present in BackupPolicyPlanCollection JSON') + raise ValueError('Required property \'user_accounts\' not present in BareMetalServerInitialization JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanCollection object from a json dictionary.""" + """Initialize a BareMetalServerInitialization 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next + if hasattr(self, 'image') and self.image is not None: + if isinstance(self.image, dict): + _dict['image'] = self.image else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'plans') and self.plans is not None: - plans_list = [] - for v in self.plans: + _dict['image'] = self.image.to_dict() + if hasattr(self, 'keys') and self.keys is not None: + keys_list = [] + for v in self.keys: if isinstance(v, dict): - plans_list.append(v) + keys_list.append(v) else: - plans_list.append(v.to_dict()) - _dict['plans'] = plans_list - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + keys_list.append(v.to_dict()) + _dict['keys'] = keys_list + if hasattr(self, 'user_accounts') and self.user_accounts is not None: + user_accounts_list = [] + for v in self.user_accounts: + if isinstance(v, dict): + user_accounts_list.append(v) + else: + user_accounts_list.append(v.to_dict()) + _dict['user_accounts'] = user_accounts_list return _dict def _to_dict(self): @@ -28656,58 +32584,106 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanCollection object.""" + """Return a `str` version of this BareMetalServerInitialization object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanCollection') -> bool: + def __eq__(self, other: 'BareMetalServerInitialization') -> 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: 'BackupPolicyPlanCollection') -> bool: + def __ne__(self, other: 'BareMetalServerInitialization') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanCollectionFirst: +class BareMetalServerInitializationPrototype: """ - A link to the first page of resources. + BareMetalServerInitializationPrototype. - :param str href: The URL for a page of resources. + :param ImageIdentity image: The image to be used when provisioning the bare + metal server. + :param List[KeyIdentity] keys: The public SSH keys to install on the bare metal + server. Keys will be made available to the bare metal server as cloud-init + vendor data. For cloud-init enabled images, these keys will also be added as SSH + authorized keys for the administrative user. + For Windows images, at least one key must be specified, and one will be selected + to encrypt the administrator password. Keys are optional for other images, but + if no keys are specified, the instance will be inaccessible unless the specified + image provides another means of access. + :param str user_data: (optional) User data to be made available when + initializing the bare metal server. + If unspecified, no user data will be made available. """ def __init__( self, - href: str, + image: 'ImageIdentity', + keys: List['KeyIdentity'], + *, + user_data: Optional[str] = None, ) -> None: """ - Initialize a BackupPolicyPlanCollectionFirst object. + Initialize a BareMetalServerInitializationPrototype object. - :param str href: The URL for a page of resources. + :param ImageIdentity image: The image to be used when provisioning the bare + metal server. + :param List[KeyIdentity] keys: The public SSH keys to install on the bare + metal server. Keys will be made available to the bare metal server as + cloud-init vendor data. For cloud-init enabled images, these keys will also + be added as SSH authorized keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + selected to encrypt the administrator password. Keys are optional for other + images, but if no keys are specified, the instance will be inaccessible + unless the specified image provides another means of access. + :param str user_data: (optional) User data to be made available when + initializing the bare metal server. + If unspecified, no user data will be made available. """ - self.href = href + self.image = image + self.keys = keys + self.user_data = user_data @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanCollectionFirst': - """Initialize a BackupPolicyPlanCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationPrototype': + """Initialize a BareMetalServerInitializationPrototype object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (image := _dict.get('image')) is not None: + args['image'] = image + else: + raise ValueError('Required property \'image\' not present in BareMetalServerInitializationPrototype JSON') + if (keys := _dict.get('keys')) is not None: + args['keys'] = keys else: - raise ValueError('Required property \'href\' not present in BackupPolicyPlanCollectionFirst JSON') + raise ValueError('Required property \'keys\' not present in BareMetalServerInitializationPrototype JSON') + if (user_data := _dict.get('user_data')) is not None: + args['user_data'] = user_data return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanCollectionFirst object from a json dictionary.""" + """Initialize a BareMetalServerInitializationPrototype 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, 'image') and self.image is not None: + if isinstance(self.image, dict): + _dict['image'] = self.image + else: + _dict['image'] = self.image.to_dict() + if hasattr(self, 'keys') and self.keys is not None: + keys_list = [] + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) + else: + keys_list.append(v.to_dict()) + _dict['keys'] = keys_list + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data return _dict def _to_dict(self): @@ -28715,131 +32691,111 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanCollectionFirst object.""" + """Return a `str` version of this BareMetalServerInitializationPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanCollectionFirst') -> bool: + def __eq__(self, other: 'BareMetalServerInitializationPrototype') -> 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: 'BackupPolicyPlanCollectionFirst') -> bool: + def __ne__(self, other: 'BareMetalServerInitializationPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanCollectionNext: +class BareMetalServerInitializationUserAccount: """ - A link to the next page of resources. This property is present for all pages except - the last page. + BareMetalServerInitializationUserAccount. - :param str href: The URL for a page of resources. """ def __init__( self, - href: str, ) -> None: """ - Initialize a BackupPolicyPlanCollectionNext object. + Initialize a BareMetalServerInitializationUserAccount object. - :param str href: The URL for a page of resources. """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanCollectionNext': - """Initialize a BackupPolicyPlanCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BackupPolicyPlanCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanCollectionNext 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 BackupPolicyPlanCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BackupPolicyPlanCollectionNext') -> 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: 'BackupPolicyPlanCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount']) + ) + raise Exception(msg) -class BackupPolicyPlanDeletionTrigger: +class BareMetalServerLifecycleReason: """ - BackupPolicyPlanDeletionTrigger. + BareMetalServerLifecycleReason. - :param int delete_after: The maximum number of days to keep each backup after - creation. - :param int delete_over_count: (optional) The maximum number of recent backups to - keep. If absent, there is no maximum. + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for this + lifecycle state. """ def __init__( self, - delete_after: int, + code: str, + message: str, *, - delete_over_count: Optional[int] = None, + more_info: Optional[str] = None, ) -> None: """ - Initialize a BackupPolicyPlanDeletionTrigger object. + Initialize a BareMetalServerLifecycleReason object. - :param int delete_after: The maximum number of days to keep each backup - after creation. - :param int delete_over_count: (optional) The maximum number of recent - backups to keep. If absent, there is no maximum. + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended + (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. """ - self.delete_after = delete_after - self.delete_over_count = delete_over_count + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTrigger': - """Initialize a BackupPolicyPlanDeletionTrigger object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerLifecycleReason': + """Initialize a BareMetalServerLifecycleReason object from a json dictionary.""" args = {} - if (delete_after := _dict.get('delete_after')) is not None: - args['delete_after'] = delete_after + if (code := _dict.get('code')) is not None: + args['code'] = code else: - raise ValueError('Required property \'delete_after\' not present in BackupPolicyPlanDeletionTrigger JSON') - if (delete_over_count := _dict.get('delete_over_count')) is not None: - args['delete_over_count'] = delete_over_count + raise ValueError('Required property \'code\' not present in BareMetalServerLifecycleReason JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message + else: + raise ValueError('Required property \'message\' not present in BareMetalServerLifecycleReason JSON') + if (more_info := _dict.get('more_info')) is not None: + args['more_info'] = more_info return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanDeletionTrigger object from a json dictionary.""" + """Initialize a BareMetalServerLifecycleReason 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, 'delete_after') and self.delete_after is not None: - _dict['delete_after'] = self.delete_after - if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -28847,139 +32803,300 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanDeletionTrigger object.""" + """Return a `str` version of this BareMetalServerLifecycleReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanDeletionTrigger') -> bool: + def __eq__(self, other: 'BareMetalServerLifecycleReason') -> 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: 'BackupPolicyPlanDeletionTrigger') -> bool: + def __ne__(self, other: 'BareMetalServerLifecycleReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class CodeEnum(str, Enum): + """ + A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ -class BackupPolicyPlanDeletionTriggerPatch: + INTERNAL_ERROR = 'internal_error' + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' + + + +class BareMetalServerNetworkAttachment: """ - BackupPolicyPlanDeletionTriggerPatch. + BareMetalServerNetworkAttachment. - :param int delete_after: (optional) The maximum number of days to keep each - backup after creation. - :param int delete_over_count: (optional) The maximum number of recent backups to - keep. Specify `null` to remove any existing maximum. + :param datetime created_at: The date and time that the bare metal server network + attachment was created. + :param str href: The URL for this bare metal server network attachment. + :param str id: The unique identifier for this bare metal server network + attachment. + :param str interface_type: The network attachment's interface type: + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in + its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str lifecycle_state: The lifecycle state of the bare metal server network + attachment. + :param str name: The name for this bare metal server network attachment. The + name is unique across all network attachments for the bare metal server. + :param int port_speed: The port speed for this bare metal server network + attachment in Mbps. + :param ReservedIPReference primary_ip: The primary IP address of the virtual + network interface for the bare metal server + network attachment. + :param str resource_type: The resource type. + :param SubnetReference subnet: The subnet of the virtual network interface for + the bare metal server network + attachment. + :param str type: The bare metal server network attachment type. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface: The virtual network interface for this bare metal + server network attachment. """ def __init__( self, - *, - delete_after: Optional[int] = None, - delete_over_count: Optional[int] = None, + created_at: datetime, + href: str, + id: str, + interface_type: str, + lifecycle_state: str, + name: str, + port_speed: int, + primary_ip: 'ReservedIPReference', + resource_type: str, + subnet: 'SubnetReference', + type: str, + virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext', ) -> None: """ - Initialize a BackupPolicyPlanDeletionTriggerPatch object. + Initialize a BareMetalServerNetworkAttachment object. - :param int delete_after: (optional) The maximum number of days to keep each - backup after creation. - :param int delete_over_count: (optional) The maximum number of recent - backups to keep. Specify `null` to remove any existing maximum. + :param datetime created_at: The date and time that the bare metal server + network attachment was created. + :param str href: The URL for this bare metal server network attachment. + :param str id: The unique identifier for this bare metal server network + attachment. + :param str interface_type: The network attachment's interface type: + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` + in its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str lifecycle_state: The lifecycle state of the bare metal server + network attachment. + :param str name: The name for this bare metal server network attachment. + The name is unique across all network attachments for the bare metal + server. + :param int port_speed: The port speed for this bare metal server network + attachment in Mbps. + :param ReservedIPReference primary_ip: The primary IP address of the + virtual network interface for the bare metal server + network attachment. + :param str resource_type: The resource type. + :param SubnetReference subnet: The subnet of the virtual network interface + for the bare metal server network + attachment. + :param str type: The bare metal server network attachment type. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface: The virtual network interface for this bare + metal server network attachment. """ - self.delete_after = delete_after - self.delete_over_count = delete_over_count + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerNetworkAttachmentByPCI', 'BareMetalServerNetworkAttachmentByVLAN']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPatch': - """Initialize a BackupPolicyPlanDeletionTriggerPatch object from a json dictionary.""" - args = {} - if (delete_after := _dict.get('delete_after')) is not None: - args['delete_after'] = delete_after - if (delete_over_count := _dict.get('delete_over_count')) is not None: - args['delete_over_count'] = delete_over_count - return cls(**args) + class InterfaceTypeEnum(str, Enum): + """ + The network attachment's interface type: + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ - @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanDeletionTriggerPatch object from a json dictionary.""" - return cls.from_dict(_dict) + PCI = 'pci' + VLAN = 'vlan' - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'delete_after') and self.delete_after is not None: - _dict['delete_after'] = self.delete_after - if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count - return _dict - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the bare metal server network attachment. + """ - def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanDeletionTriggerPatch object.""" - return json.dumps(self.to_dict(), indent=2) + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - def __eq__(self, other: 'BackupPolicyPlanDeletionTriggerPatch') -> 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: 'BackupPolicyPlanDeletionTriggerPatch') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment' -class BackupPolicyPlanDeletionTriggerPrototype: + class TypeEnum(str, Enum): + """ + The bare metal server network attachment type. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + PRIMARY = 'primary' + SECONDARY = 'secondary' + + + +class BareMetalServerNetworkAttachmentCollection: """ - BackupPolicyPlanDeletionTriggerPrototype. + BareMetalServerNetworkAttachmentCollection. - :param int delete_after: (optional) The maximum number of days to keep each - backup after creation. - :param int delete_over_count: (optional) The maximum number of recent backups to - keep. If unspecified, there will be no maximum. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param List[BareMetalServerNetworkAttachment] network_attachments: The network + attachments for the bare metal server. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. """ def __init__( self, + first: 'PageLink', + limit: int, + network_attachments: List['BareMetalServerNetworkAttachment'], + total_count: int, *, - delete_after: Optional[int] = None, - delete_over_count: Optional[int] = None, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a BackupPolicyPlanDeletionTriggerPrototype object. + Initialize a BareMetalServerNetworkAttachmentCollection object. - :param int delete_after: (optional) The maximum number of days to keep each - backup after creation. - :param int delete_over_count: (optional) The maximum number of recent - backups to keep. If unspecified, there will be no maximum. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[BareMetalServerNetworkAttachment] network_attachments: The + network attachments for the bare metal server. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ - self.delete_after = delete_after - self.delete_over_count = delete_over_count + self.first = first + self.limit = limit + self.network_attachments = network_attachments + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPrototype': - """Initialize a BackupPolicyPlanDeletionTriggerPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentCollection': + """Initialize a BareMetalServerNetworkAttachmentCollection object from a json dictionary.""" args = {} - if (delete_after := _dict.get('delete_after')) is not None: - args['delete_after'] = delete_after - if (delete_over_count := _dict.get('delete_over_count')) is not None: - args['delete_over_count'] = delete_over_count + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in BareMetalServerNetworkAttachmentCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkAttachmentCollection JSON') + if (network_attachments := _dict.get('network_attachments')) is not None: + args['network_attachments'] = network_attachments + else: + raise ValueError('Required property \'network_attachments\' not present in BareMetalServerNetworkAttachmentCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in BareMetalServerNetworkAttachmentCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanDeletionTriggerPrototype object from a json dictionary.""" + """Initialize a BareMetalServerNetworkAttachmentCollection 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, 'delete_after') and self.delete_after is not None: - _dict['delete_after'] = self.delete_after - if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'network_attachments') and self.network_attachments is not None: + network_attachments_list = [] + for v in self.network_attachments: + if isinstance(v, dict): + network_attachments_list.append(v) + else: + network_attachments_list.append(v.to_dict()) + _dict['network_attachments'] = network_attachments_list + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -28987,148 +33104,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanDeletionTriggerPrototype object.""" + """Return a `str` version of this BareMetalServerNetworkAttachmentCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanDeletionTriggerPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkAttachmentCollection') -> 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: 'BackupPolicyPlanDeletionTriggerPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkAttachmentCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanPatch: +class BareMetalServerNetworkAttachmentPatch: """ - BackupPolicyPlanPatch. + BareMetalServerNetworkAttachmentPatch. - :param bool active: (optional) Indicates whether the plan is active. - :param List[str] attach_user_tags: (optional) The user tags to attach to backups - (snapshots) created by this plan. Updating this value does not change the user - tags for backups that have already been created by this plan. - :param BackupPolicyPlanClonePolicyPatch clone_policy: (optional) - :param bool copy_user_tags: (optional) Indicates whether to copy the source's - user tags to the created backups (snapshots). - :param str cron_spec: (optional) The cron specification for the backup schedule. - The backup policy jobs - (which create and delete backups for this plan) will not start until this time, - and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) - :param str name: (optional) The name for this backup policy plan. The name must - not be used by another plan for the backup policy. - :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies: - (optional) The policies for additional backups in remote regions (replacing any - existing policies). + :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` + attachments using this PCI attachment, replacing any existing VLAN IDs. The + specified values must include IDs for all `vlan` attachments currently using + this PCI attachment. + :param str name: (optional) The name for this network attachment. The name must + not be used by another network attachment for the bare metal server. """ def __init__( self, *, - active: Optional[bool] = None, - attach_user_tags: Optional[List[str]] = None, - clone_policy: Optional['BackupPolicyPlanClonePolicyPatch'] = None, - copy_user_tags: Optional[bool] = None, - cron_spec: Optional[str] = None, - deletion_trigger: Optional['BackupPolicyPlanDeletionTriggerPatch'] = None, + allowed_vlans: Optional[List[int]] = None, name: Optional[str] = None, - remote_region_policies: Optional[List['BackupPolicyPlanRemoteRegionPolicyPrototype']] = None, ) -> None: """ - Initialize a BackupPolicyPlanPatch object. + Initialize a BareMetalServerNetworkAttachmentPatch object. - :param bool active: (optional) Indicates whether the plan is active. - :param List[str] attach_user_tags: (optional) The user tags to attach to - backups (snapshots) created by this plan. Updating this value does not - change the user tags for backups that have already been created by this - plan. - :param BackupPolicyPlanClonePolicyPatch clone_policy: (optional) - :param bool copy_user_tags: (optional) Indicates whether to copy the - source's user tags to the created backups (snapshots). - :param str cron_spec: (optional) The cron specification for the backup - schedule. The backup policy jobs - (which create and delete backups for this plan) will not start until this - time, and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) - :param str name: (optional) The name for this backup policy plan. The name - must not be used by another plan for the backup policy. - :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] - remote_region_policies: (optional) The policies for additional backups in - remote regions (replacing any existing policies). + :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` + attachments using this PCI attachment, replacing any existing VLAN IDs. The + specified values must include IDs for all `vlan` attachments currently + using this PCI attachment. + :param str name: (optional) The name for this network attachment. The name + must not be used by another network attachment for the bare metal server. """ - self.active = active - self.attach_user_tags = attach_user_tags - self.clone_policy = clone_policy - self.copy_user_tags = copy_user_tags - self.cron_spec = cron_spec - self.deletion_trigger = deletion_trigger + self.allowed_vlans = allowed_vlans self.name = name - self.remote_region_policies = remote_region_policies @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPatch': - """Initialize a BackupPolicyPlanPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPatch': + """Initialize a BareMetalServerNetworkAttachmentPatch object from a json dictionary.""" args = {} - if (active := _dict.get('active')) is not None: - args['active'] = active - if (attach_user_tags := _dict.get('attach_user_tags')) is not None: - args['attach_user_tags'] = attach_user_tags - if (clone_policy := _dict.get('clone_policy')) is not None: - args['clone_policy'] = BackupPolicyPlanClonePolicyPatch.from_dict(clone_policy) - if (copy_user_tags := _dict.get('copy_user_tags')) is not None: - args['copy_user_tags'] = copy_user_tags - if (cron_spec := _dict.get('cron_spec')) is not None: - args['cron_spec'] = cron_spec - if (deletion_trigger := _dict.get('deletion_trigger')) is not None: - args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPatch.from_dict(deletion_trigger) + if (allowed_vlans := _dict.get('allowed_vlans')) is not None: + args['allowed_vlans'] = allowed_vlans if (name := _dict.get('name')) is not None: args['name'] = name - if (remote_region_policies := _dict.get('remote_region_policies')) is not None: - args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in remote_region_policies] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanPatch object from a json dictionary.""" + """Initialize a BareMetalServerNetworkAttachmentPatch 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, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: - _dict['attach_user_tags'] = self.attach_user_tags - if hasattr(self, 'clone_policy') and self.clone_policy is not None: - if isinstance(self.clone_policy, dict): - _dict['clone_policy'] = self.clone_policy - else: - _dict['clone_policy'] = self.clone_policy.to_dict() - if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: - _dict['copy_user_tags'] = self.copy_user_tags - if hasattr(self, 'cron_spec') and self.cron_spec is not None: - _dict['cron_spec'] = self.cron_spec - if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - if isinstance(self.deletion_trigger, dict): - _dict['deletion_trigger'] = self.deletion_trigger - else: - _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: + _dict['allowed_vlans'] = self.allowed_vlans if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: - remote_region_policies_list = [] - for v in self.remote_region_policies: - if isinstance(v, dict): - remote_region_policies_list.append(v) - else: - remote_region_policies_list.append(v.to_dict()) - _dict['remote_region_policies'] = remote_region_policies_list return _dict def _to_dict(self): @@ -29136,186 +33178,165 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanPatch object.""" + """Return a `str` version of this BareMetalServerNetworkAttachmentPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanPatch') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkAttachmentPatch') -> 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: 'BackupPolicyPlanPatch') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkAttachmentPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanPrototype: +class BareMetalServerNetworkAttachmentPrototype: """ - BackupPolicyPlanPrototype. + BareMetalServerNetworkAttachmentPrototype. - :param bool active: (optional) Indicates whether the plan is active. - :param List[str] attach_user_tags: (optional) User tags to attach to each backup - (snapshot) created by this plan. If unspecified, no user tags will be attached. - :param BackupPolicyPlanClonePolicyPrototype clone_policy: (optional) - :param bool copy_user_tags: (optional) Indicates whether to copy the source's - user tags to the created backups (snapshots). - :param str cron_spec: The cron specification for the backup schedule. The backup - policy jobs - (which create and delete backups for this plan) will not start until this time, - and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional) - :param str name: (optional) The name for this backup policy plan. The name must - not be used by another plan for the backup policy. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies: - (optional) The policies for additional backups in remote regions. + :param str interface_type: The network attachment's interface type: + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in + its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + :param str name: (optional) The name for this bare metal server network + attachment. Names must be unique within the bare metal server the network + attachment resides in. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface + virtual_network_interface: A virtual network interface for the bare metal server + network attachment. This can be + specified using an existing virtual network interface, or a prototype object for + a new + virtual network interface. + If an existing virtual network interface is specified, it must not be the target + of a flow + log collector. """ def __init__( self, - cron_spec: str, + interface_type: str, + virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface', *, - active: Optional[bool] = None, - attach_user_tags: Optional[List[str]] = None, - clone_policy: Optional['BackupPolicyPlanClonePolicyPrototype'] = None, - copy_user_tags: Optional[bool] = None, - deletion_trigger: Optional['BackupPolicyPlanDeletionTriggerPrototype'] = None, name: Optional[str] = None, - remote_region_policies: Optional[List['BackupPolicyPlanRemoteRegionPolicyPrototype']] = None, ) -> None: """ - Initialize a BackupPolicyPlanPrototype object. + Initialize a BareMetalServerNetworkAttachmentPrototype object. - :param str cron_spec: The cron specification for the backup schedule. The - backup policy jobs - (which create and delete backups for this plan) will not start until this - time, and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param bool active: (optional) Indicates whether the plan is active. - :param List[str] attach_user_tags: (optional) User tags to attach to each - backup (snapshot) created by this plan. If unspecified, no user tags will - be attached. - :param BackupPolicyPlanClonePolicyPrototype clone_policy: (optional) - :param bool copy_user_tags: (optional) Indicates whether to copy the - source's user tags to the created backups (snapshots). - :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: - (optional) - :param str name: (optional) The name for this backup policy plan. The name - must not be used by another plan for the backup policy. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] - remote_region_policies: (optional) The policies for additional backups in - remote regions. + :param str interface_type: The network attachment's interface type: + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` + in its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface + virtual_network_interface: A virtual network interface for the bare metal + server network attachment. This can be + specified using an existing virtual network interface, or a prototype + object for a new + virtual network interface. + If an existing virtual network interface is specified, it must not be the + target of a flow + log collector. + :param str name: (optional) The name for this bare metal server network + attachment. Names must be unique within the bare metal server the network + attachment resides in. If unspecified, the name will be a hyphenated list + of randomly-selected words. """ - self.active = active - self.attach_user_tags = attach_user_tags - self.clone_policy = clone_policy - self.copy_user_tags = copy_user_tags - self.cron_spec = cron_spec - self.deletion_trigger = deletion_trigger - self.name = name - self.remote_region_policies = remote_region_policies + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype', 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPrototype': - """Initialize a BackupPolicyPlanPrototype object from a json dictionary.""" - args = {} - if (active := _dict.get('active')) is not None: - args['active'] = active - if (attach_user_tags := _dict.get('attach_user_tags')) is not None: - args['attach_user_tags'] = attach_user_tags - if (clone_policy := _dict.get('clone_policy')) is not None: - args['clone_policy'] = BackupPolicyPlanClonePolicyPrototype.from_dict(clone_policy) - if (copy_user_tags := _dict.get('copy_user_tags')) is not None: - args['copy_user_tags'] = copy_user_tags - if (cron_spec := _dict.get('cron_spec')) is not None: - args['cron_spec'] = cron_spec - else: - raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlanPrototype JSON') - if (deletion_trigger := _dict.get('deletion_trigger')) is not None: - args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPrototype.from_dict(deletion_trigger) - if (name := _dict.get('name')) is not None: - args['name'] = name - if (remote_region_policies := _dict.get('remote_region_policies')) is not None: - args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in remote_region_policies] - return cls(**args) + class InterfaceTypeEnum(str, Enum): + """ + The network attachment's interface type: + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + """ - @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanPrototype object from a json dictionary.""" - return cls.from_dict(_dict) + PCI = 'pci' + VLAN = 'vlan' - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: - _dict['attach_user_tags'] = self.attach_user_tags - if hasattr(self, 'clone_policy') and self.clone_policy is not None: - if isinstance(self.clone_policy, dict): - _dict['clone_policy'] = self.clone_policy - else: - _dict['clone_policy'] = self.clone_policy.to_dict() - if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: - _dict['copy_user_tags'] = self.copy_user_tags - if hasattr(self, 'cron_spec') and self.cron_spec is not None: - _dict['cron_spec'] = self.cron_spec - if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - if isinstance(self.deletion_trigger, dict): - _dict['deletion_trigger'] = self.deletion_trigger - else: - _dict['deletion_trigger'] = self.deletion_trigger.to_dict() - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: - remote_region_policies_list = [] - for v in self.remote_region_policies: - if isinstance(v, dict): - remote_region_policies_list.append(v) - else: - remote_region_policies_list.append(v.to_dict()) - _dict['remote_region_policies'] = remote_region_policies_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 BackupPolicyPlanPrototype object.""" - return json.dumps(self.to_dict(), indent=2) +class BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface: + """ + A virtual network interface for the bare metal server network attachment. This can be + specified using an existing virtual network interface, or a prototype object for a new + virtual network interface. + If an existing virtual network interface is specified, it must not be the target of a + flow log collector. - def __eq__(self, other: 'BackupPolicyPlanPrototype') -> 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: 'BackupPolicyPlanPrototype') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext', 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity']) + ) + raise Exception(msg) -class BackupPolicyPlanReference: +class BareMetalServerNetworkAttachmentReference: """ - BackupPolicyPlanReference. + BareMetalServerNetworkAttachmentReference. :param Deleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. - :param str href: The URL for this backup policy plan. - :param str id: The unique identifier for this backup policy plan. - :param str name: The name for this backup policy plan. The name is unique across - all plans in the backup policy. - :param BackupPolicyPlanRemote remote: (optional) If present, this property - indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. + :param str href: The URL for this bare metal server network attachment. + :param str id: The unique identifier for this bare metal server network + attachment. + :param str name: The name for this bare metal server network attachment. The + name is unique across all network attachments for the bare metal server. + :param ReservedIPReference primary_ip: The primary IP address of the virtual + network interface for the bare metal server + network attachment. :param str resource_type: The resource type. + :param SubnetReference subnet: The subnet of the virtual network interface for + the bare metal server network + attachment. + :param VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface: The virtual network interface for this bare metal + server network attachment. """ def __init__( @@ -29323,62 +33344,84 @@ def __init__( href: str, id: str, name: str, + primary_ip: 'ReservedIPReference', resource_type: str, + subnet: 'SubnetReference', + virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext', *, deleted: Optional['Deleted'] = None, - remote: Optional['BackupPolicyPlanRemote'] = None, ) -> None: """ - Initialize a BackupPolicyPlanReference object. + Initialize a BareMetalServerNetworkAttachmentReference object. - :param str href: The URL for this backup policy plan. - :param str id: The unique identifier for this backup policy plan. - :param str name: The name for this backup policy plan. The name is unique - across all plans in the backup policy. + :param str href: The URL for this bare metal server network attachment. + :param str id: The unique identifier for this bare metal server network + attachment. + :param str name: The name for this bare metal server network attachment. + The name is unique across all network attachments for the bare metal + server. + :param ReservedIPReference primary_ip: The primary IP address of the + virtual network interface for the bare metal server + network attachment. :param str resource_type: The resource type. + :param SubnetReference subnet: The subnet of the virtual network interface + for the bare metal server network + attachment. + :param VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface: The virtual network interface for this bare + metal server network attachment. :param Deleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. - :param BackupPolicyPlanRemote remote: (optional) If present, this property - indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. """ self.deleted = deleted self.href = href self.id = id self.name = name - self.remote = remote + self.primary_ip = primary_ip self.resource_type = resource_type + self.subnet = subnet + self.virtual_network_interface = virtual_network_interface @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanReference': - """Initialize a BackupPolicyPlanReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentReference': + """Initialize a BareMetalServerNetworkAttachmentReference object from a json dictionary.""" args = {} if (deleted := _dict.get('deleted')) is not None: args['deleted'] = Deleted.from_dict(deleted) if (href := _dict.get('href')) is not None: args['href'] = href else: - raise ValueError('Required property \'href\' not present in BackupPolicyPlanReference JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentReference JSON') if (id := _dict.get('id')) is not None: args['id'] = id else: - raise ValueError('Required property \'id\' not present in BackupPolicyPlanReference JSON') + raise ValueError('Required property \'id\' not present in BareMetalServerNetworkAttachmentReference JSON') if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in BackupPolicyPlanReference JSON') - if (remote := _dict.get('remote')) is not None: - args['remote'] = BackupPolicyPlanRemote.from_dict(remote) + raise ValueError('Required property \'name\' not present in BareMetalServerNetworkAttachmentReference JSON') + if (primary_ip := _dict.get('primary_ip')) is not None: + args['primary_ip'] = ReservedIPReference.from_dict(primary_ip) + else: + raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkAttachmentReference JSON') if (resource_type := _dict.get('resource_type')) is not None: args['resource_type'] = resource_type else: - raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlanReference JSON') + raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkAttachmentReference JSON') + if (subnet := _dict.get('subnet')) is not None: + args['subnet'] = SubnetReference.from_dict(subnet) + else: + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkAttachmentReference JSON') + if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None: + args['virtual_network_interface'] = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface) + else: + raise ValueError('Required property \'virtual_network_interface\' not present in BareMetalServerNetworkAttachmentReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanReference object from a json dictionary.""" + """Initialize a BareMetalServerNetworkAttachmentReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -29395,13 +33438,539 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None: + if isinstance(self.virtual_network_interface, dict): + _dict['virtual_network_interface'] = self.virtual_network_interface + else: + _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BareMetalServerNetworkAttachmentReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerNetworkAttachmentReference') -> 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: 'BareMetalServerNetworkAttachmentReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment' + + + +class BareMetalServerNetworkInterface: + """ + BareMetalServerNetworkInterface. + + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed + on this bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and source IP spoofing is managed on the attached virtual network + interface. + :param datetime created_at: The date and time that the bare metal server network + interface was created. + If this bare metal server has network attachments, this network interface was + created as a [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + when its corresponding network attachment was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and infrastructure NAT is managed on the attached virtual network + interface. + :param List[FloatingIPReference] floating_ips: The floating IPs associated with + this bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the floating IPs are associated with the attached virtual network + interface. + :param str href: The URL for this bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment. + :param str id: The unique identifier for this bare metal server network + interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the identifier is that of the corresponding network attachment. + :param str interface_type: The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in + its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the interface type is that of the corresponding network + attachment. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be + empty. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the MAC address is that of the attached virtual network + interface. + :param str name: The name for this bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the name matches its corresponding network attachment. + :param int port_speed: The bare metal server network interface port speed in + Mbps. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the port speed is that of its corresponding network attachment. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the security groups are associated with the attached virtual + network interface. + :param str status: The status of the bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + read-only representation of its corresponding network attachment and its + attached virtual network interface, and the status is [computed from + them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). + :param SubnetReference subnet: The associated subnet. + :param str type: The bare metal server network interface type. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the type is that of its corresponding network attachment. + """ + + def __init__( + self, + allow_ip_spoofing: bool, + created_at: datetime, + enable_infrastructure_nat: bool, + floating_ips: List['FloatingIPReference'], + href: str, + id: str, + interface_type: str, + mac_address: str, + name: str, + port_speed: int, + primary_ip: 'ReservedIPReference', + resource_type: str, + security_groups: List['SecurityGroupReference'], + status: str, + subnet: 'SubnetReference', + type: str, + ) -> None: + """ + Initialize a BareMetalServerNetworkInterface object. + + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and source IP spoofing is managed on the attached virtual + network interface. + :param datetime created_at: The date and time that the bare metal server + network interface was created. + If this bare metal server has network attachments, this network interface + was created as a [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + when its corresponding network attachment was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and infrastructure NAT is managed on the attached virtual + network interface. + :param List[FloatingIPReference] floating_ips: The floating IPs associated + with this bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the floating IPs are associated with the attached virtual + network interface. + :param str href: The URL for this bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment. + :param str id: The unique identifier for this bare metal server network + interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the identifier is that of the corresponding network + attachment. + :param str interface_type: The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP + connectivity + within a `s390x` based system + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` + in its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Has its own security groups and does not inherit those of the PCI + device through + which traffic flows. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the interface type is that of the corresponding network + attachment. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be + empty. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the MAC address is that of the attached virtual network + interface. + :param str name: The name for this bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the name matches its corresponding network attachment. + :param int port_speed: The bare metal server network interface port speed + in Mbps. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the port speed is that of its corresponding network + attachment. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the security groups are associated with the attached virtual + network interface. + :param str status: The status of the bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a read-only representation of its corresponding network attachment and + its attached virtual network interface, and the status is [computed from + them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). + :param SubnetReference subnet: The associated subnet. + :param str type: The bare metal server network interface type. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the type is that of its corresponding network attachment. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']) + ) + raise Exception(msg) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterface': + """Initialize a BareMetalServerNetworkInterface object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterface'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']) + ) + raise Exception(msg) + + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a BareMetalServerNetworkInterface object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['hipersocket'] = 'BareMetalServerNetworkInterfaceByHiperSocket' + mapping['pci'] = 'BareMetalServerNetworkInterfaceByPCI' + mapping['vlan'] = 'BareMetalServerNetworkInterfaceByVLAN' + disc_value = _dict.get('interface_type') + if disc_value is None: + raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterface JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + class InterfaceTypeEnum(str, Enum): + """ + The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the interface type is that of the corresponding network attachment. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + HIPERSOCKET = 'hipersocket' + PCI = 'pci' + VLAN = 'vlan' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + NETWORK_INTERFACE = 'network_interface' + + + class StatusEnum(str, Enum): + """ + The status of the bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + read-only representation of its corresponding network attachment and its attached + virtual network interface, and the status is [computed from + them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). + """ + + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + + class TypeEnum(str, Enum): + """ + The bare metal server network interface type. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the type is that of its corresponding network attachment. + """ + + PRIMARY = 'primary' + SECONDARY = 'secondary' + + + +class BareMetalServerNetworkInterfaceCollection: + """ + BareMetalServerNetworkInterfaceCollection. + + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param List[BareMetalServerNetworkInterface] network_interfaces: The network + interfaces for the bare metal server. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. + """ + + def __init__( + self, + first: 'PageLink', + limit: int, + network_interfaces: List['BareMetalServerNetworkInterface'], + total_count: int, + *, + next: Optional['PageLink'] = None, + ) -> None: + """ + Initialize a BareMetalServerNetworkInterfaceCollection object. + + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[BareMetalServerNetworkInterface] network_interfaces: The + network interfaces for the bare metal server. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + """ + self.first = first + self.limit = limit + self.network_interfaces = network_interfaces + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollection': + """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary.""" + args = {} + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in BareMetalServerNetworkInterfaceCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkInterfaceCollection JSON') + if (network_interfaces := _dict.get('network_interfaces')) is not None: + args['network_interfaces'] = [BareMetalServerNetworkInterface.from_dict(v) for v in network_interfaces] + else: + raise ValueError('Required property \'network_interfaces\' not present in BareMetalServerNetworkInterfaceCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in BareMetalServerNetworkInterfaceCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerNetworkInterfaceCollection 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, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -29409,73 +33978,134 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanReference object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanReference') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> 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: 'BackupPolicyPlanReference') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - BACKUP_POLICY_PLAN = 'backup_policy_plan' - - -class BackupPolicyPlanRemote: +class BareMetalServerNetworkInterfacePatch: """ - If present, this property indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. + BareMetalServerNetworkInterfacePatch. - :param RegionReference region: (optional) If present, this property indicates - that the referenced resource is remote to this - region, and identifies the native region. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing + is allowed on this bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and source IP spoofing is managed on the attached virtual network + interface. + :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` + interfaces using this PCI interface, replacing any existing VLAN IDs. The + specified values must include IDs for all `vlan` interfaces currently using this + PCI interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and infrastructure NAT is managed on the attached virtual network + interface. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. """ def __init__( self, *, - region: Optional['RegionReference'] = None, + allow_ip_spoofing: Optional[bool] = None, + allowed_vlans: Optional[List[int]] = None, + enable_infrastructure_nat: Optional[bool] = None, + name: Optional[str] = None, ) -> None: """ - Initialize a BackupPolicyPlanRemote object. + Initialize a BareMetalServerNetworkInterfacePatch object. - :param RegionReference region: (optional) If present, this property - indicates that the referenced resource is remote to this - region, and identifies the native region. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and source IP spoofing is managed on the attached virtual + network interface. + :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` + interfaces using this PCI interface, replacing any existing VLAN IDs. The + specified values must include IDs for all `vlan` interfaces currently using + this PCI interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and infrastructure NAT is managed on the attached virtual + network interface. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. """ - self.region = region + self.allow_ip_spoofing = allow_ip_spoofing + self.allowed_vlans = allowed_vlans + self.enable_infrastructure_nat = enable_infrastructure_nat + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemote': - """Initialize a BackupPolicyPlanRemote object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePatch': + """Initialize a BareMetalServerNetworkInterfacePatch object from a json dictionary.""" args = {} - if (region := _dict.get('region')) is not None: - args['region'] = RegionReference.from_dict(region) + if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None: + args['allow_ip_spoofing'] = allow_ip_spoofing + if (allowed_vlans := _dict.get('allowed_vlans')) is not None: + args['allowed_vlans'] = allowed_vlans + if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None: + args['enable_infrastructure_nat'] = enable_infrastructure_nat + if (name := _dict.get('name')) is not None: + args['name'] = name return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanRemote object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfacePatch 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, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region - else: - _dict['region'] = self.region.to_dict() + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: + _dict['allowed_vlans'] = self.allowed_vlans + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -29483,182 +34113,318 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanRemote object.""" + """Return a `str` version of this BareMetalServerNetworkInterfacePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanRemote') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfacePatch') -> 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: 'BackupPolicyPlanRemote') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanRemoteRegionPolicy: +class BareMetalServerNetworkInterfacePrototype: """ - BackupPolicyPlanRemoteRegionPolicy. + BareMetalServerNetworkInterfacePrototype. - :param int delete_over_count: The region this backup policy plan will create - backups in. - :param EncryptionKeyReference encryption_key: The root key used to rewrap the - data encryption key for the backup (snapshot). - :param RegionReference region: The region this backup policy plan will create - backups in. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing + is allowed on this bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and source IP spoofing is managed on the attached virtual network + interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and infrastructure NAT is managed on the attached virtual network + interface. + :param str interface_type: The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in + its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is specified, + it must + be available on the bare metal server network interface's subnet. Otherwise, an + available address on the subnet will be automatically selected and reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, the + VPC's default security group is used. + :param SubnetIdentity subnet: The associated subnet. """ def __init__( self, - delete_over_count: int, - encryption_key: 'EncryptionKeyReference', - region: 'RegionReference', + interface_type: str, + subnet: 'SubnetIdentity', + *, + allow_ip_spoofing: Optional[bool] = None, + enable_infrastructure_nat: Optional[bool] = None, + name: Optional[str] = None, + primary_ip: Optional['NetworkInterfaceIPPrototype'] = None, + security_groups: Optional[List['SecurityGroupIdentity']] = None, ) -> None: """ - Initialize a BackupPolicyPlanRemoteRegionPolicy object. + Initialize a BareMetalServerNetworkInterfacePrototype object. - :param int delete_over_count: The region this backup policy plan will - create backups in. - :param EncryptionKeyReference encryption_key: The root key used to rewrap - the data encryption key for the backup (snapshot). - :param RegionReference region: The region this backup policy plan will - create backups in. + :param str interface_type: The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP + connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of + `amd64` + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` + in its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Has its own security groups and does not inherit those of the PCI + device through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param SubnetIdentity subnet: The associated subnet. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and source IP spoofing is managed on the attached virtual + network interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and infrastructure NAT is managed on the attached virtual + network interface. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is + specified, it must + be available on the bare metal server network interface's subnet. + Otherwise, an + available address on the subnet will be automatically selected and + reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, + the VPC's default security group is used. """ - self.delete_over_count = delete_over_count - self.encryption_key = encryption_key - self.region = region + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']) + ) + raise Exception(msg) @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicy': - """Initialize a BackupPolicyPlanRemoteRegionPolicy object from a json dictionary.""" - args = {} - if (delete_over_count := _dict.get('delete_over_count')) is not None: - args['delete_over_count'] = delete_over_count - else: - raise ValueError('Required property \'delete_over_count\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') - if (encryption_key := _dict.get('encryption_key')) is not None: - args['encryption_key'] = EncryptionKeyReference.from_dict(encryption_key) - else: - raise ValueError('Required property \'encryption_key\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') - if (region := _dict.get('region')) is not None: - args['region'] = RegionReference.from_dict(region) - else: - raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') - return cls(**args) + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototype': + """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterfacePrototype'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']) + ) + raise Exception(msg) @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanRemoteRegionPolicy object from a json dictionary.""" + def _from_dict(cls, _dict: Dict): + """Initialize a BareMetalServerNetworkInterfacePrototype 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, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count - if hasattr(self, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region - else: - _dict['region'] = self.region.to_dict() - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['hipersocket'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype' + mapping['pci'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype' + mapping['vlan'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype' + disc_value = _dict.get('interface_type') + if disc_value is None: + raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterfacePrototype JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) - def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanRemoteRegionPolicy object.""" - return json.dumps(self.to_dict(), indent=2) + class InterfaceTypeEnum(str, Enum): + """ + The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + array of `allowed_vlans`. + - Must use an IEEE 802.1Q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + """ - def __eq__(self, other: 'BackupPolicyPlanRemoteRegionPolicy') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + HIPERSOCKET = 'hipersocket' + PCI = 'pci' + VLAN = 'vlan' - def __ne__(self, other: 'BackupPolicyPlanRemoteRegionPolicy') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class BackupPolicyPlanRemoteRegionPolicyPrototype: +class BareMetalServerPatch: """ - BackupPolicyPlanRemoteRegionPolicyPrototype. + BareMetalServerPatch. - :param int delete_over_count: (optional) The region this backup policy plan will - create backups in. - :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to - rewrap the data encryption key for the backup (snapshot). - If unspecified, the source's `encryption_key` will be used. - The specified key may be in a different account, subject to IAM policies. - :param RegionIdentity region: The region this backup policy plan will create - backups in. + :param int bandwidth: (optional) The total bandwidth (in megabits per second) + shared across the bare metal server's network interfaces. The specified value + must match one of the bandwidth values in the bare metal server's profile. + :param bool enable_secure_boot: (optional) Indicates whether secure boot is + enabled. If enabled, the image must support secure boot or the bare metal server + will fail to boot. + For `enable_secure_boot` to be changed, the bare metal server `status` must be + `stopped`. + :param str name: (optional) The name for this bare metal server. The name must + not be used by another bare metal server in the region. Changing the name will + not affect the system hostname. + :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module: + (optional) """ def __init__( self, - region: 'RegionIdentity', *, - delete_over_count: Optional[int] = None, - encryption_key: Optional['EncryptionKeyIdentity'] = None, + bandwidth: Optional[int] = None, + enable_secure_boot: Optional[bool] = None, + name: Optional[str] = None, + trusted_platform_module: Optional['BareMetalServerTrustedPlatformModulePatch'] = None, ) -> None: """ - Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object. + Initialize a BareMetalServerPatch object. - :param RegionIdentity region: The region this backup policy plan will - create backups in. - :param int delete_over_count: (optional) The region this backup policy plan - will create backups in. - :param EncryptionKeyIdentity encryption_key: (optional) The root key to use - to rewrap the data encryption key for the backup (snapshot). - If unspecified, the source's `encryption_key` will be used. - The specified key may be in a different account, subject to IAM policies. + :param int bandwidth: (optional) The total bandwidth (in megabits per + second) shared across the bare metal server's network interfaces. The + specified value must match one of the bandwidth values in the bare metal + server's profile. + :param bool enable_secure_boot: (optional) Indicates whether secure boot is + enabled. If enabled, the image must support secure boot or the bare metal + server will fail to boot. + For `enable_secure_boot` to be changed, the bare metal server `status` must + be + `stopped`. + :param str name: (optional) The name for this bare metal server. The name + must not be used by another bare metal server in the region. Changing the + name will not affect the system hostname. + :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module: + (optional) """ - self.delete_over_count = delete_over_count - self.encryption_key = encryption_key - self.region = region + self.bandwidth = bandwidth + self.enable_secure_boot = enable_secure_boot + self.name = name + self.trusted_platform_module = trusted_platform_module @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicyPrototype': - """Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerPatch': + """Initialize a BareMetalServerPatch object from a json dictionary.""" args = {} - if (delete_over_count := _dict.get('delete_over_count')) is not None: - args['delete_over_count'] = delete_over_count - if (encryption_key := _dict.get('encryption_key')) is not None: - args['encryption_key'] = encryption_key - if (region := _dict.get('region')) is not None: - args['region'] = region - else: - raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicyPrototype JSON') + if (bandwidth := _dict.get('bandwidth')) is not None: + args['bandwidth'] = bandwidth + if (enable_secure_boot := _dict.get('enable_secure_boot')) is not None: + args['enable_secure_boot'] = enable_secure_boot + if (name := _dict.get('name')) is not None: + args['name'] = name + if (trusted_platform_module := _dict.get('trusted_platform_module')) is not None: + args['trusted_platform_module'] = BareMetalServerTrustedPlatformModulePatch.from_dict(trusted_platform_module) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object from a json dictionary.""" + """Initialize a BareMetalServerPatch 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, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count - if hasattr(self, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region + if hasattr(self, 'bandwidth') and self.bandwidth is not None: + _dict['bandwidth'] = self.bandwidth + if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: + _dict['enable_secure_boot'] = self.enable_secure_boot + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: + if isinstance(self.trusted_platform_module, dict): + _dict['trusted_platform_module'] = self.trusted_platform_module else: - _dict['region'] = self.region.to_dict() + _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() return _dict def _to_dict(self): @@ -29666,476 +34432,557 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanRemoteRegionPolicyPrototype object.""" + """Return a `str` version of this BareMetalServerPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerPatch') -> 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: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPrototype: +class BareMetalServerPrimaryNetworkAttachmentPrototype: """ - BackupPolicyPrototype. + BareMetalServerPrimaryNetworkAttachmentPrototype. - :param str match_resource_type: The resource type this backup policy will apply - to. Resources that have both a matching type and a matching user tag will be - subject to the backup policy. - :param List[str] match_user_tags: The user tags this backup policy will apply - to. Resources that have both a matching user tag and a matching type will be - subject to the backup policy. - :param str name: (optional) The name for this backup policy. The name must not - be used by another backup policy in the region. If unspecified, the name will be - a hyphenated list of randomly-selected words. - :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype objects - for backup plans to be created for this backup policy. - :param ResourceGroupIdentity resource_group: (optional) The resource group to - use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. - :param BackupPolicyScopePrototype scope: (optional) The scope to use for this - backup policy. - If unspecified, the policy will be scoped to the account. + :param str interface_type: (optional) The network attachment's interface type: + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + :param str name: (optional) The name for this bare metal server network + attachment. Names must be unique within the bare metal server the network + attachment resides in. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface + virtual_network_interface: A virtual network interface for the bare metal server + network attachment. This can be + specified using an existing virtual network interface, or a prototype object for + a new + virtual network interface. + If an existing virtual network interface is specified, it must not be the target + of a flow + log collector. """ def __init__( self, - match_resource_type: str, - match_user_tags: List[str], + virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface', *, + interface_type: Optional[str] = None, name: Optional[str] = None, - plans: Optional[List['BackupPolicyPlanPrototype']] = None, - resource_group: Optional['ResourceGroupIdentity'] = None, - scope: Optional['BackupPolicyScopePrototype'] = None, ) -> None: """ - Initialize a BackupPolicyPrototype object. + Initialize a BareMetalServerPrimaryNetworkAttachmentPrototype object. - :param str match_resource_type: The resource type this backup policy will - apply to. Resources that have both a matching type and a matching user tag - will be subject to the backup policy. - :param List[str] match_user_tags: The user tags this backup policy will - apply to. Resources that have both a matching user tag and a matching type - will be subject to the backup policy. - :param str name: (optional) The name for this backup policy. The name must - not be used by another backup policy in the region. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype - objects for backup plans to be created for this backup policy. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. - :param BackupPolicyScopePrototype scope: (optional) The scope to use for - this backup policy. - If unspecified, the policy will be scoped to the account. + :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface + virtual_network_interface: A virtual network interface for the bare metal + server network attachment. This can be + specified using an existing virtual network interface, or a prototype + object for a new + virtual network interface. + If an existing virtual network interface is specified, it must not be the + target of a flow + log collector. + :param str interface_type: (optional) The network attachment's interface + type: + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param str name: (optional) The name for this bare metal server network + attachment. Names must be unique within the bare metal server the network + attachment resides in. If unspecified, the name will be a hyphenated list + of randomly-selected words. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype', 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype']) + ", ".join(['BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype']) ) raise Exception(msg) - class MatchResourceTypeEnum(str, Enum): + class InterfaceTypeEnum(str, Enum): """ - The resource type this backup policy will apply to. Resources that have both a - matching type and a matching user tag will be subject to the backup policy. + The network attachment's interface type: + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI attachment + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ - INSTANCE = 'instance' - VOLUME = 'volume' + PCI = 'pci' -class BackupPolicyScope: +class BareMetalServerPrimaryNetworkInterfacePrototype: """ - The scope for this backup policy. + BareMetalServerPrimaryNetworkInterfacePrototype. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing + is allowed on this bare metal server network interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and source IP spoofing is managed on the attached virtual network + interface. + :param List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan` + interfaces using this PCI interface. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the VLAN IDs match the `allow_vlans` of the corresponding network + attachment. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + If this bare metal server has network attachments, this network interface is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and infrastructure NAT is managed on the attached virtual network + interface. + :param str interface_type: (optional) The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is specified, + it must + be available on the bare metal server network interface's subnet. Otherwise, an + available address on the subnet will be automatically selected and reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, the + VPC's default security group is used. + :param SubnetIdentity subnet: The associated subnet. """ def __init__( self, + subnet: 'SubnetIdentity', + *, + allow_ip_spoofing: Optional[bool] = None, + allowed_vlans: Optional[List[int]] = None, + enable_infrastructure_nat: Optional[bool] = None, + interface_type: Optional[str] = None, + name: Optional[str] = None, + primary_ip: Optional['NetworkInterfaceIPPrototype'] = None, + security_groups: Optional[List['SecurityGroupIdentity']] = None, ) -> None: """ - Initialize a BackupPolicyScope object. + Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object. + :param SubnetIdentity subnet: The associated subnet. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and source IP spoofing is managed on the attached virtual + network interface. + :param List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan` + interfaces using this PCI interface. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and the VLAN IDs match the `allow_vlans` of the corresponding + network attachment. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + If this bare metal server has network attachments, this network interface + is a + [read-only + representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) + of its corresponding network attachment and its attached virtual network + interface, and infrastructure NAT is managed on the attached virtual + network interface. + :param str interface_type: (optional) The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of + `amd64` + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is + specified, it must + be available on the bare metal server network interface's subnet. + Otherwise, an + available address on the subnet will be automatically selected and + reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, + the VPC's default security group is used. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BackupPolicyScopeEnterpriseReference', 'BackupPolicyScopeAccountReference']) - ) - raise Exception(msg) + self.allow_ip_spoofing = allow_ip_spoofing + self.allowed_vlans = allowed_vlans + self.enable_infrastructure_nat = enable_infrastructure_nat + self.interface_type = interface_type + self.name = name + self.primary_ip = primary_ip + self.security_groups = security_groups + self.subnet = subnet + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrimaryNetworkInterfacePrototype': + """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary.""" + args = {} + if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None: + args['allow_ip_spoofing'] = allow_ip_spoofing + if (allowed_vlans := _dict.get('allowed_vlans')) is not None: + args['allowed_vlans'] = allowed_vlans + if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None: + args['enable_infrastructure_nat'] = enable_infrastructure_nat + if (interface_type := _dict.get('interface_type')) is not None: + args['interface_type'] = interface_type + if (name := _dict.get('name')) is not None: + args['name'] = name + if (primary_ip := _dict.get('primary_ip')) is not None: + args['primary_ip'] = primary_ip + if (security_groups := _dict.get('security_groups')) is not None: + args['security_groups'] = security_groups + if (subnet := _dict.get('subnet')) is not None: + args['subnet'] = subnet + else: + raise ValueError('Required property \'subnet\' not present in BareMetalServerPrimaryNetworkInterfacePrototype JSON') + return cls(**args) -class BackupPolicyScopePrototype: - """ - The scope to use for this backup policy. - If unspecified, the policy will be scoped to the account. + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype 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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: + _dict['allowed_vlans'] = self.allowed_vlans + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + return _dict - def __init__( - self, - ) -> None: - """ - Initialize a BackupPolicyScopePrototype object. + 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 BareMetalServerPrimaryNetworkInterfacePrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> 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: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class InterfaceTypeEnum(str, Enum): + """ + The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1Q tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BackupPolicyScopePrototypeEnterpriseIdentity']) - ) - raise Exception(msg) + HIPERSOCKET = 'hipersocket' + PCI = 'pci' -class BareMetalServer: + + +class BareMetalServerProfile: """ - BareMetalServer. + BareMetalServerProfile. - :param int bandwidth: The total bandwidth (in megabits per second) shared across - the bare metal server network attachments or bare metal server network - interfaces. - :param BareMetalServerBootTarget boot_target: The resource from which this bare - metal server is booted. - The resources supported by this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param BareMetalServerCPU cpu: The bare metal server CPU configuration. - :param datetime created_at: The date and time that the bare metal server was - created. - :param str crn: The CRN for this bare metal server. - :param List[BareMetalServerDisk] disks: The disks for this bare metal server, - including any disks that are associated with the - `boot_target`. - :param bool enable_secure_boot: Indicates whether secure boot is enabled. If - enabled, the image must support secure boot or the server will fail to boot. - :param BareMetalServerFirmware firmware: Firmware information for the bare metal - server. - :param str href: The URL for this bare metal server. - :param str id: The unique identifier for this bare metal server. - :param List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons for - the current `lifecycle_state` (if any). - :param str lifecycle_state: The lifecycle state of the bare metal server. - :param int memory: The amount of memory, truncated to whole gibibytes. - :param str name: The name for this bare metal server. The name is unique across - all bare metal servers in the region. - :param List[BareMetalServerNetworkAttachmentReference] network_attachments: - (optional) The network attachments for this bare metal server, including the - primary network attachment. - :param List[NetworkInterfaceBareMetalServerContextReference] network_interfaces: - The network interfaces for this bare metal server, including the primary network - interface. - If this bare metal server has network attachments, each network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface. - :param BareMetalServerNetworkAttachmentReference primary_network_attachment: - (optional) The primary network attachment for this bare metal server. - :param NetworkInterfaceBareMetalServerContextReference - primary_network_interface: The primary network interface for this bare metal - server. - If this bare metal server has network attachments, this primary network - interface is - a [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of the primary network attachment and its attached virtual network interface. - :param BareMetalServerProfileReference profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - for this bare metal server. - :param ResourceGroupReference resource_group: The resource group for this bare - metal server. + :param BareMetalServerProfileBandwidth bandwidth: + :param BareMetalServerProfileConsoleTypes console_types: The console type + configuration for a bare metal server with this profile. + :param BareMetalServerProfileCPUArchitecture cpu_architecture: + :param BareMetalServerProfileCPUCoreCount cpu_core_count: + :param BareMetalServerProfileCPUSocketCount cpu_socket_count: + :param List[BareMetalServerProfileDisk] disks: The disks for a bare metal server + with this profile. + :param str family: The product family this bare metal server profile belongs to. + :param str href: The URL for this bare metal server profile. + :param BareMetalServerProfileMemory memory: + :param str name: The name for this bare metal server profile. + :param BareMetalServerProfileNetworkAttachmentCount network_attachment_count: + :param BareMetalServerProfileNetworkInterfaceCount network_interface_count: + :param BareMetalServerProfileOSArchitecture os_architecture: :param str resource_type: The resource type. - :param str status: The status of this bare metal server: - - `deleting`: server is undergoing deletion - - `failed`: server is failed and not usable (see `status_reasons`) - - `maintenance`: server is undergoing maintenance (not usable) - - `pending`: server is being provisioned and not yet usable - - `reinitializing`: server is reinitializing and not yet usable - - `restarting`: server is restarting and not yet usable - - `running`: server is powered on - - `starting`: server is starting and not yet usable - - `stopped`: server is powered off - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param List[BareMetalServerStatusReason] status_reasons: The reasons for the - current status (if any). - :param BareMetalServerTrustedPlatformModule trusted_platform_module: - :param VPCReference vpc: The VPC this bare metal server resides in. - :param ZoneReference zone: The zone this bare metal server resides in. + :param BareMetalServerProfileSupportedTrustedPlatformModuleModes + supported_trusted_platform_module_modes: The supported trusted platform module + modes for this bare metal server profile. + :param BareMetalServerProfileVirtualNetworkInterfacesSupported + virtual_network_interfaces_supported: Indicates whether this profile supports + virtual network interfaces. """ def __init__( self, - bandwidth: int, - boot_target: 'BareMetalServerBootTarget', - cpu: 'BareMetalServerCPU', - created_at: datetime, - crn: str, - disks: List['BareMetalServerDisk'], - enable_secure_boot: bool, - firmware: 'BareMetalServerFirmware', + bandwidth: 'BareMetalServerProfileBandwidth', + console_types: 'BareMetalServerProfileConsoleTypes', + cpu_architecture: 'BareMetalServerProfileCPUArchitecture', + cpu_core_count: 'BareMetalServerProfileCPUCoreCount', + cpu_socket_count: 'BareMetalServerProfileCPUSocketCount', + disks: List['BareMetalServerProfileDisk'], + family: str, href: str, - id: str, - lifecycle_reasons: List['BareMetalServerLifecycleReason'], - lifecycle_state: str, - memory: int, + memory: 'BareMetalServerProfileMemory', name: str, - network_interfaces: List['NetworkInterfaceBareMetalServerContextReference'], - primary_network_interface: 'NetworkInterfaceBareMetalServerContextReference', - profile: 'BareMetalServerProfileReference', - resource_group: 'ResourceGroupReference', - resource_type: str, - status: str, - status_reasons: List['BareMetalServerStatusReason'], - trusted_platform_module: 'BareMetalServerTrustedPlatformModule', - vpc: 'VPCReference', - zone: 'ZoneReference', - *, - network_attachments: Optional[List['BareMetalServerNetworkAttachmentReference']] = None, - primary_network_attachment: Optional['BareMetalServerNetworkAttachmentReference'] = None, + network_attachment_count: 'BareMetalServerProfileNetworkAttachmentCount', + network_interface_count: 'BareMetalServerProfileNetworkInterfaceCount', + os_architecture: 'BareMetalServerProfileOSArchitecture', + resource_type: str, + supported_trusted_platform_module_modes: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes', + virtual_network_interfaces_supported: 'BareMetalServerProfileVirtualNetworkInterfacesSupported', ) -> None: """ - Initialize a BareMetalServer object. + Initialize a BareMetalServerProfile object. - :param int bandwidth: The total bandwidth (in megabits per second) shared - across the bare metal server network attachments or bare metal server - network interfaces. - :param BareMetalServerBootTarget boot_target: The resource from which this - bare metal server is booted. - The resources supported by this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param BareMetalServerCPU cpu: The bare metal server CPU configuration. - :param datetime created_at: The date and time that the bare metal server - was created. - :param str crn: The CRN for this bare metal server. - :param List[BareMetalServerDisk] disks: The disks for this bare metal - server, including any disks that are associated with the - `boot_target`. - :param bool enable_secure_boot: Indicates whether secure boot is enabled. - If enabled, the image must support secure boot or the server will fail to - boot. - :param BareMetalServerFirmware firmware: Firmware information for the bare - metal server. - :param str href: The URL for this bare metal server. - :param str id: The unique identifier for this bare metal server. - :param List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons - for the current `lifecycle_state` (if any). - :param str lifecycle_state: The lifecycle state of the bare metal server. - :param int memory: The amount of memory, truncated to whole gibibytes. - :param str name: The name for this bare metal server. The name is unique - across all bare metal servers in the region. - :param List[NetworkInterfaceBareMetalServerContextReference] - network_interfaces: The network interfaces for this bare metal server, - including the primary network interface. - If this bare metal server has network attachments, each network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface. - :param NetworkInterfaceBareMetalServerContextReference - primary_network_interface: The primary network interface for this bare - metal server. - If this bare metal server has network attachments, this primary network - interface is - a [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of the primary network attachment and its attached virtual network - interface. - :param BareMetalServerProfileReference profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - for this bare metal server. - :param ResourceGroupReference resource_group: The resource group for this - bare metal server. + :param BareMetalServerProfileBandwidth bandwidth: + :param BareMetalServerProfileConsoleTypes console_types: The console type + configuration for a bare metal server with this profile. + :param BareMetalServerProfileCPUArchitecture cpu_architecture: + :param BareMetalServerProfileCPUCoreCount cpu_core_count: + :param BareMetalServerProfileCPUSocketCount cpu_socket_count: + :param List[BareMetalServerProfileDisk] disks: The disks for a bare metal + server with this profile. + :param str family: The product family this bare metal server profile + belongs to. + :param str href: The URL for this bare metal server profile. + :param BareMetalServerProfileMemory memory: + :param str name: The name for this bare metal server profile. + :param BareMetalServerProfileNetworkAttachmentCount + network_attachment_count: + :param BareMetalServerProfileNetworkInterfaceCount network_interface_count: + :param BareMetalServerProfileOSArchitecture os_architecture: :param str resource_type: The resource type. - :param str status: The status of this bare metal server: - - `deleting`: server is undergoing deletion - - `failed`: server is failed and not usable (see `status_reasons`) - - `maintenance`: server is undergoing maintenance (not usable) - - `pending`: server is being provisioned and not yet usable - - `reinitializing`: server is reinitializing and not yet usable - - `restarting`: server is restarting and not yet usable - - `running`: server is powered on - - `starting`: server is starting and not yet usable - - `stopped`: server is powered off - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param List[BareMetalServerStatusReason] status_reasons: The reasons for - the current status (if any). - :param BareMetalServerTrustedPlatformModule trusted_platform_module: - :param VPCReference vpc: The VPC this bare metal server resides in. - :param ZoneReference zone: The zone this bare metal server resides in. - :param List[BareMetalServerNetworkAttachmentReference] network_attachments: - (optional) The network attachments for this bare metal server, including - the primary network attachment. - :param BareMetalServerNetworkAttachmentReference - primary_network_attachment: (optional) The primary network attachment for - this bare metal server. + :param BareMetalServerProfileSupportedTrustedPlatformModuleModes + supported_trusted_platform_module_modes: The supported trusted platform + module modes for this bare metal server profile. + :param BareMetalServerProfileVirtualNetworkInterfacesSupported + virtual_network_interfaces_supported: Indicates whether this profile + supports virtual network interfaces. """ self.bandwidth = bandwidth - self.boot_target = boot_target - self.cpu = cpu - self.created_at = created_at - self.crn = crn + self.console_types = console_types + self.cpu_architecture = cpu_architecture + self.cpu_core_count = cpu_core_count + self.cpu_socket_count = cpu_socket_count self.disks = disks - self.enable_secure_boot = enable_secure_boot - self.firmware = firmware + self.family = family self.href = href - self.id = id - self.lifecycle_reasons = lifecycle_reasons - self.lifecycle_state = lifecycle_state self.memory = memory self.name = name - self.network_attachments = network_attachments - self.network_interfaces = network_interfaces - self.primary_network_attachment = primary_network_attachment - self.primary_network_interface = primary_network_interface - self.profile = profile - self.resource_group = resource_group + self.network_attachment_count = network_attachment_count + self.network_interface_count = network_interface_count + self.os_architecture = os_architecture self.resource_type = resource_type - self.status = status - self.status_reasons = status_reasons - self.trusted_platform_module = trusted_platform_module - self.vpc = vpc - self.zone = zone + self.supported_trusted_platform_module_modes = supported_trusted_platform_module_modes + self.virtual_network_interfaces_supported = virtual_network_interfaces_supported @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServer': - """Initialize a BareMetalServer object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfile': + """Initialize a BareMetalServerProfile object from a json dictionary.""" args = {} if (bandwidth := _dict.get('bandwidth')) is not None: args['bandwidth'] = bandwidth else: - raise ValueError('Required property \'bandwidth\' not present in BareMetalServer JSON') - if (boot_target := _dict.get('boot_target')) is not None: - args['boot_target'] = boot_target + raise ValueError('Required property \'bandwidth\' not present in BareMetalServerProfile JSON') + if (console_types := _dict.get('console_types')) is not None: + args['console_types'] = BareMetalServerProfileConsoleTypes.from_dict(console_types) else: - raise ValueError('Required property \'boot_target\' not present in BareMetalServer JSON') - if (cpu := _dict.get('cpu')) is not None: - args['cpu'] = BareMetalServerCPU.from_dict(cpu) + raise ValueError('Required property \'console_types\' not present in BareMetalServerProfile JSON') + if (cpu_architecture := _dict.get('cpu_architecture')) is not None: + args['cpu_architecture'] = BareMetalServerProfileCPUArchitecture.from_dict(cpu_architecture) else: - raise ValueError('Required property \'cpu\' not present in BareMetalServer JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) + raise ValueError('Required property \'cpu_architecture\' not present in BareMetalServerProfile JSON') + if (cpu_core_count := _dict.get('cpu_core_count')) is not None: + args['cpu_core_count'] = cpu_core_count else: - raise ValueError('Required property \'created_at\' not present in BareMetalServer JSON') - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn + raise ValueError('Required property \'cpu_core_count\' not present in BareMetalServerProfile JSON') + if (cpu_socket_count := _dict.get('cpu_socket_count')) is not None: + args['cpu_socket_count'] = cpu_socket_count else: - raise ValueError('Required property \'crn\' not present in BareMetalServer JSON') + raise ValueError('Required property \'cpu_socket_count\' not present in BareMetalServerProfile JSON') if (disks := _dict.get('disks')) is not None: - args['disks'] = [BareMetalServerDisk.from_dict(v) for v in disks] - else: - raise ValueError('Required property \'disks\' not present in BareMetalServer JSON') - if (enable_secure_boot := _dict.get('enable_secure_boot')) is not None: - args['enable_secure_boot'] = enable_secure_boot + args['disks'] = [BareMetalServerProfileDisk.from_dict(v) for v in disks] else: - raise ValueError('Required property \'enable_secure_boot\' not present in BareMetalServer JSON') - if (firmware := _dict.get('firmware')) is not None: - args['firmware'] = BareMetalServerFirmware.from_dict(firmware) + raise ValueError('Required property \'disks\' not present in BareMetalServerProfile JSON') + if (family := _dict.get('family')) is not None: + args['family'] = family else: - raise ValueError('Required property \'firmware\' not present in BareMetalServer JSON') + raise ValueError('Required property \'family\' not present in BareMetalServerProfile JSON') if (href := _dict.get('href')) is not None: args['href'] = href else: - raise ValueError('Required property \'href\' not present in BareMetalServer JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in BareMetalServer JSON') - if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None: - args['lifecycle_reasons'] = [BareMetalServerLifecycleReason.from_dict(v) for v in lifecycle_reasons] - else: - raise ValueError('Required property \'lifecycle_reasons\' not present in BareMetalServer JSON') - if (lifecycle_state := _dict.get('lifecycle_state')) is not None: - args['lifecycle_state'] = lifecycle_state - else: - raise ValueError('Required property \'lifecycle_state\' not present in BareMetalServer JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerProfile JSON') if (memory := _dict.get('memory')) is not None: args['memory'] = memory else: - raise ValueError('Required property \'memory\' not present in BareMetalServer JSON') + raise ValueError('Required property \'memory\' not present in BareMetalServerProfile JSON') if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in BareMetalServer JSON') - if (network_attachments := _dict.get('network_attachments')) is not None: - args['network_attachments'] = [BareMetalServerNetworkAttachmentReference.from_dict(v) for v in network_attachments] - if (network_interfaces := _dict.get('network_interfaces')) is not None: - args['network_interfaces'] = [NetworkInterfaceBareMetalServerContextReference.from_dict(v) for v in network_interfaces] - else: - raise ValueError('Required property \'network_interfaces\' not present in BareMetalServer JSON') - if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None: - args['primary_network_attachment'] = BareMetalServerNetworkAttachmentReference.from_dict(primary_network_attachment) - if (primary_network_interface := _dict.get('primary_network_interface')) is not None: - args['primary_network_interface'] = NetworkInterfaceBareMetalServerContextReference.from_dict(primary_network_interface) + raise ValueError('Required property \'name\' not present in BareMetalServerProfile JSON') + if (network_attachment_count := _dict.get('network_attachment_count')) is not None: + args['network_attachment_count'] = network_attachment_count else: - raise ValueError('Required property \'primary_network_interface\' not present in BareMetalServer JSON') - if (profile := _dict.get('profile')) is not None: - args['profile'] = BareMetalServerProfileReference.from_dict(profile) + raise ValueError('Required property \'network_attachment_count\' not present in BareMetalServerProfile JSON') + if (network_interface_count := _dict.get('network_interface_count')) is not None: + args['network_interface_count'] = network_interface_count else: - raise ValueError('Required property \'profile\' not present in BareMetalServer JSON') - if (resource_group := _dict.get('resource_group')) is not None: - args['resource_group'] = ResourceGroupReference.from_dict(resource_group) + raise ValueError('Required property \'network_interface_count\' not present in BareMetalServerProfile JSON') + if (os_architecture := _dict.get('os_architecture')) is not None: + args['os_architecture'] = BareMetalServerProfileOSArchitecture.from_dict(os_architecture) else: - raise ValueError('Required property \'resource_group\' not present in BareMetalServer JSON') + raise ValueError('Required property \'os_architecture\' not present in BareMetalServerProfile JSON') if (resource_type := _dict.get('resource_type')) is not None: args['resource_type'] = resource_type else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServer JSON') - if (status := _dict.get('status')) is not None: - args['status'] = status - else: - raise ValueError('Required property \'status\' not present in BareMetalServer JSON') - if (status_reasons := _dict.get('status_reasons')) is not None: - args['status_reasons'] = [BareMetalServerStatusReason.from_dict(v) for v in status_reasons] - else: - raise ValueError('Required property \'status_reasons\' not present in BareMetalServer JSON') - if (trusted_platform_module := _dict.get('trusted_platform_module')) is not None: - args['trusted_platform_module'] = BareMetalServerTrustedPlatformModule.from_dict(trusted_platform_module) - else: - raise ValueError('Required property \'trusted_platform_module\' not present in BareMetalServer JSON') - if (vpc := _dict.get('vpc')) is not None: - args['vpc'] = VPCReference.from_dict(vpc) + raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfile JSON') + if (supported_trusted_platform_module_modes := _dict.get('supported_trusted_platform_module_modes')) is not None: + args['supported_trusted_platform_module_modes'] = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(supported_trusted_platform_module_modes) else: - raise ValueError('Required property \'vpc\' not present in BareMetalServer JSON') - if (zone := _dict.get('zone')) is not None: - args['zone'] = ZoneReference.from_dict(zone) + raise ValueError('Required property \'supported_trusted_platform_module_modes\' not present in BareMetalServerProfile JSON') + if (virtual_network_interfaces_supported := _dict.get('virtual_network_interfaces_supported')) is not None: + args['virtual_network_interfaces_supported'] = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(virtual_network_interfaces_supported) else: - raise ValueError('Required property \'zone\' not present in BareMetalServer JSON') + raise ValueError('Required property \'virtual_network_interfaces_supported\' not present in BareMetalServerProfile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServer object from a json dictionary.""" + """Initialize a BareMetalServerProfile 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, 'bandwidth') and self.bandwidth is not None: - _dict['bandwidth'] = self.bandwidth - if hasattr(self, 'boot_target') and self.boot_target is not None: - if isinstance(self.boot_target, dict): - _dict['boot_target'] = self.boot_target + if isinstance(self.bandwidth, dict): + _dict['bandwidth'] = self.bandwidth else: - _dict['boot_target'] = self.boot_target.to_dict() - if hasattr(self, 'cpu') and self.cpu is not None: - if isinstance(self.cpu, dict): - _dict['cpu'] = self.cpu + _dict['bandwidth'] = self.bandwidth.to_dict() + if hasattr(self, 'console_types') and self.console_types is not None: + if isinstance(self.console_types, dict): + _dict['console_types'] = self.console_types else: - _dict['cpu'] = self.cpu.to_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, 'crn') and self.crn is not None: - _dict['crn'] = self.crn + _dict['console_types'] = self.console_types.to_dict() + if hasattr(self, 'cpu_architecture') and self.cpu_architecture is not None: + if isinstance(self.cpu_architecture, dict): + _dict['cpu_architecture'] = self.cpu_architecture + else: + _dict['cpu_architecture'] = self.cpu_architecture.to_dict() + if hasattr(self, 'cpu_core_count') and self.cpu_core_count is not None: + if isinstance(self.cpu_core_count, dict): + _dict['cpu_core_count'] = self.cpu_core_count + else: + _dict['cpu_core_count'] = self.cpu_core_count.to_dict() + if hasattr(self, 'cpu_socket_count') and self.cpu_socket_count is not None: + if isinstance(self.cpu_socket_count, dict): + _dict['cpu_socket_count'] = self.cpu_socket_count + else: + _dict['cpu_socket_count'] = self.cpu_socket_count.to_dict() if hasattr(self, 'disks') and self.disks is not None: disks_list = [] for v in self.disks: @@ -30144,94 +34991,44 @@ def to_dict(self) -> Dict: else: disks_list.append(v.to_dict()) _dict['disks'] = disks_list - if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: - _dict['enable_secure_boot'] = self.enable_secure_boot - if hasattr(self, 'firmware') and self.firmware is not None: - if isinstance(self.firmware, dict): - _dict['firmware'] = self.firmware - else: - _dict['firmware'] = self.firmware.to_dict() + if hasattr(self, 'family') and self.family is not None: + _dict['family'] = self.family 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 - if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: - lifecycle_reasons_list = [] - for v in self.lifecycle_reasons: - if isinstance(v, dict): - lifecycle_reasons_list.append(v) - else: - lifecycle_reasons_list.append(v.to_dict()) - _dict['lifecycle_reasons'] = lifecycle_reasons_list - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'memory') and self.memory is not None: - _dict['memory'] = self.memory + if isinstance(self.memory, dict): + _dict['memory'] = self.memory + else: + _dict['memory'] = self.memory.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'network_attachments') and self.network_attachments is not None: - network_attachments_list = [] - for v in self.network_attachments: - if isinstance(v, dict): - network_attachments_list.append(v) - else: - network_attachments_list.append(v.to_dict()) - _dict['network_attachments'] = network_attachments_list - if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None: - if isinstance(self.primary_network_attachment, dict): - _dict['primary_network_attachment'] = self.primary_network_attachment - else: - _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict() - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface + if hasattr(self, 'network_attachment_count') and self.network_attachment_count is not None: + if isinstance(self.network_attachment_count, dict): + _dict['network_attachment_count'] = self.network_attachment_count else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile + _dict['network_attachment_count'] = self.network_attachment_count.to_dict() + if hasattr(self, 'network_interface_count') and self.network_interface_count is not None: + if isinstance(self.network_interface_count, dict): + _dict['network_interface_count'] = self.network_interface_count else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group + _dict['network_interface_count'] = self.network_interface_count.to_dict() + if hasattr(self, 'os_architecture') and self.os_architecture is not None: + if isinstance(self.os_architecture, dict): + _dict['os_architecture'] = self.os_architecture else: - _dict['resource_group'] = self.resource_group.to_dict() + _dict['os_architecture'] = self.os_architecture.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, 'status_reasons') and self.status_reasons is not None: - status_reasons_list = [] - for v in self.status_reasons: - if isinstance(v, dict): - status_reasons_list.append(v) - else: - status_reasons_list.append(v.to_dict()) - _dict['status_reasons'] = status_reasons_list - if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: - if isinstance(self.trusted_platform_module, dict): - _dict['trusted_platform_module'] = self.trusted_platform_module - else: - _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc + if hasattr(self, 'supported_trusted_platform_module_modes') and self.supported_trusted_platform_module_modes is not None: + if isinstance(self.supported_trusted_platform_module_modes, dict): + _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes.to_dict() + if hasattr(self, 'virtual_network_interfaces_supported') and self.virtual_network_interfaces_supported is not None: + if isinstance(self.virtual_network_interfaces_supported, dict): + _dict['virtual_network_interfaces_supported'] = self.virtual_network_interfaces_supported else: - _dict['zone'] = self.zone.to_dict() + _dict['virtual_network_interfaces_supported'] = self.virtual_network_interfaces_supported.to_dict() return _dict def _to_dict(self): @@ -30239,75 +35036,31 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServer object.""" + """Return a `str` version of this BareMetalServerProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServer') -> bool: + def __eq__(self, other: 'BareMetalServerProfile') -> 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: 'BareMetalServer') -> bool: + def __ne__(self, other: 'BareMetalServerProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the bare metal server. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - class ResourceTypeEnum(str, Enum): """ The resource type. """ - BARE_METAL_SERVER = 'bare_metal_server' - - - class StatusEnum(str, Enum): - """ - The status of this bare metal server: - - `deleting`: server is undergoing deletion - - `failed`: server is failed and not usable (see `status_reasons`) - - `maintenance`: server is undergoing maintenance (not usable) - - `pending`: server is being provisioned and not yet usable - - `reinitializing`: server is reinitializing and not yet usable - - `restarting`: server is restarting and not yet usable - - `running`: server is powered on - - `starting`: server is starting and not yet usable - - `stopped`: server is powered off - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ - - DELETING = 'deleting' - FAILED = 'failed' - MAINTENANCE = 'maintenance' - PENDING = 'pending' - REINITIALIZING = 'reinitializing' - RESTARTING = 'restarting' - RUNNING = 'running' - STARTING = 'starting' - STOPPED = 'stopped' + BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile' -class BareMetalServerBootTarget: +class BareMetalServerProfileBandwidth: """ - The resource from which this bare metal server is booted. - The resources supported by this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + BareMetalServerProfileBandwidth. """ @@ -30315,83 +35068,76 @@ def __init__( self, ) -> None: """ - Initialize a BareMetalServerBootTarget object. + Initialize a BareMetalServerProfileBandwidth object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerBootTargetBareMetalServerDiskReference']) + ", ".join(['BareMetalServerProfileBandwidthFixed', 'BareMetalServerProfileBandwidthRange', 'BareMetalServerProfileBandwidthEnum', 'BareMetalServerProfileBandwidthDependent']) ) raise Exception(msg) -class BareMetalServerCPU: +class BareMetalServerProfileCPUArchitecture: """ - The bare metal server CPU configuration. + BareMetalServerProfileCPUArchitecture. - :param str architecture: The CPU architecture. - :param int core_count: The total number of cores. - :param int socket_count: The total number of CPU sockets. - :param int threads_per_core: The total number of hardware threads per core. + :param str default: (optional) The default CPU architecture for a bare metal + server with this profile. + :param str type: The type for this profile field. + :param str value: The CPU architecture for a bare metal server with this + profile. """ def __init__( self, - architecture: str, - core_count: int, - socket_count: int, - threads_per_core: int, + type: str, + value: str, + *, + default: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerCPU object. + Initialize a BareMetalServerProfileCPUArchitecture object. - :param str architecture: The CPU architecture. - :param int core_count: The total number of cores. - :param int socket_count: The total number of CPU sockets. - :param int threads_per_core: The total number of hardware threads per core. + :param str type: The type for this profile field. + :param str value: The CPU architecture for a bare metal server with this + profile. + :param str default: (optional) The default CPU architecture for a bare + metal server with this profile. """ - self.architecture = architecture - self.core_count = core_count - self.socket_count = socket_count - self.threads_per_core = threads_per_core + self.default = default + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerCPU': - """Initialize a BareMetalServerCPU object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUArchitecture': + """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary.""" args = {} - if (architecture := _dict.get('architecture')) is not None: - args['architecture'] = architecture - else: - raise ValueError('Required property \'architecture\' not present in BareMetalServerCPU JSON') - if (core_count := _dict.get('core_count')) is not None: - args['core_count'] = core_count - else: - raise ValueError('Required property \'core_count\' not present in BareMetalServerCPU JSON') - if (socket_count := _dict.get('socket_count')) is not None: - args['socket_count'] = socket_count + if (default := _dict.get('default')) is not None: + args['default'] = default + if (type := _dict.get('type')) is not None: + args['type'] = type else: - raise ValueError('Required property \'socket_count\' not present in BareMetalServerCPU JSON') - if (threads_per_core := _dict.get('threads_per_core')) is not None: - args['threads_per_core'] = threads_per_core + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUArchitecture JSON') + if (value := _dict.get('value')) is not None: + args['value'] = value else: - raise ValueError('Required property \'threads_per_core\' not present in BareMetalServerCPU JSON') + raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUArchitecture JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerCPU object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUArchitecture 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, 'architecture') and self.architecture is not None: - _dict['architecture'] = self.architecture - if hasattr(self, 'core_count') and self.core_count is not None: - _dict['core_count'] = self.core_count - if hasattr(self, 'socket_count') and self.socket_count is not None: - _dict['socket_count'] = self.socket_count - if hasattr(self, 'threads_per_core') and self.threads_per_core is not None: - _dict['threads_per_core'] = self.threads_per_core + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -30399,104 +35145,141 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerCPU object.""" + """Return a `str` version of this BareMetalServerProfileCPUArchitecture object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerCPU') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUArchitecture') -> 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: 'BareMetalServerCPU') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + FIXED = 'fixed' -class BareMetalServerCollection: + + +class BareMetalServerProfileCPUCoreCount: """ - BareMetalServerCollection. + BareMetalServerProfileCPUCoreCount. - :param List[BareMetalServer] bare_metal_servers: A page of bare metal servers. - :param BareMetalServerCollectionFirst first: A link to the first page of - resources. + """ + + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileCPUCoreCount object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileCPUCoreCountFixed', 'BareMetalServerProfileCPUCoreCountRange', 'BareMetalServerProfileCPUCoreCountEnum', 'BareMetalServerProfileCPUCoreCountDependent']) + ) + raise Exception(msg) + + +class BareMetalServerProfileCPUSocketCount: + """ + BareMetalServerProfileCPUSocketCount. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileCPUSocketCount object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileCPUSocketCountFixed', 'BareMetalServerProfileCPUSocketCountRange', 'BareMetalServerProfileCPUSocketCountEnum', 'BareMetalServerProfileCPUSocketCountDependent']) + ) + raise Exception(msg) + + +class BareMetalServerProfileCollection: + """ + BareMetalServerProfileCollection. + + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param BareMetalServerCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. + :param List[BareMetalServerProfile] profiles: A page of bare metal server + profiles. :param int total_count: The total number of resources across all pages. """ def __init__( self, - bare_metal_servers: List['BareMetalServer'], - first: 'BareMetalServerCollectionFirst', + first: 'PageLink', limit: int, + profiles: List['BareMetalServerProfile'], total_count: int, *, - next: Optional['BareMetalServerCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a BareMetalServerCollection object. + Initialize a BareMetalServerProfileCollection object. - :param List[BareMetalServer] bare_metal_servers: A page of bare metal - servers. - :param BareMetalServerCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. + :param List[BareMetalServerProfile] profiles: A page of bare metal server + profiles. :param int total_count: The total number of resources across all pages. - :param BareMetalServerCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ - self.bare_metal_servers = bare_metal_servers self.first = first self.limit = limit self.next = next + self.profiles = profiles self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollection': - """Initialize a BareMetalServerCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollection': + """Initialize a BareMetalServerProfileCollection object from a json dictionary.""" args = {} - if (bare_metal_servers := _dict.get('bare_metal_servers')) is not None: - args['bare_metal_servers'] = [BareMetalServer.from_dict(v) for v in bare_metal_servers] - else: - raise ValueError('Required property \'bare_metal_servers\' not present in BareMetalServerCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = BareMetalServerCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'first\' not present in BareMetalServerCollection JSON') + raise ValueError('Required property \'first\' not present in BareMetalServerProfileCollection JSON') if (limit := _dict.get('limit')) is not None: args['limit'] = limit else: - raise ValueError('Required property \'limit\' not present in BareMetalServerCollection JSON') + raise ValueError('Required property \'limit\' not present in BareMetalServerProfileCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = BareMetalServerCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) + if (profiles := _dict.get('profiles')) is not None: + args['profiles'] = [BareMetalServerProfile.from_dict(v) for v in profiles] + else: + raise ValueError('Required property \'profiles\' not present in BareMetalServerProfileCollection JSON') if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: - raise ValueError('Required property \'total_count\' not present in BareMetalServerCollection JSON') + raise ValueError('Required property \'total_count\' not present in BareMetalServerProfileCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerCollection object from a json dictionary.""" + """Initialize a BareMetalServerProfileCollection 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, 'bare_metal_servers') and self.bare_metal_servers is not None: - bare_metal_servers_list = [] - for v in self.bare_metal_servers: - if isinstance(v, dict): - bare_metal_servers_list.append(v) - else: - bare_metal_servers_list.append(v.to_dict()) - _dict['bare_metal_servers'] = bare_metal_servers_list if hasattr(self, 'first') and self.first is not None: if isinstance(self.first, dict): _dict['first'] = self.first @@ -30509,6 +35292,14 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -30518,58 +35309,70 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerCollection object.""" + """Return a `str` version of this BareMetalServerProfileCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerCollection') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCollection') -> 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: 'BareMetalServerCollection') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerCollectionFirst: +class BareMetalServerProfileConsoleTypes: """ - A link to the first page of resources. + The console type configuration for a bare metal server with this profile. - :param str href: The URL for a page of resources. + :param str type: The type for this profile field. + :param List[str] values: The console types for a bare metal server with this + profile. """ def __init__( self, - href: str, + type: str, + values: List[str], ) -> None: """ - Initialize a BareMetalServerCollectionFirst object. + Initialize a BareMetalServerProfileConsoleTypes object. - :param str href: The URL for a page of resources. + :param str type: The type for this profile field. + :param List[str] values: The console types for a bare metal server with + this profile. """ - self.href = href + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollectionFirst': - """Initialize a BareMetalServerCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileConsoleTypes': + """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileConsoleTypes JSON') + if (values := _dict.get('values')) is not None: + args['values'] = values else: - raise ValueError('Required property \'href\' not present in BareMetalServerCollectionFirst JSON') + raise ValueError('Required property \'values\' not present in BareMetalServerProfileConsoleTypes JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerCollectionFirst object from a json dictionary.""" + """Initialize a BareMetalServerProfileConsoleTypes 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -30577,59 +35380,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerCollectionFirst object.""" + """Return a `str` version of this BareMetalServerProfileConsoleTypes object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerCollectionFirst') -> bool: + def __eq__(self, other: 'BareMetalServerProfileConsoleTypes') -> 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: 'BareMetalServerCollectionFirst') -> bool: + def __ne__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + + + class ValuesEnum(str, Enum): + """ + A console type. + """ + + SERIAL = 'serial' + VNC = 'vnc' + -class BareMetalServerCollectionNext: + +class BareMetalServerProfileDisk: """ - A link to the next page of resources. This property is present for all pages except - the last page. + Disks provided by this profile. - :param str href: The URL for a page of resources. + :param BareMetalServerProfileDiskQuantity quantity: + :param BareMetalServerProfileDiskSize size: + :param BareMetalServerProfileDiskSupportedInterfaces supported_interface_types: """ def __init__( self, - href: str, + quantity: 'BareMetalServerProfileDiskQuantity', + size: 'BareMetalServerProfileDiskSize', + supported_interface_types: 'BareMetalServerProfileDiskSupportedInterfaces', ) -> None: """ - Initialize a BareMetalServerCollectionNext object. + Initialize a BareMetalServerProfileDisk object. - :param str href: The URL for a page of resources. + :param BareMetalServerProfileDiskQuantity quantity: + :param BareMetalServerProfileDiskSize size: + :param BareMetalServerProfileDiskSupportedInterfaces + supported_interface_types: """ - self.href = href + self.quantity = quantity + self.size = size + self.supported_interface_types = supported_interface_types @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollectionNext': - """Initialize a BareMetalServerCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDisk': + """Initialize a BareMetalServerProfileDisk object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (quantity := _dict.get('quantity')) is not None: + args['quantity'] = quantity + else: + raise ValueError('Required property \'quantity\' not present in BareMetalServerProfileDisk JSON') + if (size := _dict.get('size')) is not None: + args['size'] = size + else: + raise ValueError('Required property \'size\' not present in BareMetalServerProfileDisk JSON') + if (supported_interface_types := _dict.get('supported_interface_types')) is not None: + args['supported_interface_types'] = BareMetalServerProfileDiskSupportedInterfaces.from_dict(supported_interface_types) else: - raise ValueError('Required property \'href\' not present in BareMetalServerCollectionNext JSON') + raise ValueError('Required property \'supported_interface_types\' not present in BareMetalServerProfileDisk JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerCollectionNext object from a json dictionary.""" + """Initialize a BareMetalServerProfileDisk 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, 'quantity') and self.quantity is not None: + if isinstance(self.quantity, dict): + _dict['quantity'] = self.quantity + else: + _dict['quantity'] = self.quantity.to_dict() + if hasattr(self, 'size') and self.size is not None: + if isinstance(self.size, dict): + _dict['size'] = self.size + else: + _dict['size'] = self.size.to_dict() + if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None: + if isinstance(self.supported_interface_types, dict): + _dict['supported_interface_types'] = self.supported_interface_types + else: + _dict['supported_interface_types'] = self.supported_interface_types.to_dict() return _dict def _to_dict(self): @@ -30637,281 +35486,157 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerCollectionNext object.""" + """Return a `str` version of this BareMetalServerProfileDisk object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerCollectionNext') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDisk') -> 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: 'BareMetalServerCollectionNext') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDisk') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerConsoleAccessToken: +class BareMetalServerProfileDiskQuantity: """ - The bare metal server console access token information. + BareMetalServerProfileDiskQuantity. - :param str access_token: A URL safe single-use token used to access the console - WebSocket. - :param str console_type: The bare metal server console type for which this token - may be used. - :param datetime created_at: The date and time that the access token was created. - :param datetime expires_at: The date and time that the access token will expire. - :param bool force: Indicates whether to disconnect an existing serial console - session as the serial console cannot be shared. This has no effect on VNC - consoles. - :param str href: The URL to access this bare metal server console. """ def __init__( self, - access_token: str, - console_type: str, - created_at: datetime, - expires_at: datetime, - force: bool, - href: str, ) -> None: """ - Initialize a BareMetalServerConsoleAccessToken object. + Initialize a BareMetalServerProfileDiskQuantity object. - :param str access_token: A URL safe single-use token used to access the - console WebSocket. - :param str console_type: The bare metal server console type for which this - token may be used. - :param datetime created_at: The date and time that the access token was - created. - :param datetime expires_at: The date and time that the access token will - expire. - :param bool force: Indicates whether to disconnect an existing serial - console session as the serial console cannot be shared. This has no effect - on VNC consoles. - :param str href: The URL to access this bare metal server console. """ - self.access_token = access_token - self.console_type = console_type - self.created_at = created_at - self.expires_at = expires_at - self.force = force - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerConsoleAccessToken': - """Initialize a BareMetalServerConsoleAccessToken object from a json dictionary.""" - args = {} - if (access_token := _dict.get('access_token')) is not None: - args['access_token'] = access_token - else: - raise ValueError('Required property \'access_token\' not present in BareMetalServerConsoleAccessToken JSON') - if (console_type := _dict.get('console_type')) is not None: - args['console_type'] = console_type - else: - raise ValueError('Required property \'console_type\' not present in BareMetalServerConsoleAccessToken JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - else: - raise ValueError('Required property \'created_at\' not present in BareMetalServerConsoleAccessToken JSON') - if (expires_at := _dict.get('expires_at')) is not None: - args['expires_at'] = string_to_datetime(expires_at) - else: - raise ValueError('Required property \'expires_at\' not present in BareMetalServerConsoleAccessToken JSON') - if (force := _dict.get('force')) is not None: - args['force'] = force - else: - raise ValueError('Required property \'force\' not present in BareMetalServerConsoleAccessToken JSON') - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BareMetalServerConsoleAccessToken JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerConsoleAccessToken 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, 'access_token') and self.access_token is not None: - _dict['access_token'] = self.access_token - if hasattr(self, 'console_type') and self.console_type is not None: - _dict['console_type'] = self.console_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, 'expires_at') and self.expires_at is not None: - _dict['expires_at'] = datetime_to_string(self.expires_at) - if hasattr(self, 'force') and self.force is not None: - _dict['force'] = self.force - 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() + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileDiskQuantityFixed', 'BareMetalServerProfileDiskQuantityRange', 'BareMetalServerProfileDiskQuantityEnum', 'BareMetalServerProfileDiskQuantityDependent']) + ) + raise Exception(msg) - def __str__(self) -> str: - """Return a `str` version of this BareMetalServerConsoleAccessToken object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerConsoleAccessToken') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ +class BareMetalServerProfileDiskSize: + """ + BareMetalServerProfileDiskSize. - def __ne__(self, other: 'BareMetalServerConsoleAccessToken') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + """ - class ConsoleTypeEnum(str, Enum): - """ - The bare metal server console type for which this token may be used. + def __init__( + self, + ) -> None: """ + Initialize a BareMetalServerProfileDiskSize object. - SERIAL = 'serial' - VNC = 'vnc' - + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileDiskSizeFixed', 'BareMetalServerProfileDiskSizeRange', 'BareMetalServerProfileDiskSizeEnum', 'BareMetalServerProfileDiskSizeDependent']) + ) + raise Exception(msg) -class BareMetalServerDisk: +class BareMetalServerProfileDiskSupportedInterfaces: """ - BareMetalServerDisk. + BareMetalServerProfileDiskSupportedInterfaces. - :param datetime created_at: The date and time that the disk was created. - :param str href: The URL for this bare metal server disk. - :param str id: The unique identifier for this bare metal server disk. - :param str interface_type: The disk attachment interface used: - - `fcp`: Fiber Channel Protocol - - `sata`: Serial Advanced Technology Attachment - - `nvme`: Non-Volatile Memory Express - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param str name: The name for this bare metal server disk. The name is unique - across all disks on the bare metal server. - :param str resource_type: The resource type. - :param int size: The size of the disk in GB (gigabytes). + :param str default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[str] values: The supported disk interfaces used for attaching the + disk. """ def __init__( self, - created_at: datetime, - href: str, - id: str, - interface_type: str, - name: str, - resource_type: str, - size: int, + default: str, + type: str, + values: List[str], ) -> None: """ - Initialize a BareMetalServerDisk object. + Initialize a BareMetalServerProfileDiskSupportedInterfaces object. - :param datetime created_at: The date and time that the disk was created. - :param str href: The URL for this bare metal server disk. - :param str id: The unique identifier for this bare metal server disk. - :param str interface_type: The disk attachment interface used: - - `fcp`: Fiber Channel Protocol - - `sata`: Serial Advanced Technology Attachment - - `nvme`: Non-Volatile Memory Express - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param str name: The name for this bare metal server disk. The name is - unique across all disks on the bare metal server. - :param str resource_type: The resource type. - :param int size: The size of the disk in GB (gigabytes). + :param str default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[str] values: The supported disk interfaces used for attaching + the disk. """ - self.created_at = created_at - self.href = href - self.id = id - self.interface_type = interface_type - self.name = name - self.resource_type = resource_type - self.size = size + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerDisk': - """Initialize a BareMetalServerDisk object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSupportedInterfaces': + """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary.""" args = {} - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - else: - raise ValueError('Required property \'created_at\' not present in BareMetalServerDisk JSON') - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BareMetalServerDisk JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in BareMetalServerDisk JSON') - if (interface_type := _dict.get('interface_type')) is not None: - args['interface_type'] = interface_type - else: - raise ValueError('Required property \'interface_type\' not present in BareMetalServerDisk JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name + if (default := _dict.get('default')) is not None: + args['default'] = default else: - raise ValueError('Required property \'name\' not present in BareMetalServerDisk JSON') - if (resource_type := _dict.get('resource_type')) is not None: - args['resource_type'] = resource_type + raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') + if (type := _dict.get('type')) is not None: + args['type'] = type else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerDisk JSON') - if (size := _dict.get('size')) is not None: - args['size'] = size + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') + if (values := _dict.get('values')) is not None: + args['values'] = values else: - raise ValueError('Required property \'size\' not present in BareMetalServerDisk JSON') + raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerDisk object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskSupportedInterfaces 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, '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 - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'size') and self.size is not None: - _dict['size'] = self.size + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values 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 BareMetalServerDisk object.""" - return json.dumps(self.to_dict(), indent=2) + def __str__(self) -> str: + """Return a `str` version of this BareMetalServerProfileDiskSupportedInterfaces object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> 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: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class DefaultEnum(str, Enum): + """ + The default value for this profile field. + """ + + FCP = 'fcp' + NVME = 'nvme' + SATA = 'sata' + - def __eq__(self, other: 'BareMetalServerDisk') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ - def __ne__(self, other: 'BareMetalServerDisk') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + ENUM = 'enum' - class InterfaceTypeEnum(str, Enum): + + class ValuesEnum(str, Enum): """ The disk attachment interface used: - `fcp`: Fiber Channel Protocol @@ -30927,120 +35652,145 @@ class InterfaceTypeEnum(str, Enum): SATA = 'sata' - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - BARE_METAL_SERVER_DISK = 'bare_metal_server_disk' +class BareMetalServerProfileIdentity: + """ + Identifies a bare metal server profile by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileIdentity object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileIdentityByName', 'BareMetalServerProfileIdentityByHref']) + ) + raise Exception(msg) -class BareMetalServerDiskCollection: +class BareMetalServerProfileMemory: """ - BareMetalServerDiskCollection. + BareMetalServerProfileMemory. - :param List[BareMetalServerDisk] disks: The disks for the bare metal server. """ def __init__( self, - disks: List['BareMetalServerDisk'], ) -> None: """ - Initialize a BareMetalServerDiskCollection object. + Initialize a BareMetalServerProfileMemory object. - :param List[BareMetalServerDisk] disks: The disks for the bare metal - server. """ - self.disks = disks + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileMemoryFixed', 'BareMetalServerProfileMemoryRange', 'BareMetalServerProfileMemoryEnum', 'BareMetalServerProfileMemoryDependent']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskCollection': - """Initialize a BareMetalServerDiskCollection object from a json dictionary.""" - args = {} - if (disks := _dict.get('disks')) is not None: - args['disks'] = [BareMetalServerDisk.from_dict(v) for v in disks] - else: - raise ValueError('Required property \'disks\' not present in BareMetalServerDiskCollection JSON') - return cls(**args) - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerDiskCollection object from a json dictionary.""" - return cls.from_dict(_dict) +class BareMetalServerProfileNetworkAttachmentCount: + """ + BareMetalServerProfileNetworkAttachmentCount. - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'disks') and self.disks is not None: - disks_list = [] - for v in self.disks: - if isinstance(v, dict): - disks_list.append(v) - else: - disks_list.append(v.to_dict()) - _dict['disks'] = disks_list - return _dict + """ - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileNetworkAttachmentCount object. - def __str__(self) -> str: - """Return a `str` version of this BareMetalServerDiskCollection object.""" - return json.dumps(self.to_dict(), indent=2) + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileNetworkAttachmentCountRange', 'BareMetalServerProfileNetworkAttachmentCountDependent']) + ) + raise Exception(msg) - def __eq__(self, other: 'BareMetalServerDiskCollection') -> 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: 'BareMetalServerDiskCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other +class BareMetalServerProfileNetworkInterfaceCount: + """ + BareMetalServerProfileNetworkInterfaceCount. + + """ + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileNetworkInterfaceCount object. -class BareMetalServerDiskPatch: + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileNetworkInterfaceCountRange', 'BareMetalServerProfileNetworkInterfaceCountDependent']) + ) + raise Exception(msg) + + +class BareMetalServerProfileOSArchitecture: """ - BareMetalServerDiskPatch. + BareMetalServerProfileOSArchitecture. - :param str name: (optional) The name for this bare metal server disk. The name - must not be used by another disk on the bare metal server. + :param str default: The default OS architecture for a bare metal server with + this profile. + :param str type: The type for this profile field. + :param List[str] values: The supported OS architecture(s) for a bare metal + server with this profile. """ def __init__( self, - *, - name: Optional[str] = None, + default: str, + type: str, + values: List[str], ) -> None: """ - Initialize a BareMetalServerDiskPatch object. + Initialize a BareMetalServerProfileOSArchitecture object. - :param str name: (optional) The name for this bare metal server disk. The - name must not be used by another disk on the bare metal server. + :param str default: The default OS architecture for a bare metal server + with this profile. + :param str type: The type for this profile field. + :param List[str] values: The supported OS architecture(s) for a bare metal + server with this profile. """ - self.name = name + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskPatch': - """Initialize a BareMetalServerDiskPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileOSArchitecture': + """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary.""" args = {} - if (name := _dict.get('name')) is not None: - args['name'] = name + if (default := _dict.get('default')) is not None: + args['default'] = default + else: + raise ValueError('Required property \'default\' not present in BareMetalServerProfileOSArchitecture JSON') + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileOSArchitecture JSON') + if (values := _dict.get('values')) is not None: + args['values'] = values + else: + raise ValueError('Required property \'values\' not present in BareMetalServerProfileOSArchitecture JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerDiskPatch object from a json dictionary.""" + """Initialize a BareMetalServerProfileOSArchitecture 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -31048,64 +35798,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerDiskPatch object.""" + """Return a `str` version of this BareMetalServerProfileOSArchitecture object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerDiskPatch') -> bool: + def __eq__(self, other: 'BareMetalServerProfileOSArchitecture') -> 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: 'BareMetalServerDiskPatch') -> bool: + def __ne__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + -class BareMetalServerFirmware: + +class BareMetalServerProfileReference: """ - Firmware information for the bare metal server. + BareMetalServerProfileReference. - :param str update: The type of update available. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. + :param str href: The URL for this bare metal server profile. + :param str name: The name for this bare metal server profile. + :param str resource_type: The resource type. """ def __init__( self, - update: str, + href: str, + name: str, + resource_type: str, ) -> None: """ - Initialize a BareMetalServerFirmware object. + Initialize a BareMetalServerProfileReference object. - :param str update: The type of update available. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. + :param str href: The URL for this bare metal server profile. + :param str name: The name for this bare metal server profile. + :param str resource_type: The resource type. """ - self.update = update + self.href = href + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerFirmware': - """Initialize a BareMetalServerFirmware object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileReference': + """Initialize a BareMetalServerProfileReference object from a json dictionary.""" args = {} - if (update := _dict.get('update')) is not None: - args['update'] = update + if (href := _dict.get('href')) is not None: + args['href'] = href else: - raise ValueError('Required property \'update\' not present in BareMetalServerFirmware JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerProfileReference JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in BareMetalServerProfileReference JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfileReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerFirmware object from a json dictionary.""" + """Initialize a BareMetalServerProfileReference 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, 'update') and self.update is not None: - _dict['update'] = self.update + 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 + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -31113,112 +35885,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerFirmware object.""" + """Return a `str` version of this BareMetalServerProfileReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerFirmware') -> bool: + def __eq__(self, other: 'BareMetalServerProfileReference') -> 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: 'BareMetalServerFirmware') -> bool: + def __ne__(self, other: 'BareMetalServerProfileReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class UpdateEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type of update available. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. + The resource type. """ - NONE = 'none' - OPTIONAL = 'optional' - REQUIRED = 'required' + BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile' -class BareMetalServerInitialization: +class BareMetalServerProfileSupportedTrustedPlatformModuleModes: """ - BareMetalServerInitialization. + The supported trusted platform module modes for this bare metal server profile. - :param ImageReference image: The image the bare metal server was provisioned - from. - :param List[KeyReference] keys: The public SSH keys used at initialization. - :param List[BareMetalServerInitializationUserAccount] user_accounts: The user - accounts that are created at initialization. There can be multiple account types - distinguished by the `resource_type` property. + :param str default: (optional) The default trusted platform module for a bare + metal server with this profile. + :param str type: The type for this profile field. + :param List[str] values: The supported trusted platform module modes. """ def __init__( self, - image: 'ImageReference', - keys: List['KeyReference'], - user_accounts: List['BareMetalServerInitializationUserAccount'], + type: str, + values: List[str], + *, + default: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerInitialization object. + Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object. - :param ImageReference image: The image the bare metal server was - provisioned from. - :param List[KeyReference] keys: The public SSH keys used at initialization. - :param List[BareMetalServerInitializationUserAccount] user_accounts: The - user accounts that are created at initialization. There can be multiple - account types distinguished by the `resource_type` property. + :param str type: The type for this profile field. + :param List[str] values: The supported trusted platform module modes. + :param str default: (optional) The default trusted platform module for a + bare metal server with this profile. """ - self.image = image - self.keys = keys - self.user_accounts = user_accounts + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitialization': - """Initialize a BareMetalServerInitialization object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileSupportedTrustedPlatformModuleModes': + """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary.""" args = {} - if (image := _dict.get('image')) is not None: - args['image'] = ImageReference.from_dict(image) - else: - raise ValueError('Required property \'image\' not present in BareMetalServerInitialization JSON') - if (keys := _dict.get('keys')) is not None: - args['keys'] = [KeyReference.from_dict(v) for v in keys] + if (default := _dict.get('default')) is not None: + args['default'] = default + if (type := _dict.get('type')) is not None: + args['type'] = type else: - raise ValueError('Required property \'keys\' not present in BareMetalServerInitialization JSON') - if (user_accounts := _dict.get('user_accounts')) is not None: - args['user_accounts'] = user_accounts + raise ValueError('Required property \'type\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON') + if (values := _dict.get('values')) is not None: + args['values'] = values else: - raise ValueError('Required property \'user_accounts\' not present in BareMetalServerInitialization JSON') + raise ValueError('Required property \'values\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerInitialization object from a json dictionary.""" + """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes 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, 'image') and self.image is not None: - if isinstance(self.image, dict): - _dict['image'] = self.image - else: - _dict['image'] = self.image.to_dict() - if hasattr(self, 'keys') and self.keys is not None: - keys_list = [] - for v in self.keys: - if isinstance(v, dict): - keys_list.append(v) - else: - keys_list.append(v.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'user_accounts') and self.user_accounts is not None: - user_accounts_list = [] - for v in self.user_accounts: - if isinstance(v, dict): - user_accounts_list.append(v) - else: - user_accounts_list.append(v.to_dict()) - _dict['user_accounts'] = user_accounts_list + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -31226,106 +35973,99 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerInitialization object.""" + """Return a `str` version of this BareMetalServerProfileSupportedTrustedPlatformModuleModes object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerInitialization') -> bool: + def __eq__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> 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: 'BareMetalServerInitialization') -> bool: + def __ne__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DefaultEnum(str, Enum): + """ + The default trusted platform module for a bare metal server with this profile. + """ + + DISABLED = 'disabled' + TPM_2 = 'tpm_2' + -class BareMetalServerInitializationPrototype: + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + + + class ValuesEnum(str, Enum): + """ + The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + DISABLED = 'disabled' + TPM_2 = 'tpm_2' + + + +class BareMetalServerProfileVirtualNetworkInterfacesSupported: """ - BareMetalServerInitializationPrototype. + Indicates whether this profile supports virtual network interfaces. - :param ImageIdentity image: The image to be used when provisioning the bare - metal server. - :param List[KeyIdentity] keys: The public SSH keys to install on the bare metal - server. Keys will be made available to the bare metal server as cloud-init - vendor data. For cloud-init enabled images, these keys will also be added as SSH - authorized keys for the administrative user. - For Windows images, at least one key must be specified, and one will be selected - to encrypt the administrator password. Keys are optional for other images, but - if no keys are specified, the instance will be inaccessible unless the specified - image provides another means of access. - :param str user_data: (optional) User data to be made available when - initializing the bare metal server. - If unspecified, no user data will be made available. + :param str type: The type for this profile field. + :param bool value: The value for this profile field. """ def __init__( self, - image: 'ImageIdentity', - keys: List['KeyIdentity'], - *, - user_data: Optional[str] = None, + type: str, + value: bool, ) -> None: """ - Initialize a BareMetalServerInitializationPrototype object. + Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported object. - :param ImageIdentity image: The image to be used when provisioning the bare - metal server. - :param List[KeyIdentity] keys: The public SSH keys to install on the bare - metal server. Keys will be made available to the bare metal server as - cloud-init vendor data. For cloud-init enabled images, these keys will also - be added as SSH authorized keys for the administrative user. - For Windows images, at least one key must be specified, and one will be - selected to encrypt the administrator password. Keys are optional for other - images, but if no keys are specified, the instance will be inaccessible - unless the specified image provides another means of access. - :param str user_data: (optional) User data to be made available when - initializing the bare metal server. - If unspecified, no user data will be made available. + :param str type: The type for this profile field. + :param bool value: The value for this profile field. """ - self.image = image - self.keys = keys - self.user_data = user_data + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationPrototype': - """Initialize a BareMetalServerInitializationPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileVirtualNetworkInterfacesSupported': + """Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported object from a json dictionary.""" args = {} - if (image := _dict.get('image')) is not None: - args['image'] = image + if (type := _dict.get('type')) is not None: + args['type'] = type else: - raise ValueError('Required property \'image\' not present in BareMetalServerInitializationPrototype JSON') - if (keys := _dict.get('keys')) is not None: - args['keys'] = keys + raise ValueError('Required property \'type\' not present in BareMetalServerProfileVirtualNetworkInterfacesSupported JSON') + if (value := _dict.get('value')) is not None: + args['value'] = value else: - raise ValueError('Required property \'keys\' not present in BareMetalServerInitializationPrototype JSON') - if (user_data := _dict.get('user_data')) is not None: - args['user_data'] = user_data + raise ValueError('Required property \'value\' not present in BareMetalServerProfileVirtualNetworkInterfacesSupported JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerInitializationPrototype object from a json dictionary.""" + """Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported 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, 'image') and self.image is not None: - if isinstance(self.image, dict): - _dict['image'] = self.image - else: - _dict['image'] = self.image.to_dict() - if hasattr(self, 'keys') and self.keys is not None: - keys_list = [] - for v in self.keys: - if isinstance(v, dict): - keys_list.append(v) - else: - keys_list.append(v.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -31333,53 +36073,129 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerInitializationPrototype object.""" + """Return a `str` version of this BareMetalServerProfileVirtualNetworkInterfacesSupported object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerInitializationPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerProfileVirtualNetworkInterfacesSupported') -> 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: 'BareMetalServerInitializationPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerProfileVirtualNetworkInterfacesSupported') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class BareMetalServerInitializationUserAccount: + FIXED = 'fixed' + + + +class BareMetalServerPrototype: """ - BareMetalServerInitializationUserAccount. + BareMetalServerPrototype. + :param int bandwidth: (optional) The total bandwidth (in megabits per second) + shared across the bare metal server's network interfaces. The specified value + must match one of the bandwidth values in the bare metal server's profile. If + unspecified, the default value from the profile will be used. + :param bool enable_secure_boot: (optional) Indicates whether secure boot is + enabled. If enabled, the image must support secure boot or the server will fail + to boot. + :param BareMetalServerInitializationPrototype initialization: + :param str name: (optional) The name for this bare metal server. The name must + not be used by another bare metal server in the region. If unspecified, the name + will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. + :param BareMetalServerProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + to use for this bare metal server. + :param ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. + :param BareMetalServerTrustedPlatformModulePrototype trusted_platform_module: + (optional) + :param VPCIdentity vpc: (optional) The VPC this bare metal server will reside + in. + If specified, it must match the VPC for the subnets that the network attachments + or + network interfaces of the bare metal server are attached to. + :param ZoneIdentity zone: The zone this bare metal server will reside in. """ def __init__( self, + initialization: 'BareMetalServerInitializationPrototype', + profile: 'BareMetalServerProfileIdentity', + zone: 'ZoneIdentity', + *, + bandwidth: Optional[int] = None, + enable_secure_boot: Optional[bool] = None, + name: Optional[str] = None, + resource_group: Optional['ResourceGroupIdentity'] = None, + trusted_platform_module: Optional['BareMetalServerTrustedPlatformModulePrototype'] = None, + vpc: Optional['VPCIdentity'] = None, ) -> None: """ - Initialize a BareMetalServerInitializationUserAccount object. + Initialize a BareMetalServerPrototype object. + :param BareMetalServerInitializationPrototype initialization: + :param BareMetalServerProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + to use for this bare metal server. + :param ZoneIdentity zone: The zone this bare metal server will reside in. + :param int bandwidth: (optional) The total bandwidth (in megabits per + second) shared across the bare metal server's network interfaces. The + specified value must match one of the bandwidth values in the bare metal + server's profile. If unspecified, the default value from the profile will + be used. + :param bool enable_secure_boot: (optional) Indicates whether secure boot is + enabled. If enabled, the image must support secure boot or the server will + fail to boot. + :param str name: (optional) The name for this bare metal server. The name + must not be used by another bare metal server in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be + used. + :param BareMetalServerTrustedPlatformModulePrototype + trusted_platform_module: (optional) + :param VPCIdentity vpc: (optional) The VPC this bare metal server will + reside in. + If specified, it must match the VPC for the subnets that the network + attachments or + network interfaces of the bare metal server are attached to. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount']) + ", ".join(['BareMetalServerPrototypeBareMetalServerByNetworkAttachment', 'BareMetalServerPrototypeBareMetalServerByNetworkInterface']) ) raise Exception(msg) -class BareMetalServerLifecycleReason: +class BareMetalServerStatusReason: """ - BareMetalServerLifecycleReason. + BareMetalServerStatusReason. - :param str code: A reason code for this lifecycle state: - - `internal_error`: internal error (contact IBM support) - - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - support) + :param str code: The status reason code: + - `cannot_start`: Failed to start due to an internal error + - `cannot_start_capacity`: Insufficient capacity within the selected zone + - `cannot_start_compute`: An error occurred while allocating compute resources + - `cannot_start_ip_address`: An error occurred while allocating an IP address + - `cannot_start_network`: An error occurred while allocating network resources + - `cannot_update_firmware`: An error occurred while updating bare metal server + firmware The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param str message: An explanation of the reason for this lifecycle state. - :param str more_info: (optional) Link to documentation about the reason for this - lifecycle state. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status reason. """ def __init__( @@ -31390,43 +36206,49 @@ def __init__( more_info: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerLifecycleReason object. + Initialize a BareMetalServerStatusReason object. - :param str code: A reason code for this lifecycle state: - - `internal_error`: internal error (contact IBM support) - - `resource_suspended_by_provider`: The resource has been suspended - (contact IBM - support) + :param str code: The status reason code: + - `cannot_start`: Failed to start due to an internal error + - `cannot_start_capacity`: Insufficient capacity within the selected zone + - `cannot_start_compute`: An error occurred while allocating compute + resources + - `cannot_start_ip_address`: An error occurred while allocating an IP + address + - `cannot_start_network`: An error occurred while allocating network + resources + - `cannot_update_firmware`: An error occurred while updating bare metal + server firmware The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param str message: An explanation of the reason for this lifecycle state. - :param str more_info: (optional) Link to documentation about the reason for - this lifecycle state. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status + reason. """ self.code = code self.message = message self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerLifecycleReason': - """Initialize a BareMetalServerLifecycleReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerStatusReason': + """Initialize a BareMetalServerStatusReason object from a json dictionary.""" args = {} if (code := _dict.get('code')) is not None: args['code'] = code else: - raise ValueError('Required property \'code\' not present in BareMetalServerLifecycleReason JSON') + raise ValueError('Required property \'code\' not present in BareMetalServerStatusReason JSON') if (message := _dict.get('message')) is not None: args['message'] = message else: - raise ValueError('Required property \'message\' not present in BareMetalServerLifecycleReason JSON') + raise ValueError('Required property \'message\' not present in BareMetalServerStatusReason JSON') if (more_info := _dict.get('more_info')) is not None: args['more_info'] = more_info return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerLifecycleReason object from a json dictionary.""" + """Initialize a BareMetalServerStatusReason object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -31445,302 +36267,114 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerLifecycleReason object.""" + """Return a `str` version of this BareMetalServerStatusReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerLifecycleReason') -> bool: + def __eq__(self, other: 'BareMetalServerStatusReason') -> 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: 'BareMetalServerLifecycleReason') -> bool: + def __ne__(self, other: 'BareMetalServerStatusReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class CodeEnum(str, Enum): """ - A reason code for this lifecycle state: - - `internal_error`: internal error (contact IBM support) - - `resource_suspended_by_provider`: The resource has been suspended (contact IBM - support) + The status reason code: + - `cannot_start`: Failed to start due to an internal error + - `cannot_start_capacity`: Insufficient capacity within the selected zone + - `cannot_start_compute`: An error occurred while allocating compute resources + - `cannot_start_ip_address`: An error occurred while allocating an IP address + - `cannot_start_network`: An error occurred while allocating network resources + - `cannot_update_firmware`: An error occurred while updating bare metal server + firmware The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. """ - INTERNAL_ERROR = 'internal_error' - RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' + CANNOT_REINITIALIZE = 'cannot_reinitialize' + CANNOT_START = 'cannot_start' + CANNOT_START_CAPACITY = 'cannot_start_capacity' + CANNOT_START_COMPUTE = 'cannot_start_compute' + CANNOT_START_IP_ADDRESS = 'cannot_start_ip_address' + CANNOT_START_NETWORK = 'cannot_start_network' + CANNOT_UPDATE_FIRMWARE = 'cannot_update_firmware' -class BareMetalServerNetworkAttachment: +class BareMetalServerTrustedPlatformModule: """ - BareMetalServerNetworkAttachment. + BareMetalServerTrustedPlatformModule. - :param datetime created_at: The date and time that the bare metal server network - attachment was created. - :param str href: The URL for this bare metal server network attachment. - :param str id: The unique identifier for this bare metal server network - attachment. - :param str interface_type: The network attachment's interface type: - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in - its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param str lifecycle_state: The lifecycle state of the bare metal server network - attachment. - :param str name: The name for this bare metal server network attachment. The - name is unique across all network attachments for the bare metal server. - :param int port_speed: The port speed for this bare metal server network - attachment in Mbps. - :param ReservedIPReference primary_ip: The primary IP address of the virtual - network interface for the bare metal server - network attachment. - :param str resource_type: The resource type. - :param SubnetReference subnet: The subnet of the virtual network interface for - the bare metal server network - attachment. - :param str type: The bare metal server network attachment type. + :param bool enabled: Indicates whether the trusted platform module is enabled. + :param str mode: The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface: The virtual network interface for this bare metal - server network attachment. + :param List[str] supported_modes: The supported trusted platform module modes. """ def __init__( self, - created_at: datetime, - href: str, - id: str, - interface_type: str, - lifecycle_state: str, - name: str, - port_speed: int, - primary_ip: 'ReservedIPReference', - resource_type: str, - subnet: 'SubnetReference', - type: str, - virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext', + enabled: bool, + mode: str, + supported_modes: List[str], ) -> None: """ - Initialize a BareMetalServerNetworkAttachment object. + Initialize a BareMetalServerTrustedPlatformModule object. - :param datetime created_at: The date and time that the bare metal server - network attachment was created. - :param str href: The URL for this bare metal server network attachment. - :param str id: The unique identifier for this bare metal server network - attachment. - :param str interface_type: The network attachment's interface type: - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` - in its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param str lifecycle_state: The lifecycle state of the bare metal server - network attachment. - :param str name: The name for this bare metal server network attachment. - The name is unique across all network attachments for the bare metal - server. - :param int port_speed: The port speed for this bare metal server network - attachment in Mbps. - :param ReservedIPReference primary_ip: The primary IP address of the - virtual network interface for the bare metal server - network attachment. - :param str resource_type: The resource type. - :param SubnetReference subnet: The subnet of the virtual network interface - for the bare metal server network - attachment. - :param str type: The bare metal server network attachment type. + :param bool enabled: Indicates whether the trusted platform module is + enabled. + :param str mode: The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface: The virtual network interface for this bare - metal server network attachment. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkAttachmentByPCI', 'BareMetalServerNetworkAttachmentByVLAN']) - ) - raise Exception(msg) - - class InterfaceTypeEnum(str, Enum): - """ - The network attachment's interface type: - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ - - PCI = 'pci' - VLAN = 'vlan' - - - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the bare metal server network attachment. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment' - - - class TypeEnum(str, Enum): - """ - The bare metal server network attachment type. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ - - PRIMARY = 'primary' - SECONDARY = 'secondary' - - - -class BareMetalServerNetworkAttachmentCollection: - """ - BareMetalServerNetworkAttachmentCollection. - - :param BareMetalServerNetworkAttachmentCollectionFirst first: A link to the - first page of resources. - :param int limit: The maximum number of resources that can be returned by the - request. - :param List[BareMetalServerNetworkAttachment] network_attachments: The network - attachments for the bare metal server. - :param BareMetalServerNetworkAttachmentCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages - except the last page. - :param int total_count: The total number of resources across all pages. - """ - - def __init__( - self, - first: 'BareMetalServerNetworkAttachmentCollectionFirst', - limit: int, - network_attachments: List['BareMetalServerNetworkAttachment'], - total_count: int, - *, - next: Optional['BareMetalServerNetworkAttachmentCollectionNext'] = None, - ) -> None: - """ - Initialize a BareMetalServerNetworkAttachmentCollection object. - - :param BareMetalServerNetworkAttachmentCollectionFirst first: A link to the - first page of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[BareMetalServerNetworkAttachment] network_attachments: The - network attachments for the bare metal server. - :param int total_count: The total number of resources across all pages. - :param BareMetalServerNetworkAttachmentCollectionNext next: (optional) A - link to the next page of resources. This property is present for all pages - except the last page. + :param List[str] supported_modes: The supported trusted platform module + modes. """ - self.first = first - self.limit = limit - self.network_attachments = network_attachments - self.next = next - self.total_count = total_count + self.enabled = enabled + self.mode = mode + self.supported_modes = supported_modes @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentCollection': - """Initialize a BareMetalServerNetworkAttachmentCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModule': + """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary.""" args = {} - if (first := _dict.get('first')) is not None: - args['first'] = BareMetalServerNetworkAttachmentCollectionFirst.from_dict(first) - else: - raise ValueError('Required property \'first\' not present in BareMetalServerNetworkAttachmentCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit + if (enabled := _dict.get('enabled')) is not None: + args['enabled'] = enabled else: - raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkAttachmentCollection JSON') - if (network_attachments := _dict.get('network_attachments')) is not None: - args['network_attachments'] = network_attachments + raise ValueError('Required property \'enabled\' not present in BareMetalServerTrustedPlatformModule JSON') + if (mode := _dict.get('mode')) is not None: + args['mode'] = mode else: - raise ValueError('Required property \'network_attachments\' not present in BareMetalServerNetworkAttachmentCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = BareMetalServerNetworkAttachmentCollectionNext.from_dict(next) - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count + raise ValueError('Required property \'mode\' not present in BareMetalServerTrustedPlatformModule JSON') + if (supported_modes := _dict.get('supported_modes')) is not None: + args['supported_modes'] = supported_modes else: - raise ValueError('Required property \'total_count\' not present in BareMetalServerNetworkAttachmentCollection JSON') + raise ValueError('Required property \'supported_modes\' not present in BareMetalServerTrustedPlatformModule JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkAttachmentCollection object from a json dictionary.""" + """Initialize a BareMetalServerTrustedPlatformModule 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'network_attachments') and self.network_attachments is not None: - network_attachments_list = [] - for v in self.network_attachments: - if isinstance(v, dict): - network_attachments_list.append(v) - else: - network_attachments_list.append(v.to_dict()) - _dict['network_attachments'] = network_attachments_list - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'enabled') and self.enabled is not None: + _dict['enabled'] = self.enabled + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode + if hasattr(self, 'supported_modes') and self.supported_modes is not None: + _dict['supported_modes'] = self.supported_modes return _dict def _to_dict(self): @@ -31748,192 +36382,92 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkAttachmentCollection object.""" + """Return a `str` version of this BareMetalServerTrustedPlatformModule object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkAttachmentCollection') -> bool: + def __eq__(self, other: 'BareMetalServerTrustedPlatformModule') -> 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: 'BareMetalServerNetworkAttachmentCollection') -> bool: + def __ne__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class BareMetalServerNetworkAttachmentCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: + class ModeEnum(str, Enum): """ - Initialize a BareMetalServerNetworkAttachmentCollectionFirst object. - - :param str href: The URL for a page of resources. + The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentCollectionFirst': - """Initialize a BareMetalServerNetworkAttachmentCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkAttachmentCollectionFirst 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 BareMetalServerNetworkAttachmentCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerNetworkAttachmentCollectionFirst') -> 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: 'BareMetalServerNetworkAttachmentCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class BareMetalServerNetworkAttachmentCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - :param str href: The URL for a page of resources. - """ + DISABLED = 'disabled' + TPM_2 = 'tpm_2' - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a BareMetalServerNetworkAttachmentCollectionNext object. - :param str href: The URL for a page of resources. + class SupportedModesEnum(str, Enum): + """ + The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentCollectionNext': - """Initialize a BareMetalServerNetworkAttachmentCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkAttachmentCollectionNext 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 BareMetalServerNetworkAttachmentCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerNetworkAttachmentCollectionNext') -> 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: 'BareMetalServerNetworkAttachmentCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + DISABLED = 'disabled' + TPM_2 = 'tpm_2' -class BareMetalServerNetworkAttachmentPatch: + +class BareMetalServerTrustedPlatformModulePatch: """ - BareMetalServerNetworkAttachmentPatch. + BareMetalServerTrustedPlatformModulePatch. - :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` - attachments using this PCI attachment, replacing any existing VLAN IDs. The - specified values must include IDs for all `vlan` attachments currently using - this PCI attachment. - :param str name: (optional) The name for this network attachment. The name must - not be used by another network attachment for the bare metal server. + :param str mode: (optional) The trusted platform module mode to use. The + specified value must be listed in the bare metal server's `supported_modes`. + For the trusted platform module mode to be changed, the bare metal server + `status` must be `stopped`. """ def __init__( self, *, - allowed_vlans: Optional[List[int]] = None, - name: Optional[str] = None, + mode: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerNetworkAttachmentPatch object. + Initialize a BareMetalServerTrustedPlatformModulePatch object. - :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` - attachments using this PCI attachment, replacing any existing VLAN IDs. The - specified values must include IDs for all `vlan` attachments currently - using this PCI attachment. - :param str name: (optional) The name for this network attachment. The name - must not be used by another network attachment for the bare metal server. + :param str mode: (optional) The trusted platform module mode to use. The + specified value must be listed in the bare metal server's + `supported_modes`. + For the trusted platform module mode to be changed, the bare metal server + `status` must be `stopped`. """ - self.allowed_vlans = allowed_vlans - self.name = name + self.mode = mode @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPatch': - """Initialize a BareMetalServerNetworkAttachmentPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePatch': + """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary.""" args = {} - if (allowed_vlans := _dict.get('allowed_vlans')) is not None: - args['allowed_vlans'] = allowed_vlans - if (name := _dict.get('name')) is not None: - args['name'] = name + if (mode := _dict.get('mode')) is not None: + args['mode'] = mode return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkAttachmentPatch object from a json dictionary.""" + """Initialize a BareMetalServerTrustedPlatformModulePatch 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, 'allowed_vlans') and self.allowed_vlans is not None: - _dict['allowed_vlans'] = self.allowed_vlans - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -31941,283 +36475,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkAttachmentPatch object.""" + """Return a `str` version of this BareMetalServerTrustedPlatformModulePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkAttachmentPatch') -> bool: + def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> 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: 'BareMetalServerNetworkAttachmentPatch') -> bool: + def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class BareMetalServerNetworkAttachmentPrototype: - """ - BareMetalServerNetworkAttachmentPrototype. - - :param str interface_type: The network attachment's interface type: - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in - its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :param str name: (optional) The name for this bare metal server network - attachment. Names must be unique within the bare metal server the network - attachment resides in. If unspecified, the name will be a hyphenated list of - randomly-selected words. - :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface - virtual_network_interface: A virtual network interface for the bare metal server - network attachment. This can be - specified using an existing virtual network interface, or a prototype object for - a new - virtual network interface. - If an existing virtual network interface is specified, it must not be the target - of a flow - log collector. - """ - - def __init__( - self, - interface_type: str, - virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface', - *, - name: Optional[str] = None, - ) -> None: - """ - Initialize a BareMetalServerNetworkAttachmentPrototype object. - - :param str interface_type: The network attachment's interface type: - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` - in its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x`. - :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface - virtual_network_interface: A virtual network interface for the bare metal - server network attachment. This can be - specified using an existing virtual network interface, or a prototype - object for a new - virtual network interface. - If an existing virtual network interface is specified, it must not be the - target of a flow - log collector. - :param str name: (optional) The name for this bare metal server network - attachment. Names must be unique within the bare metal server the network - attachment resides in. If unspecified, the name will be a hyphenated list - of randomly-selected words. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype', 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype']) - ) - raise Exception(msg) - - class InterfaceTypeEnum(str, Enum): + class ModeEnum(str, Enum): """ - The network attachment's interface type: - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + The trusted platform module mode to use. The specified value must be listed in the + bare metal server's `supported_modes`. + For the trusted platform module mode to be changed, the bare metal server `status` + must be `stopped`. """ - PCI = 'pci' - VLAN = 'vlan' - - - -class BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface: - """ - A virtual network interface for the bare metal server network attachment. This can be - specified using an existing virtual network interface, or a prototype object for a new - virtual network interface. - If an existing virtual network interface is specified, it must not be the target of a - flow log collector. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface object. + DISABLED = 'disabled' + TPM_2 = 'tpm_2' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext', 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity']) - ) - raise Exception(msg) -class BareMetalServerNetworkAttachmentReference: +class BareMetalServerTrustedPlatformModulePrototype: """ - BareMetalServerNetworkAttachmentReference. + BareMetalServerTrustedPlatformModulePrototype. - :param Deleted deleted: (optional) If present, this property indicates the - referenced resource has been deleted, and provides - some supplementary information. - :param str href: The URL for this bare metal server network attachment. - :param str id: The unique identifier for this bare metal server network - attachment. - :param str name: The name for this bare metal server network attachment. The - name is unique across all network attachments for the bare metal server. - :param ReservedIPReference primary_ip: The primary IP address of the virtual - network interface for the bare metal server - network attachment. - :param str resource_type: The resource type. - :param SubnetReference subnet: The subnet of the virtual network interface for - the bare metal server network - attachment. - :param VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface: The virtual network interface for this bare metal - server network attachment. + :param str mode: (optional) The trusted platform module mode to use. The + specified value must be listed in the bare metal server profile's + `supported_trusted_platform_module_modes`. + If unspecified, the default trusted platform module mode from the profile will + be used. """ def __init__( self, - href: str, - id: str, - name: str, - primary_ip: 'ReservedIPReference', - resource_type: str, - subnet: 'SubnetReference', - virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext', *, - deleted: Optional['Deleted'] = None, + mode: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerNetworkAttachmentReference object. + Initialize a BareMetalServerTrustedPlatformModulePrototype object. - :param str href: The URL for this bare metal server network attachment. - :param str id: The unique identifier for this bare metal server network - attachment. - :param str name: The name for this bare metal server network attachment. - The name is unique across all network attachments for the bare metal - server. - :param ReservedIPReference primary_ip: The primary IP address of the - virtual network interface for the bare metal server - network attachment. - :param str resource_type: The resource type. - :param SubnetReference subnet: The subnet of the virtual network interface - for the bare metal server network - attachment. - :param VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface: The virtual network interface for this bare - metal server network attachment. - :param Deleted deleted: (optional) If present, this property indicates the - referenced resource has been deleted, and provides - some supplementary information. + :param str mode: (optional) The trusted platform module mode to use. The + specified value must be listed in the bare metal server profile's + `supported_trusted_platform_module_modes`. + If unspecified, the default trusted platform module mode from the profile + will be used. """ - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.primary_ip = primary_ip - self.resource_type = resource_type - self.subnet = subnet - self.virtual_network_interface = virtual_network_interface + self.mode = mode @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentReference': - """Initialize a BareMetalServerNetworkAttachmentReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePrototype': + """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary.""" args = {} - if (deleted := _dict.get('deleted')) is not None: - args['deleted'] = Deleted.from_dict(deleted) - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentReference JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in BareMetalServerNetworkAttachmentReference JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - else: - raise ValueError('Required property \'name\' not present in BareMetalServerNetworkAttachmentReference JSON') - if (primary_ip := _dict.get('primary_ip')) is not None: - args['primary_ip'] = ReservedIPReference.from_dict(primary_ip) - else: - raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkAttachmentReference JSON') - if (resource_type := _dict.get('resource_type')) is not None: - args['resource_type'] = resource_type - else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkAttachmentReference JSON') - if (subnet := _dict.get('subnet')) is not None: - args['subnet'] = SubnetReference.from_dict(subnet) - else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkAttachmentReference JSON') - if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None: - args['virtual_network_interface'] = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface) - else: - raise ValueError('Required property \'virtual_network_interface\' not present in BareMetalServerNetworkAttachmentReference JSON') + if (mode := _dict.get('mode')) is not None: + args['mode'] = mode return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkAttachmentReference object from a json dictionary.""" + """Initialize a BareMetalServerTrustedPlatformModulePrototype 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, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_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 - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip - else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() - if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None: - if isinstance(self.virtual_network_interface, dict): - _dict['virtual_network_interface'] = self.virtual_network_interface - else: - _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict() + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -32225,517 +36553,151 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkAttachmentReference object.""" + """Return a `str` version of this BareMetalServerTrustedPlatformModulePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkAttachmentReference') -> bool: + def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> 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: 'BareMetalServerNetworkAttachmentReference') -> bool: + def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class ModeEnum(str, Enum): """ - The resource type. + The trusted platform module mode to use. The specified value must be listed in the + bare metal server profile's `supported_trusted_platform_module_modes`. + If unspecified, the default trusted platform module mode from the profile will be + used. """ - BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment' + DISABLED = 'disabled' + TPM_2 = 'tpm_2' -class BareMetalServerNetworkInterface: +class CatalogOfferingIdentity: """ - BareMetalServerNetworkInterface. + Identifies a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + by a unique property. - :param bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed - on this bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and source IP spoofing is managed on the attached virtual network - interface. - :param datetime created_at: The date and time that the bare metal server network - interface was created. - If this bare metal server has network attachments, this network interface was - created as a [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - when its corresponding network attachment was created. - :param bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the bare metal server network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and infrastructure NAT is managed on the attached virtual network - interface. - :param List[FloatingIPReference] floating_ips: The floating IPs associated with - this bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the floating IPs are associated with the attached virtual network - interface. - :param str href: The URL for this bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment. - :param str id: The unique identifier for this bare metal server network - interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the identifier is that of the corresponding network attachment. - :param str interface_type: The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - within a `s390x` based system - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in - its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the interface type is that of the corresponding network - attachment. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param str mac_address: The MAC address of this bare metal server network - interface. If the MAC address has not yet been selected, the value will be - empty. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the MAC address is that of the attached virtual network - interface. - :param str name: The name for this bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the name matches its corresponding network attachment. - :param int port_speed: The bare metal server network interface port speed in - Mbps. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the port speed is that of its corresponding network attachment. - :param ReservedIPReference primary_ip: - :param str resource_type: The resource type. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the security groups are associated with the attached virtual - network interface. - :param str status: The status of the bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - read-only representation of its corresponding network attachment and its - attached virtual network interface, and the status is [computed from - them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). - :param SubnetReference subnet: The associated subnet. - :param str type: The bare metal server network interface type. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the type is that of its corresponding network attachment. """ def __init__( self, - allow_ip_spoofing: bool, - created_at: datetime, - enable_infrastructure_nat: bool, - floating_ips: List['FloatingIPReference'], - href: str, - id: str, - interface_type: str, - mac_address: str, - name: str, - port_speed: int, - primary_ip: 'ReservedIPReference', - resource_type: str, - security_groups: List['SecurityGroupReference'], - status: str, - subnet: 'SubnetReference', - type: str, ) -> None: """ - Initialize a BareMetalServerNetworkInterface object. + Initialize a CatalogOfferingIdentity object. - :param bool allow_ip_spoofing: Indicates whether source IP spoofing is - allowed on this bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and source IP spoofing is managed on the attached virtual - network interface. - :param datetime created_at: The date and time that the bare metal server - network interface was created. - If this bare metal server has network attachments, this network interface - was created as a [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - when its corresponding network attachment was created. - :param bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the bare metal server network - interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and infrastructure NAT is managed on the attached virtual - network interface. - :param List[FloatingIPReference] floating_ips: The floating IPs associated - with this bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the floating IPs are associated with the attached virtual - network interface. - :param str href: The URL for this bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment. - :param str id: The unique identifier for this bare metal server network - interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the identifier is that of the corresponding network - attachment. - :param str interface_type: The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP - connectivity - within a `s390x` based system - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` - in its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Has its own security groups and does not inherit those of the PCI - device through - which traffic flows. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the interface type is that of the corresponding network - attachment. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param str mac_address: The MAC address of this bare metal server network - interface. If the MAC address has not yet been selected, the value will be - empty. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the MAC address is that of the attached virtual network - interface. - :param str name: The name for this bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the name matches its corresponding network attachment. - :param int port_speed: The bare metal server network interface port speed - in Mbps. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the port speed is that of its corresponding network - attachment. - :param ReservedIPReference primary_ip: - :param str resource_type: The resource type. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the security groups are associated with the attached virtual - network interface. - :param str status: The status of the bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a read-only representation of its corresponding network attachment and - its attached virtual network interface, and the status is [computed from - them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). - :param SubnetReference subnet: The associated subnet. - :param str type: The bare metal server network interface type. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the type is that of its corresponding network attachment. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']) + ", ".join(['CatalogOfferingIdentityCatalogOfferingByCRN']) ) raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterface': - """Initialize a BareMetalServerNetworkInterface object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterface'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']) - ) - raise Exception(msg) - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a BareMetalServerNetworkInterface object from a json dictionary.""" - return cls.from_dict(_dict) +class CatalogOfferingVersionIdentity: + """ + Identifies a version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + by a unique property. - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['hipersocket'] = 'BareMetalServerNetworkInterfaceByHiperSocket' - mapping['pci'] = 'BareMetalServerNetworkInterfaceByPCI' - mapping['vlan'] = 'BareMetalServerNetworkInterfaceByVLAN' - disc_value = _dict.get('interface_type') - if disc_value is None: - raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterface JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) + """ - class InterfaceTypeEnum(str, Enum): - """ - The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - within a `s390x` based system - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the interface type is that of the corresponding network attachment. - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. + def __init__( + self, + ) -> None: """ + Initialize a CatalogOfferingVersionIdentity object. - HIPERSOCKET = 'hipersocket' - PCI = 'pci' - VLAN = 'vlan' - - - class ResourceTypeEnum(str, Enum): - """ - The resource type. """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN']) + ) + raise Exception(msg) - NETWORK_INTERFACE = 'network_interface' - - - class StatusEnum(str, Enum): - """ - The status of the bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - read-only representation of its corresponding network attachment and its attached - virtual network interface, and the status is [computed from - them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). - """ - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' +class CatalogOfferingVersionPlanIdentity: + """ + Identifies a catalog offering version's billing plan by a unique property. + """ - class TypeEnum(str, Enum): - """ - The bare metal server network interface type. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the type is that of its corresponding network attachment. + def __init__( + self, + ) -> None: """ + Initialize a CatalogOfferingVersionPlanIdentity object. - PRIMARY = 'primary' - SECONDARY = 'secondary' - + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['CatalogOfferingVersionPlanIdentityCatalogOfferingVersionPlanByCRN']) + ) + raise Exception(msg) -class BareMetalServerNetworkInterfaceCollection: +class CatalogOfferingVersionPlanReference: """ - BareMetalServerNetworkInterfaceCollection. + CatalogOfferingVersionPlanReference. - :param BareMetalServerNetworkInterfaceCollectionFirst first: A link to the first - page of resources. - :param int limit: The maximum number of resources that can be returned by the - request. - :param List[BareMetalServerNetworkInterface] network_interfaces: The network - interfaces for the bare metal server. - :param BareMetalServerNetworkInterfaceCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages - except the last page. - :param int total_count: The total number of resources across all pages. + :param str crn: The CRN for this + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version's billing plan. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. """ def __init__( self, - first: 'BareMetalServerNetworkInterfaceCollectionFirst', - limit: int, - network_interfaces: List['BareMetalServerNetworkInterface'], - total_count: int, + crn: str, *, - next: Optional['BareMetalServerNetworkInterfaceCollectionNext'] = None, + deleted: Optional['Deleted'] = None, ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceCollection object. + Initialize a CatalogOfferingVersionPlanReference object. - :param BareMetalServerNetworkInterfaceCollectionFirst first: A link to the - first page of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[BareMetalServerNetworkInterface] network_interfaces: The - network interfaces for the bare metal server. - :param int total_count: The total number of resources across all pages. - :param BareMetalServerNetworkInterfaceCollectionNext next: (optional) A - link to the next page of resources. This property is present for all pages - except the last page. + :param str crn: The CRN for this + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version's billing plan. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. """ - self.first = first - self.limit = limit - self.network_interfaces = network_interfaces - self.next = next - self.total_count = total_count + self.crn = crn + self.deleted = deleted @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollection': - """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionPlanReference': + """Initialize a CatalogOfferingVersionPlanReference object from a json dictionary.""" args = {} - if (first := _dict.get('first')) is not None: - args['first'] = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(first) - else: - raise ValueError('Required property \'first\' not present in BareMetalServerNetworkInterfaceCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - else: - raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkInterfaceCollection JSON') - if (network_interfaces := _dict.get('network_interfaces')) is not None: - args['network_interfaces'] = [BareMetalServerNetworkInterface.from_dict(v) for v in network_interfaces] - else: - raise ValueError('Required property \'network_interfaces\' not present in BareMetalServerNetworkInterfaceCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = BareMetalServerNetworkInterfaceCollectionNext.from_dict(next) - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn else: - raise ValueError('Required property \'total_count\' not present in BareMetalServerNetworkInterfaceCollection JSON') + raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionPlanReference JSON') + if (deleted := _dict.get('deleted')) is not None: + args['deleted'] = Deleted.from_dict(deleted) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary.""" + """Initialize a CatalogOfferingVersionPlanReference 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + _dict['deleted'] = self.deleted.to_dict() return _dict def _to_dict(self): @@ -32743,58 +36705,62 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfaceCollection object.""" + """Return a `str` version of this CatalogOfferingVersionPlanReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool: + def __eq__(self, other: 'CatalogOfferingVersionPlanReference') -> 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: 'BareMetalServerNetworkInterfaceCollection') -> bool: + def __ne__(self, other: 'CatalogOfferingVersionPlanReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerNetworkInterfaceCollectionFirst: +class CatalogOfferingVersionReference: """ - A link to the first page of resources. + CatalogOfferingVersionReference. - :param str href: The URL for a page of resources. + :param str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. """ def __init__( self, - href: str, + crn: str, ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceCollectionFirst object. + Initialize a CatalogOfferingVersionReference object. - :param str href: The URL for a page of resources. + :param str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. """ - self.href = href + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionFirst': - """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionReference': + """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionFirst JSON') + raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from a json dictionary.""" + """Initialize a CatalogOfferingVersionReference 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, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -32802,194 +36768,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionFirst object.""" + """Return a `str` version of this CatalogOfferingVersionReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool: + def __eq__(self, other: 'CatalogOfferingVersionReference') -> 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: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool: + def __ne__(self, other: 'CatalogOfferingVersionReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerNetworkInterfaceCollectionNext: +class CertificateInstanceIdentity: """ - A link to the next page of resources. This property is present for all pages except - the last page. + Identifies a certificate instance by a unique property. - :param str href: The URL for a page of resources. """ def __init__( self, - href: str, ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceCollectionNext object. + Initialize a CertificateInstanceIdentity object. - :param str href: The URL for a page of resources. """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionNext': - """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceCollectionNext 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 BareMetalServerNetworkInterfaceCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> 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: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['CertificateInstanceIdentityByCRN']) + ) + raise Exception(msg) -class BareMetalServerNetworkInterfacePatch: +class CertificateInstanceReference: """ - BareMetalServerNetworkInterfacePatch. + CertificateInstanceReference. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing - is allowed on this bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and source IP spoofing is managed on the attached virtual network - interface. - :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` - interfaces using this PCI interface, replacing any existing VLAN IDs. The - specified values must include IDs for all `vlan` interfaces currently using this - PCI interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the bare metal server network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and infrastructure NAT is managed on the attached virtual network - interface. - :param str name: (optional) The name for this bare metal server network - interface. The name must not be used by another network interface on the bare - metal server. + :param str crn: The CRN for this certificate instance. """ def __init__( self, - *, - allow_ip_spoofing: Optional[bool] = None, - allowed_vlans: Optional[List[int]] = None, - enable_infrastructure_nat: Optional[bool] = None, - name: Optional[str] = None, + crn: str, ) -> None: """ - Initialize a BareMetalServerNetworkInterfacePatch object. + Initialize a CertificateInstanceReference object. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and source IP spoofing is managed on the attached virtual - network interface. - :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan` - interfaces using this PCI interface, replacing any existing VLAN IDs. The - specified values must include IDs for all `vlan` interfaces currently using - this PCI interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the bare metal server network - interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and infrastructure NAT is managed on the attached virtual - network interface. - :param str name: (optional) The name for this bare metal server network - interface. The name must not be used by another network interface on the - bare metal server. + :param str crn: The CRN for this certificate instance. """ - self.allow_ip_spoofing = allow_ip_spoofing - self.allowed_vlans = allowed_vlans - self.enable_infrastructure_nat = enable_infrastructure_nat - self.name = name + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePatch': - """Initialize a BareMetalServerNetworkInterfacePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CertificateInstanceReference': + """Initialize a CertificateInstanceReference object from a json dictionary.""" args = {} - if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None: - args['allow_ip_spoofing'] = allow_ip_spoofing - if (allowed_vlans := _dict.get('allowed_vlans')) is not None: - args['allowed_vlans'] = allowed_vlans - if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None: - args['enable_infrastructure_nat'] = enable_infrastructure_nat - if (name := _dict.get('name')) is not None: - args['name'] = name + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in CertificateInstanceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfacePatch 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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: - _dict['allowed_vlans'] = self.allowed_vlans - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + """Initialize a CertificateInstanceReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -32997,318 +36846,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfacePatch object.""" + """Return a `str` version of this CertificateInstanceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool: + def __eq__(self, other: 'CertificateInstanceReference') -> 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: 'BareMetalServerNetworkInterfacePatch') -> bool: + def __ne__(self, other: 'CertificateInstanceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerNetworkInterfacePrototype: +class CloudObjectStorageBucketIdentity: """ - BareMetalServerNetworkInterfacePrototype. + Identifies a Cloud Object Storage bucket by a unique property. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing - is allowed on this bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and source IP spoofing is managed on the attached virtual network - interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the bare metal server network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and infrastructure NAT is managed on the attached virtual network - interface. - :param str interface_type: The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - within a `s390x` based system - - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in - its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :param str name: (optional) The name for this bare metal server network - interface. The name must not be used by another network interface on the bare - metal server. If unspecified, the name will be a hyphenated list of - randomly-selected words. - :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address - to bind to the bare metal server network interface. This can be - specified using an existing reserved IP, or a prototype object for a new - reserved IP. - If an existing reserved IP or a prototype object with an address is specified, - it must - be available on the bare metal server network interface's subnet. Otherwise, an - available address on the subnet will be automatically selected and reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this bare metal server network interface. If unspecified, the - VPC's default security group is used. - :param SubnetIdentity subnet: The associated subnet. """ def __init__( self, - interface_type: str, - subnet: 'SubnetIdentity', - *, - allow_ip_spoofing: Optional[bool] = None, - enable_infrastructure_nat: Optional[bool] = None, - name: Optional[str] = None, - primary_ip: Optional['NetworkInterfaceIPPrototype'] = None, - security_groups: Optional[List['SecurityGroupIdentity']] = None, ) -> None: """ - Initialize a BareMetalServerNetworkInterfacePrototype object. + Initialize a CloudObjectStorageBucketIdentity object. - :param str interface_type: The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP - connectivity - within a `s390x` based system - - Not supported on bare metal servers with a `cpu.architecture` of - `amd64` - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` - in its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Has its own security groups and does not inherit those of the PCI - device through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x`. - :param SubnetIdentity subnet: The associated subnet. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and source IP spoofing is managed on the attached virtual - network interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the bare metal server network - interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and infrastructure NAT is managed on the attached virtual - network interface. - :param str name: (optional) The name for this bare metal server network - interface. The name must not be used by another network interface on the - bare metal server. If unspecified, the name will be a hyphenated list of - randomly-selected words. - :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP - address to bind to the bare metal server network interface. This can be - specified using an existing reserved IP, or a prototype object for a new - reserved IP. - If an existing reserved IP or a prototype object with an address is - specified, it must - be available on the bare metal server network interface's subnet. - Otherwise, an - available address on the subnet will be automatically selected and - reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this bare metal server network interface. If unspecified, - the VPC's default security group is used. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']) - ) - raise Exception(msg) - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototype': - """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterfacePrototype'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']) + ", ".join(['CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName', 'CloudObjectStorageBucketIdentityByCRN']) ) raise Exception(msg) - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary.""" - return cls.from_dict(_dict) - - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['hipersocket'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype' - mapping['pci'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype' - mapping['vlan'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype' - disc_value = _dict.get('interface_type') - if disc_value is None: - raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterfacePrototype JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - - class InterfaceTypeEnum(str, Enum): - """ - The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - within a `s390x` based system - - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - array of `allowed_vlans`. - - Must use an IEEE 802.1Q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - """ - - HIPERSOCKET = 'hipersocket' - PCI = 'pci' - VLAN = 'vlan' - - -class BareMetalServerPatch: +class CloudObjectStorageBucketReference: """ - BareMetalServerPatch. + CloudObjectStorageBucketReference. - :param int bandwidth: (optional) The total bandwidth (in megabits per second) - shared across the bare metal server's network interfaces. The specified value - must match one of the bandwidth values in the bare metal server's profile. - :param bool enable_secure_boot: (optional) Indicates whether secure boot is - enabled. If enabled, the image must support secure boot or the bare metal server - will fail to boot. - For `enable_secure_boot` to be changed, the bare metal server `status` must be - `stopped`. - :param str name: (optional) The name for this bare metal server. The name must - not be used by another bare metal server in the region. Changing the name will - not affect the system hostname. - :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module: - (optional) + :param str crn: The CRN of this Cloud Object Storage bucket. + :param str name: The globally unique name of this Cloud Object Storage bucket. """ def __init__( self, - *, - bandwidth: Optional[int] = None, - enable_secure_boot: Optional[bool] = None, - name: Optional[str] = None, - trusted_platform_module: Optional['BareMetalServerTrustedPlatformModulePatch'] = None, + crn: str, + name: str, ) -> None: """ - Initialize a BareMetalServerPatch object. + Initialize a CloudObjectStorageBucketReference object. - :param int bandwidth: (optional) The total bandwidth (in megabits per - second) shared across the bare metal server's network interfaces. The - specified value must match one of the bandwidth values in the bare metal - server's profile. - :param bool enable_secure_boot: (optional) Indicates whether secure boot is - enabled. If enabled, the image must support secure boot or the bare metal - server will fail to boot. - For `enable_secure_boot` to be changed, the bare metal server `status` must - be - `stopped`. - :param str name: (optional) The name for this bare metal server. The name - must not be used by another bare metal server in the region. Changing the - name will not affect the system hostname. - :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module: - (optional) + :param str crn: The CRN of this Cloud Object Storage bucket. + :param str name: The globally unique name of this Cloud Object Storage + bucket. """ - self.bandwidth = bandwidth - self.enable_secure_boot = enable_secure_boot + self.crn = crn self.name = name - self.trusted_platform_module = trusted_platform_module @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerPatch': - """Initialize a BareMetalServerPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketReference': + """Initialize a CloudObjectStorageBucketReference object from a json dictionary.""" args = {} - if (bandwidth := _dict.get('bandwidth')) is not None: - args['bandwidth'] = bandwidth - if (enable_secure_boot := _dict.get('enable_secure_boot')) is not None: - args['enable_secure_boot'] = enable_secure_boot + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketReference JSON') if (name := _dict.get('name')) is not None: args['name'] = name - if (trusted_platform_module := _dict.get('trusted_platform_module')) is not None: - args['trusted_platform_module'] = BareMetalServerTrustedPlatformModulePatch.from_dict(trusted_platform_module) + else: + raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerPatch object from a json dictionary.""" + """Initialize a CloudObjectStorageBucketReference 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, 'bandwidth') and self.bandwidth is not None: - _dict['bandwidth'] = self.bandwidth - if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: - _dict['enable_secure_boot'] = self.enable_secure_boot + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: - if isinstance(self.trusted_platform_module, dict): - _dict['trusted_platform_module'] = self.trusted_platform_module - else: - _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() return _dict def _to_dict(self): @@ -33316,321 +36935,60 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerPatch object.""" + """Return a `str` version of this CloudObjectStorageBucketReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerPatch') -> bool: + def __eq__(self, other: 'CloudObjectStorageBucketReference') -> 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: 'BareMetalServerPatch') -> bool: + def __ne__(self, other: 'CloudObjectStorageBucketReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerPrimaryNetworkAttachmentPrototype: - """ - BareMetalServerPrimaryNetworkAttachmentPrototype. - - :param str interface_type: (optional) The network attachment's interface type: - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :param str name: (optional) The name for this bare metal server network - attachment. Names must be unique within the bare metal server the network - attachment resides in. If unspecified, the name will be a hyphenated list of - randomly-selected words. - :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface - virtual_network_interface: A virtual network interface for the bare metal server - network attachment. This can be - specified using an existing virtual network interface, or a prototype object for - a new - virtual network interface. - If an existing virtual network interface is specified, it must not be the target - of a flow - log collector. - """ - - def __init__( - self, - virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface', - *, - interface_type: Optional[str] = None, - name: Optional[str] = None, - ) -> None: - """ - Initialize a BareMetalServerPrimaryNetworkAttachmentPrototype object. - - :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface - virtual_network_interface: A virtual network interface for the bare metal - server network attachment. This can be - specified using an existing virtual network interface, or a prototype - object for a new - virtual network interface. - If an existing virtual network interface is specified, it must not be the - target of a flow - log collector. - :param str interface_type: (optional) The network attachment's interface - type: - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x`. - :param str name: (optional) The name for this bare metal server network - attachment. Names must be unique within the bare metal server the network - attachment resides in. If unspecified, the name will be a hyphenated list - of randomly-selected words. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype']) - ) - raise Exception(msg) - - class InterfaceTypeEnum(str, Enum): - """ - The network attachment's interface type: - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI attachment - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - """ - - PCI = 'pci' - - - -class BareMetalServerPrimaryNetworkInterfacePrototype: +class CloudObjectStorageObjectReference: """ - BareMetalServerPrimaryNetworkInterfacePrototype. + CloudObjectStorageObjectReference. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing - is allowed on this bare metal server network interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and source IP spoofing is managed on the attached virtual network - interface. - :param List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan` - interfaces using this PCI interface. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the VLAN IDs match the `allow_vlans` of the corresponding network - attachment. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the bare metal server network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - If this bare metal server has network attachments, this network interface is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and infrastructure NAT is managed on the attached virtual network - interface. - :param str interface_type: (optional) The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :param str name: (optional) The name for this bare metal server network - interface. The name must not be used by another network interface on the bare - metal server. If unspecified, the name will be a hyphenated list of - randomly-selected words. - :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address - to bind to the bare metal server network interface. This can be - specified using an existing reserved IP, or a prototype object for a new - reserved IP. - If an existing reserved IP or a prototype object with an address is specified, - it must - be available on the bare metal server network interface's subnet. Otherwise, an - available address on the subnet will be automatically selected and reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this bare metal server network interface. If unspecified, the - VPC's default security group is used. - :param SubnetIdentity subnet: The associated subnet. + :param str name: The name of this Cloud Object Storage object. Names are unique + within a Cloud Object Storage bucket. """ def __init__( self, - subnet: 'SubnetIdentity', - *, - allow_ip_spoofing: Optional[bool] = None, - allowed_vlans: Optional[List[int]] = None, - enable_infrastructure_nat: Optional[bool] = None, - interface_type: Optional[str] = None, - name: Optional[str] = None, - primary_ip: Optional['NetworkInterfaceIPPrototype'] = None, - security_groups: Optional[List['SecurityGroupIdentity']] = None, + name: str, ) -> None: """ - Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object. + Initialize a CloudObjectStorageObjectReference object. - :param SubnetIdentity subnet: The associated subnet. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this bare metal server network interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and source IP spoofing is managed on the attached virtual - network interface. - :param List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan` - interfaces using this PCI interface. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and the VLAN IDs match the `allow_vlans` of the corresponding - network attachment. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the bare metal server network - interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - If this bare metal server has network attachments, this network interface - is a - [read-only - representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) - of its corresponding network attachment and its attached virtual network - interface, and infrastructure NAT is managed on the attached virtual - network interface. - :param str interface_type: (optional) The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP - connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of - `amd64` - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x`. - :param str name: (optional) The name for this bare metal server network - interface. The name must not be used by another network interface on the - bare metal server. If unspecified, the name will be a hyphenated list of - randomly-selected words. - :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP - address to bind to the bare metal server network interface. This can be - specified using an existing reserved IP, or a prototype object for a new - reserved IP. - If an existing reserved IP or a prototype object with an address is - specified, it must - be available on the bare metal server network interface's subnet. - Otherwise, an - available address on the subnet will be automatically selected and - reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this bare metal server network interface. If unspecified, - the VPC's default security group is used. + :param str name: The name of this Cloud Object Storage object. Names are + unique within a Cloud Object Storage bucket. """ - self.allow_ip_spoofing = allow_ip_spoofing - self.allowed_vlans = allowed_vlans - self.enable_infrastructure_nat = enable_infrastructure_nat - self.interface_type = interface_type self.name = name - self.primary_ip = primary_ip - self.security_groups = security_groups - self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrimaryNetworkInterfacePrototype': - """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageObjectReference': + """Initialize a CloudObjectStorageObjectReference object from a json dictionary.""" args = {} - if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None: - args['allow_ip_spoofing'] = allow_ip_spoofing - if (allowed_vlans := _dict.get('allowed_vlans')) is not None: - args['allowed_vlans'] = allowed_vlans - if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None: - args['enable_infrastructure_nat'] = enable_infrastructure_nat - if (interface_type := _dict.get('interface_type')) is not None: - args['interface_type'] = interface_type if (name := _dict.get('name')) is not None: args['name'] = name - if (primary_ip := _dict.get('primary_ip')) is not None: - args['primary_ip'] = primary_ip - if (security_groups := _dict.get('security_groups')) is not None: - args['security_groups'] = security_groups - if (subnet := _dict.get('subnet')) is not None: - args['subnet'] = subnet else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerPrimaryNetworkInterfacePrototype JSON') + raise ValueError('Required property \'name\' not present in CloudObjectStorageObjectReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary.""" + """Initialize a CloudObjectStorageObjectReference 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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: - _dict['allowed_vlans'] = self.allowed_vlans - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip - else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: - if isinstance(v, dict): - security_groups_list.append(v) - else: - security_groups_list.append(v.to_dict()) - _dict['security_groups'] = security_groups_list - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -33638,281 +36996,214 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerPrimaryNetworkInterfacePrototype object.""" + """Return a `str` version of this CloudObjectStorageObjectReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool: + def __eq__(self, other: 'CloudObjectStorageObjectReference') -> 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: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool: + def __ne__(self, other: 'CloudObjectStorageObjectReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class InterfaceTypeEnum(str, Enum): - """ - The interface type: - - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1Q tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - """ - - HIPERSOCKET = 'hipersocket' - PCI = 'pci' - - -class BareMetalServerProfile: +class ClusterNetwork: """ - BareMetalServerProfile. + ClusterNetwork. - :param BareMetalServerProfileBandwidth bandwidth: - :param BareMetalServerProfileConsoleTypes console_types: The console type - configuration for a bare metal server with this profile. - :param BareMetalServerProfileCPUArchitecture cpu_architecture: - :param BareMetalServerProfileCPUCoreCount cpu_core_count: - :param BareMetalServerProfileCPUSocketCount cpu_socket_count: - :param List[BareMetalServerProfileDisk] disks: The disks for a bare metal server - with this profile. - :param str family: The product family this bare metal server profile belongs to. - :param str href: The URL for this bare metal server profile. - :param BareMetalServerProfileMemory memory: - :param str name: The name for this bare metal server profile. - :param BareMetalServerProfileNetworkAttachmentCount network_attachment_count: - :param BareMetalServerProfileNetworkInterfaceCount network_interface_count: - :param BareMetalServerProfileOSArchitecture os_architecture: + :param datetime created_at: The date and time that the cluster network was + created. + :param str crn: The CRN for this cluster network. + :param str href: The URL for this cluster network. + :param str id: The unique identifier for this cluster network. + :param List[ClusterNetworkLifecycleReason] lifecycle_reasons: The reasons for + the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the cluster network. + :param str name: The name for this cluster network. The name must not be used by + another cluster network in the region. + :param ClusterNetworkProfileReference profile: The profile for this cluster + network. + :param ResourceGroupReference resource_group: The resource group for this + cluster network. :param str resource_type: The resource type. - :param BareMetalServerProfileSupportedTrustedPlatformModuleModes - supported_trusted_platform_module_modes: The supported trusted platform module - modes for this bare metal server profile. - :param BareMetalServerProfileVirtualNetworkInterfacesSupported - virtual_network_interfaces_supported: Indicates whether this profile supports - virtual network interfaces. + :param List[ClusterNetworkSubnetPrefix] subnet_prefixes: The IP address ranges + available for subnets for this cluster network. + :param VPCReference vpc: The VPC this cluster network resides in. + :param ZoneReference zone: The zone this cluster network resides in. """ def __init__( self, - bandwidth: 'BareMetalServerProfileBandwidth', - console_types: 'BareMetalServerProfileConsoleTypes', - cpu_architecture: 'BareMetalServerProfileCPUArchitecture', - cpu_core_count: 'BareMetalServerProfileCPUCoreCount', - cpu_socket_count: 'BareMetalServerProfileCPUSocketCount', - disks: List['BareMetalServerProfileDisk'], - family: str, + created_at: datetime, + crn: str, href: str, - memory: 'BareMetalServerProfileMemory', + id: str, + lifecycle_reasons: List['ClusterNetworkLifecycleReason'], + lifecycle_state: str, name: str, - network_attachment_count: 'BareMetalServerProfileNetworkAttachmentCount', - network_interface_count: 'BareMetalServerProfileNetworkInterfaceCount', - os_architecture: 'BareMetalServerProfileOSArchitecture', + profile: 'ClusterNetworkProfileReference', + resource_group: 'ResourceGroupReference', resource_type: str, - supported_trusted_platform_module_modes: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes', - virtual_network_interfaces_supported: 'BareMetalServerProfileVirtualNetworkInterfacesSupported', + subnet_prefixes: List['ClusterNetworkSubnetPrefix'], + vpc: 'VPCReference', + zone: 'ZoneReference', ) -> None: """ - Initialize a BareMetalServerProfile object. + Initialize a ClusterNetwork object. - :param BareMetalServerProfileBandwidth bandwidth: - :param BareMetalServerProfileConsoleTypes console_types: The console type - configuration for a bare metal server with this profile. - :param BareMetalServerProfileCPUArchitecture cpu_architecture: - :param BareMetalServerProfileCPUCoreCount cpu_core_count: - :param BareMetalServerProfileCPUSocketCount cpu_socket_count: - :param List[BareMetalServerProfileDisk] disks: The disks for a bare metal - server with this profile. - :param str family: The product family this bare metal server profile - belongs to. - :param str href: The URL for this bare metal server profile. - :param BareMetalServerProfileMemory memory: - :param str name: The name for this bare metal server profile. - :param BareMetalServerProfileNetworkAttachmentCount - network_attachment_count: - :param BareMetalServerProfileNetworkInterfaceCount network_interface_count: - :param BareMetalServerProfileOSArchitecture os_architecture: + :param datetime created_at: The date and time that the cluster network was + created. + :param str crn: The CRN for this cluster network. + :param str href: The URL for this cluster network. + :param str id: The unique identifier for this cluster network. + :param List[ClusterNetworkLifecycleReason] lifecycle_reasons: The reasons + for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the cluster network. + :param str name: The name for this cluster network. The name must not be + used by another cluster network in the region. + :param ClusterNetworkProfileReference profile: The profile for this cluster + network. + :param ResourceGroupReference resource_group: The resource group for this + cluster network. :param str resource_type: The resource type. - :param BareMetalServerProfileSupportedTrustedPlatformModuleModes - supported_trusted_platform_module_modes: The supported trusted platform - module modes for this bare metal server profile. - :param BareMetalServerProfileVirtualNetworkInterfacesSupported - virtual_network_interfaces_supported: Indicates whether this profile - supports virtual network interfaces. + :param List[ClusterNetworkSubnetPrefix] subnet_prefixes: The IP address + ranges available for subnets for this cluster network. + :param VPCReference vpc: The VPC this cluster network resides in. + :param ZoneReference zone: The zone this cluster network resides in. """ - self.bandwidth = bandwidth - self.console_types = console_types - self.cpu_architecture = cpu_architecture - self.cpu_core_count = cpu_core_count - self.cpu_socket_count = cpu_socket_count - self.disks = disks - self.family = family + self.created_at = created_at + self.crn = crn self.href = href - self.memory = memory + self.id = id + self.lifecycle_reasons = lifecycle_reasons + self.lifecycle_state = lifecycle_state self.name = name - self.network_attachment_count = network_attachment_count - self.network_interface_count = network_interface_count - self.os_architecture = os_architecture + self.profile = profile + self.resource_group = resource_group self.resource_type = resource_type - self.supported_trusted_platform_module_modes = supported_trusted_platform_module_modes - self.virtual_network_interfaces_supported = virtual_network_interfaces_supported + self.subnet_prefixes = subnet_prefixes + self.vpc = vpc + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfile': - """Initialize a BareMetalServerProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetwork': + """Initialize a ClusterNetwork object from a json dictionary.""" args = {} - if (bandwidth := _dict.get('bandwidth')) is not None: - args['bandwidth'] = bandwidth - else: - raise ValueError('Required property \'bandwidth\' not present in BareMetalServerProfile JSON') - if (console_types := _dict.get('console_types')) is not None: - args['console_types'] = BareMetalServerProfileConsoleTypes.from_dict(console_types) - else: - raise ValueError('Required property \'console_types\' not present in BareMetalServerProfile JSON') - if (cpu_architecture := _dict.get('cpu_architecture')) is not None: - args['cpu_architecture'] = BareMetalServerProfileCPUArchitecture.from_dict(cpu_architecture) - else: - raise ValueError('Required property \'cpu_architecture\' not present in BareMetalServerProfile JSON') - if (cpu_core_count := _dict.get('cpu_core_count')) is not None: - args['cpu_core_count'] = cpu_core_count - else: - raise ValueError('Required property \'cpu_core_count\' not present in BareMetalServerProfile JSON') - if (cpu_socket_count := _dict.get('cpu_socket_count')) is not None: - args['cpu_socket_count'] = cpu_socket_count - else: - raise ValueError('Required property \'cpu_socket_count\' not present in BareMetalServerProfile JSON') - if (disks := _dict.get('disks')) is not None: - args['disks'] = [BareMetalServerProfileDisk.from_dict(v) for v in disks] + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) else: - raise ValueError('Required property \'disks\' not present in BareMetalServerProfile JSON') - if (family := _dict.get('family')) is not None: - args['family'] = family + raise ValueError('Required property \'created_at\' not present in ClusterNetwork JSON') + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn else: - raise ValueError('Required property \'family\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'crn\' not present in ClusterNetwork JSON') if (href := _dict.get('href')) is not None: args['href'] = href else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfile JSON') - if (memory := _dict.get('memory')) is not None: - args['memory'] = memory + raise ValueError('Required property \'href\' not present in ClusterNetwork JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError('Required property \'memory\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'id\' not present in ClusterNetwork JSON') + if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None: + args['lifecycle_reasons'] = [ClusterNetworkLifecycleReason.from_dict(v) for v in lifecycle_reasons] + else: + raise ValueError('Required property \'lifecycle_reasons\' not present in ClusterNetwork JSON') + if (lifecycle_state := _dict.get('lifecycle_state')) is not None: + args['lifecycle_state'] = lifecycle_state + else: + raise ValueError('Required property \'lifecycle_state\' not present in ClusterNetwork JSON') if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in BareMetalServerProfile JSON') - if (network_attachment_count := _dict.get('network_attachment_count')) is not None: - args['network_attachment_count'] = network_attachment_count - else: - raise ValueError('Required property \'network_attachment_count\' not present in BareMetalServerProfile JSON') - if (network_interface_count := _dict.get('network_interface_count')) is not None: - args['network_interface_count'] = network_interface_count + raise ValueError('Required property \'name\' not present in ClusterNetwork JSON') + if (profile := _dict.get('profile')) is not None: + args['profile'] = ClusterNetworkProfileReference.from_dict(profile) else: - raise ValueError('Required property \'network_interface_count\' not present in BareMetalServerProfile JSON') - if (os_architecture := _dict.get('os_architecture')) is not None: - args['os_architecture'] = BareMetalServerProfileOSArchitecture.from_dict(os_architecture) + raise ValueError('Required property \'profile\' not present in ClusterNetwork JSON') + if (resource_group := _dict.get('resource_group')) is not None: + args['resource_group'] = ResourceGroupReference.from_dict(resource_group) else: - raise ValueError('Required property \'os_architecture\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'resource_group\' not present in ClusterNetwork JSON') if (resource_type := _dict.get('resource_type')) is not None: args['resource_type'] = resource_type else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfile JSON') - if (supported_trusted_platform_module_modes := _dict.get('supported_trusted_platform_module_modes')) is not None: - args['supported_trusted_platform_module_modes'] = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(supported_trusted_platform_module_modes) + raise ValueError('Required property \'resource_type\' not present in ClusterNetwork JSON') + if (subnet_prefixes := _dict.get('subnet_prefixes')) is not None: + args['subnet_prefixes'] = [ClusterNetworkSubnetPrefix.from_dict(v) for v in subnet_prefixes] else: - raise ValueError('Required property \'supported_trusted_platform_module_modes\' not present in BareMetalServerProfile JSON') - if (virtual_network_interfaces_supported := _dict.get('virtual_network_interfaces_supported')) is not None: - args['virtual_network_interfaces_supported'] = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(virtual_network_interfaces_supported) + raise ValueError('Required property \'subnet_prefixes\' not present in ClusterNetwork JSON') + if (vpc := _dict.get('vpc')) is not None: + args['vpc'] = VPCReference.from_dict(vpc) else: - raise ValueError('Required property \'virtual_network_interfaces_supported\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'vpc\' not present in ClusterNetwork JSON') + if (zone := _dict.get('zone')) is not None: + args['zone'] = ZoneReference.from_dict(zone) + else: + raise ValueError('Required property \'zone\' not present in ClusterNetwork JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfile object from a json dictionary.""" + """Initialize a ClusterNetwork 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, 'bandwidth') and self.bandwidth is not None: - if isinstance(self.bandwidth, dict): - _dict['bandwidth'] = self.bandwidth - else: - _dict['bandwidth'] = self.bandwidth.to_dict() - if hasattr(self, 'console_types') and self.console_types is not None: - if isinstance(self.console_types, dict): - _dict['console_types'] = self.console_types - else: - _dict['console_types'] = self.console_types.to_dict() - if hasattr(self, 'cpu_architecture') and self.cpu_architecture is not None: - if isinstance(self.cpu_architecture, dict): - _dict['cpu_architecture'] = self.cpu_architecture - else: - _dict['cpu_architecture'] = self.cpu_architecture.to_dict() - if hasattr(self, 'cpu_core_count') and self.cpu_core_count is not None: - if isinstance(self.cpu_core_count, dict): - _dict['cpu_core_count'] = self.cpu_core_count - else: - _dict['cpu_core_count'] = self.cpu_core_count.to_dict() - if hasattr(self, 'cpu_socket_count') and self.cpu_socket_count is not None: - if isinstance(self.cpu_socket_count, dict): - _dict['cpu_socket_count'] = self.cpu_socket_count - else: - _dict['cpu_socket_count'] = self.cpu_socket_count.to_dict() - if hasattr(self, 'disks') and self.disks is not None: - disks_list = [] - for v in self.disks: - if isinstance(v, dict): - disks_list.append(v) - else: - disks_list.append(v.to_dict()) - _dict['disks'] = disks_list - if hasattr(self, 'family') and self.family is not None: - _dict['family'] = self.family + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'memory') and self.memory is not None: - if isinstance(self.memory, dict): - _dict['memory'] = self.memory - else: - _dict['memory'] = self.memory.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: + lifecycle_reasons_list = [] + for v in self.lifecycle_reasons: + if isinstance(v, dict): + lifecycle_reasons_list.append(v) + else: + lifecycle_reasons_list.append(v.to_dict()) + _dict['lifecycle_reasons'] = lifecycle_reasons_list + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'network_attachment_count') and self.network_attachment_count is not None: - if isinstance(self.network_attachment_count, dict): - _dict['network_attachment_count'] = self.network_attachment_count - else: - _dict['network_attachment_count'] = self.network_attachment_count.to_dict() - if hasattr(self, 'network_interface_count') and self.network_interface_count is not None: - if isinstance(self.network_interface_count, dict): - _dict['network_interface_count'] = self.network_interface_count + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile else: - _dict['network_interface_count'] = self.network_interface_count.to_dict() - if hasattr(self, 'os_architecture') and self.os_architecture is not None: - if isinstance(self.os_architecture, dict): - _dict['os_architecture'] = self.os_architecture + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group else: - _dict['os_architecture'] = self.os_architecture.to_dict() + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'supported_trusted_platform_module_modes') and self.supported_trusted_platform_module_modes is not None: - if isinstance(self.supported_trusted_platform_module_modes, dict): - _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes + if hasattr(self, 'subnet_prefixes') and self.subnet_prefixes is not None: + subnet_prefixes_list = [] + for v in self.subnet_prefixes: + if isinstance(v, dict): + subnet_prefixes_list.append(v) + else: + subnet_prefixes_list.append(v.to_dict()) + _dict['subnet_prefixes'] = subnet_prefixes_list + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc else: - _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes.to_dict() - if hasattr(self, 'virtual_network_interfaces_supported') and self.virtual_network_interfaces_supported is not None: - if isinstance(self.virtual_network_interfaces_supported, dict): - _dict['virtual_network_interfaces_supported'] = self.virtual_network_interfaces_supported + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone else: - _dict['virtual_network_interfaces_supported'] = self.virtual_network_interfaces_supported.to_dict() + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -33920,108 +37211,405 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfile object.""" + """Return a `str` version of this ClusterNetwork object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfile') -> bool: + def __eq__(self, other: 'ClusterNetwork') -> 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: 'BareMetalServerProfile') -> bool: + def __ne__(self, other: 'ClusterNetwork') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the cluster network. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + class ResourceTypeEnum(str, Enum): """ The resource type. """ - BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile' + CLUSTER_NETWORK = 'cluster_network' -class BareMetalServerProfileBandwidth: +class ClusterNetworkCollection: """ - BareMetalServerProfileBandwidth. + ClusterNetworkCollection. + :param List[ClusterNetwork] cluster_networks: A page of cluster networks. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. """ def __init__( self, + cluster_networks: List['ClusterNetwork'], + first: 'PageLink', + limit: int, + total_count: int, + *, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a BareMetalServerProfileBandwidth object. + Initialize a ClusterNetworkCollection object. + :param List[ClusterNetwork] cluster_networks: A page of cluster networks. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileBandwidthFixed', 'BareMetalServerProfileBandwidthRange', 'BareMetalServerProfileBandwidthEnum', 'BareMetalServerProfileBandwidthDependent']) - ) - raise Exception(msg) + self.cluster_networks = cluster_networks + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkCollection': + """Initialize a ClusterNetworkCollection object from a json dictionary.""" + args = {} + if (cluster_networks := _dict.get('cluster_networks')) is not None: + args['cluster_networks'] = [ClusterNetwork.from_dict(v) for v in cluster_networks] + else: + raise ValueError('Required property \'cluster_networks\' not present in ClusterNetworkCollection JSON') + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in ClusterNetworkCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in ClusterNetworkCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in ClusterNetworkCollection JSON') + return cls(**args) -class BareMetalServerProfileCPUArchitecture: + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkCollection 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, 'cluster_networks') and self.cluster_networks is not None: + cluster_networks_list = [] + for v in self.cluster_networks: + if isinstance(v, dict): + cluster_networks_list.append(v) + else: + cluster_networks_list.append(v.to_dict()) + _dict['cluster_networks'] = cluster_networks_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + 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 ClusterNetworkCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkCollection') -> 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: 'ClusterNetworkCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ClusterNetworkInterface: """ - BareMetalServerProfileCPUArchitecture. + The associated cluster network subnet. - :param str default: (optional) The default CPU architecture for a bare metal - server with this profile. - :param str type: The type for this profile field. - :param str value: The CPU architecture for a bare metal server with this - profile. + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed + on this cluster network interface. If `false`, source IP spoofing is prevented + on this cluster network interface. If `true`, source IP spoofing is allowed on + this cluster network interface. + :param bool auto_delete: Indicates whether this cluster network interface will + be automatically deleted when `target` is deleted. + :param datetime created_at: The date and time that the cluster network interface + was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the virtual network interface, + allowing the workload to perform any needed NAT operations. + :param str href: The URL for this cluster network interface. + :param str id: The unique identifier for this cluster network interface. + :param List[ClusterNetworkInterfaceLifecycleReason] lifecycle_reasons: The + reasons for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the cluster network + interface. + :param str mac_address: (optional) The MAC address of the cluster network + interface. May be absent if + `lifecycle_state` is `pending`. + :param str name: The name for this cluster network interface. The name is unique + across all interfaces in the cluster network. + :param ClusterNetworkSubnetReservedIPReference primary_ip: The cluster network + subnet reserved IP for this cluster network interface. + :param str resource_type: The resource type. + :param ClusterNetworkSubnetReference subnet: (optional) + :param ClusterNetworkInterfaceTarget target: (optional) The target of this + cluster network interface. + If absent, this cluster network interface is not attached to a target. + The resources supported by this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param VPCReference vpc: The VPC this cluster network interface resides in. + :param ZoneReference zone: The zone this cluster network interface resides in. """ def __init__( self, - type: str, - value: str, + allow_ip_spoofing: bool, + auto_delete: bool, + created_at: datetime, + enable_infrastructure_nat: bool, + href: str, + id: str, + lifecycle_reasons: List['ClusterNetworkInterfaceLifecycleReason'], + lifecycle_state: str, + name: str, + primary_ip: 'ClusterNetworkSubnetReservedIPReference', + resource_type: str, + vpc: 'VPCReference', + zone: 'ZoneReference', *, - default: Optional[str] = None, + mac_address: Optional[str] = None, + subnet: Optional['ClusterNetworkSubnetReference'] = None, + target: Optional['ClusterNetworkInterfaceTarget'] = None, ) -> None: """ - Initialize a BareMetalServerProfileCPUArchitecture object. + Initialize a ClusterNetworkInterface object. - :param str type: The type for this profile field. - :param str value: The CPU architecture for a bare metal server with this - profile. - :param str default: (optional) The default CPU architecture for a bare - metal server with this profile. - """ - self.default = default - self.type = type - self.value = value + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is + allowed on this cluster network interface. If `false`, source IP spoofing + is prevented on this cluster network interface. If `true`, source IP + spoofing is allowed on this cluster network interface. + :param bool auto_delete: Indicates whether this cluster network interface + will be automatically deleted when `target` is deleted. + :param datetime created_at: The date and time that the cluster network + interface was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the virtual network interface, + allowing the workload to perform any needed NAT operations. + :param str href: The URL for this cluster network interface. + :param str id: The unique identifier for this cluster network interface. + :param List[ClusterNetworkInterfaceLifecycleReason] lifecycle_reasons: The + reasons for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the cluster network + interface. + :param str name: The name for this cluster network interface. The name is + unique across all interfaces in the cluster network. + :param ClusterNetworkSubnetReservedIPReference primary_ip: The cluster + network subnet reserved IP for this cluster network interface. + :param str resource_type: The resource type. + :param VPCReference vpc: The VPC this cluster network interface resides in. + :param ZoneReference zone: The zone this cluster network interface resides + in. + :param str mac_address: (optional) The MAC address of the cluster network + interface. May be absent if + `lifecycle_state` is `pending`. + :param ClusterNetworkSubnetReference subnet: (optional) + :param ClusterNetworkInterfaceTarget target: (optional) The target of this + cluster network interface. + If absent, this cluster network interface is not attached to a target. + The resources supported by this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + self.allow_ip_spoofing = allow_ip_spoofing + self.auto_delete = auto_delete + self.created_at = created_at + self.enable_infrastructure_nat = enable_infrastructure_nat + self.href = href + self.id = id + self.lifecycle_reasons = lifecycle_reasons + self.lifecycle_state = lifecycle_state + self.mac_address = mac_address + self.name = name + self.primary_ip = primary_ip + self.resource_type = resource_type + self.subnet = subnet + self.target = target + self.vpc = vpc + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUArchitecture': - """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterface': + """Initialize a ClusterNetworkInterface object from a json dictionary.""" args = {} - if (default := _dict.get('default')) is not None: - args['default'] = default - if (type := _dict.get('type')) is not None: - args['type'] = type + if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None: + args['allow_ip_spoofing'] = allow_ip_spoofing else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUArchitecture JSON') - if (value := _dict.get('value')) is not None: - args['value'] = value + raise ValueError('Required property \'allow_ip_spoofing\' not present in ClusterNetworkInterface JSON') + if (auto_delete := _dict.get('auto_delete')) is not None: + args['auto_delete'] = auto_delete else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUArchitecture JSON') + raise ValueError('Required property \'auto_delete\' not present in ClusterNetworkInterface JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in ClusterNetworkInterface JSON') + if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None: + args['enable_infrastructure_nat'] = enable_infrastructure_nat + else: + raise ValueError('Required property \'enable_infrastructure_nat\' not present in ClusterNetworkInterface JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkInterface JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkInterface JSON') + if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None: + args['lifecycle_reasons'] = [ClusterNetworkInterfaceLifecycleReason.from_dict(v) for v in lifecycle_reasons] + else: + raise ValueError('Required property \'lifecycle_reasons\' not present in ClusterNetworkInterface JSON') + if (lifecycle_state := _dict.get('lifecycle_state')) is not None: + args['lifecycle_state'] = lifecycle_state + else: + raise ValueError('Required property \'lifecycle_state\' not present in ClusterNetworkInterface JSON') + if (mac_address := _dict.get('mac_address')) is not None: + args['mac_address'] = mac_address + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ClusterNetworkInterface JSON') + if (primary_ip := _dict.get('primary_ip')) is not None: + args['primary_ip'] = ClusterNetworkSubnetReservedIPReference.from_dict(primary_ip) + else: + raise ValueError('Required property \'primary_ip\' not present in ClusterNetworkInterface JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkInterface JSON') + if (subnet := _dict.get('subnet')) is not None: + args['subnet'] = ClusterNetworkSubnetReference.from_dict(subnet) + if (target := _dict.get('target')) is not None: + args['target'] = target + if (vpc := _dict.get('vpc')) is not None: + args['vpc'] = VPCReference.from_dict(vpc) + else: + raise ValueError('Required property \'vpc\' not present in ClusterNetworkInterface JSON') + if (zone := _dict.get('zone')) is not None: + args['zone'] = ZoneReference.from_dict(zone) + else: + raise ValueError('Required property \'zone\' not present in ClusterNetworkInterface JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary.""" + """Initialize a ClusterNetworkInterface 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, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + 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 + if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: + lifecycle_reasons_list = [] + for v in self.lifecycle_reasons: + if isinstance(v, dict): + lifecycle_reasons_list.append(v) + else: + lifecycle_reasons_list.append(v.to_dict()) + _dict['lifecycle_reasons'] = lifecycle_reasons_list + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'mac_address') and self.mac_address is not None: + _dict['mac_address'] = self.mac_address + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + 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): @@ -34029,138 +37617,112 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUArchitecture object.""" + """Return a `str` version of this ClusterNetworkInterface object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool: + def __eq__(self, other: 'ClusterNetworkInterface') -> 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: 'BareMetalServerProfileCPUArchitecture') -> bool: + def __ne__(self, other: 'ClusterNetworkInterface') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class LifecycleStateEnum(str, Enum): """ - The type for this profile field. + The lifecycle state of the cluster network interface. """ - FIXED = 'fixed' - - - -class BareMetalServerProfileCPUCoreCount: - """ - BareMetalServerProfileCPUCoreCount. + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - """ - def __init__( - self, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a BareMetalServerProfileCPUCoreCount object. - + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileCPUCoreCountFixed', 'BareMetalServerProfileCPUCoreCountRange', 'BareMetalServerProfileCPUCoreCountEnum', 'BareMetalServerProfileCPUCoreCountDependent']) - ) - raise Exception(msg) - -class BareMetalServerProfileCPUSocketCount: - """ - BareMetalServerProfileCPUSocketCount. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileCPUSocketCount object. + CLUSTER_NETWORK_INTERFACE = 'cluster_network_interface' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileCPUSocketCountFixed', 'BareMetalServerProfileCPUSocketCountRange', 'BareMetalServerProfileCPUSocketCountEnum', 'BareMetalServerProfileCPUSocketCountDependent']) - ) - raise Exception(msg) -class BareMetalServerProfileCollection: +class ClusterNetworkInterfaceCollection: """ - BareMetalServerProfileCollection. + ClusterNetworkInterfaceCollection. - :param BareMetalServerProfileCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. + :param List[ClusterNetworkInterface] interfaces: A page of cluster network + interfaces. :param int limit: The maximum number of resources that can be returned by the request. - :param BareMetalServerProfileCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. - :param List[BareMetalServerProfile] profiles: A page of bare metal server - profiles. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'BareMetalServerProfileCollectionFirst', + first: 'PageLink', + interfaces: List['ClusterNetworkInterface'], limit: int, - profiles: List['BareMetalServerProfile'], total_count: int, *, - next: Optional['BareMetalServerProfileCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a BareMetalServerProfileCollection object. + Initialize a ClusterNetworkInterfaceCollection object. - :param BareMetalServerProfileCollectionFirst first: A link to the first - page of resources. + :param PageLink first: A link to the first page of resources. + :param List[ClusterNetworkInterface] interfaces: A page of cluster network + interfaces. :param int limit: The maximum number of resources that can be returned by the request. - :param List[BareMetalServerProfile] profiles: A page of bare metal server - profiles. :param int total_count: The total number of resources across all pages. - :param BareMetalServerProfileCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first + self.interfaces = interfaces self.limit = limit self.next = next - self.profiles = profiles self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollection': - """Initialize a BareMetalServerProfileCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterfaceCollection': + """Initialize a ClusterNetworkInterfaceCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = BareMetalServerProfileCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'first\' not present in BareMetalServerProfileCollection JSON') + raise ValueError('Required property \'first\' not present in ClusterNetworkInterfaceCollection JSON') + if (interfaces := _dict.get('interfaces')) is not None: + args['interfaces'] = [ClusterNetworkInterface.from_dict(v) for v in interfaces] + else: + raise ValueError('Required property \'interfaces\' not present in ClusterNetworkInterfaceCollection JSON') if (limit := _dict.get('limit')) is not None: args['limit'] = limit else: - raise ValueError('Required property \'limit\' not present in BareMetalServerProfileCollection JSON') + raise ValueError('Required property \'limit\' not present in ClusterNetworkInterfaceCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = BareMetalServerProfileCollectionNext.from_dict(next) - if (profiles := _dict.get('profiles')) is not None: - args['profiles'] = [BareMetalServerProfile.from_dict(v) for v in profiles] - else: - raise ValueError('Required property \'profiles\' not present in BareMetalServerProfileCollection JSON') + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: - raise ValueError('Required property \'total_count\' not present in BareMetalServerProfileCollection JSON') + raise ValueError('Required property \'total_count\' not present in ClusterNetworkInterfaceCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCollection object from a json dictionary.""" + """Initialize a ClusterNetworkInterfaceCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -34171,6 +37733,14 @@ def to_dict(self) -> Dict: _dict['first'] = self.first else: _dict['first'] = self.first.to_dict() + if hasattr(self, 'interfaces') and self.interfaces is not None: + interfaces_list = [] + for v in self.interfaces: + if isinstance(v, dict): + interfaces_list.append(v) + else: + interfaces_list.append(v.to_dict()) + _dict['interfaces'] = interfaces_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: @@ -34178,14 +37748,6 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: - if isinstance(v, dict): - profiles_list.append(v) - else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -34195,58 +37757,92 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCollection object.""" + """Return a `str` version of this ClusterNetworkInterfaceCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCollection') -> bool: + def __eq__(self, other: 'ClusterNetworkInterfaceCollection') -> 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: 'BareMetalServerProfileCollection') -> bool: + def __ne__(self, other: 'ClusterNetworkInterfaceCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerProfileCollectionFirst: +class ClusterNetworkInterfaceLifecycleReason: """ - A link to the first page of resources. + ClusterNetworkInterfaceLifecycleReason. - :param str href: The URL for a page of resources. + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for this + lifecycle state. """ def __init__( self, - href: str, + code: str, + message: str, + *, + more_info: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerProfileCollectionFirst object. + Initialize a ClusterNetworkInterfaceLifecycleReason object. - :param str href: The URL for a page of resources. + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended + (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. """ - self.href = href + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollectionFirst': - """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterfaceLifecycleReason': + """Initialize a ClusterNetworkInterfaceLifecycleReason object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (code := _dict.get('code')) is not None: + args['code'] = code + else: + raise ValueError('Required property \'code\' not present in ClusterNetworkInterfaceLifecycleReason JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionFirst JSON') + raise ValueError('Required property \'message\' not present in ClusterNetworkInterfaceLifecycleReason JSON') + if (more_info := _dict.get('more_info')) is not None: + args['more_info'] = more_info return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary.""" + """Initialize a ClusterNetworkInterfaceLifecycleReason 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, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -34254,59 +37850,90 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCollectionFirst object.""" + """Return a `str` version of this ClusterNetworkInterfaceLifecycleReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool: + def __eq__(self, other: 'ClusterNetworkInterfaceLifecycleReason') -> 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: 'BareMetalServerProfileCollectionFirst') -> bool: + def __ne__(self, other: 'ClusterNetworkInterfaceLifecycleReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class CodeEnum(str, Enum): + """ + A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + INTERNAL_ERROR = 'internal_error' + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' + + -class BareMetalServerProfileCollectionNext: +class ClusterNetworkInterfacePatch: """ - A link to the next page of resources. This property is present for all pages except - the last page. + ClusterNetworkInterfacePatch. - :param str href: The URL for a page of resources. + :param bool auto_delete: (optional) Indicates whether this cluster network + interface will be automatically deleted when `target` is deleted. Must be + `false` if the cluster network interface is unbound. + :param str name: (optional) The name for this cluster network interface. The + name must not be used by another interface in the cluster network. Names + beginning with `ibm-` are reserved for provider-owned resources, and are not + allowed. """ def __init__( self, - href: str, + *, + auto_delete: Optional[bool] = None, + name: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerProfileCollectionNext object. + Initialize a ClusterNetworkInterfacePatch object. - :param str href: The URL for a page of resources. + :param bool auto_delete: (optional) Indicates whether this cluster network + interface will be automatically deleted when `target` is deleted. Must be + `false` if the cluster network interface is unbound. + :param str name: (optional) The name for this cluster network interface. + The name must not be used by another interface in the cluster network. + Names beginning with `ibm-` are reserved for provider-owned resources, and + are not allowed. """ - self.href = href + self.auto_delete = auto_delete + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollectionNext': - """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterfacePatch': + """Initialize a ClusterNetworkInterfacePatch object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionNext JSON') + if (auto_delete := _dict.get('auto_delete')) is not None: + args['auto_delete'] = auto_delete + if (name := _dict.get('name')) is not None: + args['name'] = name return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary.""" + """Initialize a ClusterNetworkInterfacePatch 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, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -34314,70 +37941,153 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCollectionNext object.""" + """Return a `str` version of this ClusterNetworkInterfacePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCollectionNext') -> bool: + def __eq__(self, other: 'ClusterNetworkInterfacePatch') -> 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: 'BareMetalServerProfileCollectionNext') -> bool: + def __ne__(self, other: 'ClusterNetworkInterfacePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerProfileConsoleTypes: +class ClusterNetworkInterfacePrimaryIPPrototype: """ - The console type configuration for a bare metal server with this profile. + ClusterNetworkInterfacePrimaryIPPrototype. - :param str type: The type for this profile field. - :param List[str] values: The console types for a bare metal server with this - profile. """ def __init__( self, - type: str, - values: List[str], ) -> None: """ - Initialize a BareMetalServerProfileConsoleTypes object. + Initialize a ClusterNetworkInterfacePrimaryIPPrototype object. - :param str type: The type for this profile field. - :param List[str] values: The console types for a bare metal server with - this profile. """ - self.type = type - self.values = values + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext', 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext']) + ) + raise Exception(msg) + + +class ClusterNetworkInterfaceReference: + """ + The associated cluster network subnet. + + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. + :param str href: The URL for this cluster network interface. + :param str id: The unique identifier for this cluster network interface. + :param str name: The name for this cluster network interface. The name is unique + across all interfaces in the cluster network. + :param ClusterNetworkSubnetReservedIPReference primary_ip: The primary IP for + this cluster network interface. + :param str resource_type: The resource type. + :param ClusterNetworkSubnetReference subnet: + """ + + def __init__( + self, + href: str, + id: str, + name: str, + primary_ip: 'ClusterNetworkSubnetReservedIPReference', + resource_type: str, + subnet: 'ClusterNetworkSubnetReference', + *, + deleted: Optional['Deleted'] = None, + ) -> None: + """ + Initialize a ClusterNetworkInterfaceReference object. + + :param str href: The URL for this cluster network interface. + :param str id: The unique identifier for this cluster network interface. + :param str name: The name for this cluster network interface. The name is + unique across all interfaces in the cluster network. + :param ClusterNetworkSubnetReservedIPReference primary_ip: The primary IP + for this cluster network interface. + :param str resource_type: The resource type. + :param ClusterNetworkSubnetReference subnet: + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. + """ + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.primary_ip = primary_ip + self.resource_type = resource_type + self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileConsoleTypes': - """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterfaceReference': + """Initialize a ClusterNetworkInterfaceReference object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type + if (deleted := _dict.get('deleted')) is not None: + args['deleted'] = Deleted.from_dict(deleted) + if (href := _dict.get('href')) is not None: + args['href'] = href else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileConsoleTypes JSON') - if (values := _dict.get('values')) is not None: - args['values'] = values + raise ValueError('Required property \'href\' not present in ClusterNetworkInterfaceReference JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileConsoleTypes JSON') + raise ValueError('Required property \'id\' not present in ClusterNetworkInterfaceReference JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ClusterNetworkInterfaceReference JSON') + if (primary_ip := _dict.get('primary_ip')) is not None: + args['primary_ip'] = ClusterNetworkSubnetReservedIPReference.from_dict(primary_ip) + else: + raise ValueError('Required property \'primary_ip\' not present in ClusterNetworkInterfaceReference JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkInterfaceReference JSON') + if (subnet := _dict.get('subnet')) is not None: + args['subnet'] = ClusterNetworkSubnetReference.from_dict(subnet) + else: + raise ValueError('Required property \'subnet\' not present in ClusterNetworkInterfaceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary.""" + """Initialize a ClusterNetworkInterfaceReference 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, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -34385,105 +38095,122 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileConsoleTypes object.""" + """Return a `str` version of this ClusterNetworkInterfaceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool: + def __eq__(self, other: 'ClusterNetworkInterfaceReference') -> 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: 'BareMetalServerProfileConsoleTypes') -> bool: + def __ne__(self, other: 'ClusterNetworkInterfaceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The resource type. """ - ENUM = 'enum' + CLUSTER_NETWORK_INTERFACE = 'cluster_network_interface' - class ValuesEnum(str, Enum): - """ - A console type. - """ - SERIAL = 'serial' - VNC = 'vnc' +class ClusterNetworkInterfaceTarget: + """ + The target of this cluster network interface. + If absent, this cluster network interface is not attached to a target. + The resources supported by this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + """ + def __init__( + self, + ) -> None: + """ + Initialize a ClusterNetworkInterfaceTarget object. -class BareMetalServerProfileDisk: + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext']) + ) + raise Exception(msg) + + +class ClusterNetworkLifecycleReason: """ - Disks provided by this profile. + ClusterNetworkLifecycleReason. - :param BareMetalServerProfileDiskQuantity quantity: - :param BareMetalServerProfileDiskSize size: - :param BareMetalServerProfileDiskSupportedInterfaces supported_interface_types: + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for this + lifecycle state. """ def __init__( self, - quantity: 'BareMetalServerProfileDiskQuantity', - size: 'BareMetalServerProfileDiskSize', - supported_interface_types: 'BareMetalServerProfileDiskSupportedInterfaces', + code: str, + message: str, + *, + more_info: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerProfileDisk object. + Initialize a ClusterNetworkLifecycleReason object. - :param BareMetalServerProfileDiskQuantity quantity: - :param BareMetalServerProfileDiskSize size: - :param BareMetalServerProfileDiskSupportedInterfaces - supported_interface_types: + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended + (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. """ - self.quantity = quantity - self.size = size - self.supported_interface_types = supported_interface_types + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDisk': - """Initialize a BareMetalServerProfileDisk object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkLifecycleReason': + """Initialize a ClusterNetworkLifecycleReason object from a json dictionary.""" args = {} - if (quantity := _dict.get('quantity')) is not None: - args['quantity'] = quantity - else: - raise ValueError('Required property \'quantity\' not present in BareMetalServerProfileDisk JSON') - if (size := _dict.get('size')) is not None: - args['size'] = size + if (code := _dict.get('code')) is not None: + args['code'] = code else: - raise ValueError('Required property \'size\' not present in BareMetalServerProfileDisk JSON') - if (supported_interface_types := _dict.get('supported_interface_types')) is not None: - args['supported_interface_types'] = BareMetalServerProfileDiskSupportedInterfaces.from_dict(supported_interface_types) + raise ValueError('Required property \'code\' not present in ClusterNetworkLifecycleReason JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message else: - raise ValueError('Required property \'supported_interface_types\' not present in BareMetalServerProfileDisk JSON') + raise ValueError('Required property \'message\' not present in ClusterNetworkLifecycleReason JSON') + if (more_info := _dict.get('more_info')) is not None: + args['more_info'] = more_info return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDisk object from a json dictionary.""" + """Initialize a ClusterNetworkLifecycleReason 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, 'quantity') and self.quantity is not None: - if isinstance(self.quantity, dict): - _dict['quantity'] = self.quantity - else: - _dict['quantity'] = self.quantity.to_dict() - if hasattr(self, 'size') and self.size is not None: - if isinstance(self.size, dict): - _dict['size'] = self.size - else: - _dict['size'] = self.size.to_dict() - if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None: - if isinstance(self.supported_interface_types, dict): - _dict['supported_interface_types'] = self.supported_interface_types - else: - _dict['supported_interface_types'] = self.supported_interface_types.to_dict() + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -34491,118 +38218,208 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDisk object.""" + """Return a `str` version of this ClusterNetworkLifecycleReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDisk') -> bool: + def __eq__(self, other: 'ClusterNetworkLifecycleReason') -> 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: 'BareMetalServerProfileDisk') -> bool: + def __ne__(self, other: 'ClusterNetworkLifecycleReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class CodeEnum(str, Enum): + """ + A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + INTERNAL_ERROR = 'internal_error' + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' -class BareMetalServerProfileDiskQuantity: + + +class ClusterNetworkPatch: """ - BareMetalServerProfileDiskQuantity. + ClusterNetworkPatch. + :param str name: (optional) The name for this cluster network. The name must not + be used by another cluster network in the region. Names starting with `ibm-` are + reserved for provider-owned resources, and are not allowed. """ def __init__( self, + *, + name: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerProfileDiskQuantity object. + Initialize a ClusterNetworkPatch object. + :param str name: (optional) The name for this cluster network. The name + must not be used by another cluster network in the region. Names starting + with `ibm-` are reserved for provider-owned resources, and are not allowed. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileDiskQuantityFixed', 'BareMetalServerProfileDiskQuantityRange', 'BareMetalServerProfileDiskQuantityEnum', 'BareMetalServerProfileDiskQuantityDependent']) - ) - raise Exception(msg) + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkPatch': + """Initialize a ClusterNetworkPatch object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkPatch object from a json dictionary.""" + return cls.from_dict(_dict) -class BareMetalServerProfileDiskSize: - """ - BareMetalServerProfileDiskSize. + 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 __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileDiskSize object. + def __str__(self) -> str: + """Return a `str` version of this ClusterNetworkPatch object.""" + return json.dumps(self.to_dict(), indent=2) - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileDiskSizeFixed', 'BareMetalServerProfileDiskSizeRange', 'BareMetalServerProfileDiskSizeEnum', 'BareMetalServerProfileDiskSizeDependent']) - ) - raise Exception(msg) + def __eq__(self, other: 'ClusterNetworkPatch') -> 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: 'ClusterNetworkPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class BareMetalServerProfileDiskSupportedInterfaces: +class ClusterNetworkProfile: """ - BareMetalServerProfileDiskSupportedInterfaces. + ClusterNetworkProfile. - :param str default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[str] values: The supported disk interfaces used for attaching the - disk. + :param str family: The product family this cluster network profile belongs to. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str href: The URL for this cluster network profile. + :param str name: The globally unique name for this cluster network profile. + :param str resource_type: The resource type. + :param List[InstanceProfileReference] supported_instance_profiles: The instance + profiles that support this cluster network profile. + :param List[ZoneReference] zones: Zones in this region that support this cluster + network profile. """ def __init__( self, - default: str, - type: str, - values: List[str], + family: str, + href: str, + name: str, + resource_type: str, + supported_instance_profiles: List['InstanceProfileReference'], + zones: List['ZoneReference'], ) -> None: """ - Initialize a BareMetalServerProfileDiskSupportedInterfaces object. + Initialize a ClusterNetworkProfile object. - :param str default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[str] values: The supported disk interfaces used for attaching - the disk. + :param str family: The product family this cluster network profile belongs + to. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str href: The URL for this cluster network profile. + :param str name: The globally unique name for this cluster network profile. + :param str resource_type: The resource type. + :param List[InstanceProfileReference] supported_instance_profiles: The + instance profiles that support this cluster network profile. + :param List[ZoneReference] zones: Zones in this region that support this + cluster network profile. """ - self.default = default - self.type = type - self.values = values + self.family = family + self.href = href + self.name = name + self.resource_type = resource_type + self.supported_instance_profiles = supported_instance_profiles + self.zones = zones @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSupportedInterfaces': - """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkProfile': + """Initialize a ClusterNetworkProfile object from a json dictionary.""" args = {} - if (default := _dict.get('default')) is not None: - args['default'] = default + if (family := _dict.get('family')) is not None: + args['family'] = family else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') - if (type := _dict.get('type')) is not None: - args['type'] = type + raise ValueError('Required property \'family\' not present in ClusterNetworkProfile JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') - if (values := _dict.get('values')) is not None: - args['values'] = values + raise ValueError('Required property \'href\' not present in ClusterNetworkProfile JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') + raise ValueError('Required property \'name\' not present in ClusterNetworkProfile JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkProfile JSON') + if (supported_instance_profiles := _dict.get('supported_instance_profiles')) is not None: + args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in supported_instance_profiles] + else: + raise ValueError('Required property \'supported_instance_profiles\' not present in ClusterNetworkProfile JSON') + if (zones := _dict.get('zones')) is not None: + args['zones'] = [ZoneReference.from_dict(v) for v in zones] + else: + raise ValueError('Required property \'zones\' not present in ClusterNetworkProfile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary.""" + """Initialize a ClusterNetworkProfile 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, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'family') and self.family is not None: + _dict['family'] = self.family + 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 + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None: + supported_instance_profiles_list = [] + for v in self.supported_instance_profiles: + if isinstance(v, dict): + supported_instance_profiles_list.append(v) + else: + supported_instance_profiles_list.append(v.to_dict()) + _dict['supported_instance_profiles'] = supported_instance_profiles_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): @@ -34610,114 +38427,159 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskSupportedInterfaces object.""" + """Return a `str` version of this ClusterNetworkProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool: + def __eq__(self, other: 'ClusterNetworkProfile') -> 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: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool: + def __ne__(self, other: 'ClusterNetworkProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DefaultEnum(str, Enum): - """ - The default value for this profile field. - """ - - FCP = 'fcp' - NVME = 'nvme' - SATA = 'sata' - - - class TypeEnum(str, Enum): + class FamilyEnum(str, Enum): """ - The type for this profile field. + The product family this cluster network profile belongs to. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - ENUM = 'enum' + VELA = 'vela' - class ValuesEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The disk attachment interface used: - - `fcp`: Fiber Channel Protocol - - `sata`: Serial Advanced Technology Attachment - - `nvme`: Non-Volatile Memory Express - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. + The resource type. """ - FCP = 'fcp' - NVME = 'nvme' - SATA = 'sata' + CLUSTER_NETWORK_PROFILE = 'cluster_network_profile' -class BareMetalServerProfileIdentity: +class ClusterNetworkProfileCollection: """ - Identifies a bare metal server profile by a unique property. + ClusterNetworkProfileCollection. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param List[ClusterNetworkProfile] profiles: A page of cluster network profiles. + :param int total_count: The total number of resources across all pages. """ def __init__( self, + first: 'PageLink', + limit: int, + profiles: List['ClusterNetworkProfile'], + total_count: int, + *, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a BareMetalServerProfileIdentity object. + Initialize a ClusterNetworkProfileCollection object. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[ClusterNetworkProfile] profiles: A page of cluster network + profiles. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileIdentityByName', 'BareMetalServerProfileIdentityByHref']) - ) - raise Exception(msg) - - -class BareMetalServerProfileMemory: - """ - BareMetalServerProfileMemory. - - """ + self.first = first + self.limit = limit + self.next = next + self.profiles = profiles + self.total_count = total_count - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileMemory object. + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkProfileCollection': + """Initialize a ClusterNetworkProfileCollection object from a json dictionary.""" + args = {} + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in ClusterNetworkProfileCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in ClusterNetworkProfileCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (profiles := _dict.get('profiles')) is not None: + args['profiles'] = [ClusterNetworkProfile.from_dict(v) for v in profiles] + else: + raise ValueError('Required property \'profiles\' not present in ClusterNetworkProfileCollection JSON') + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in ClusterNetworkProfileCollection JSON') + return cls(**args) - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileMemoryFixed', 'BareMetalServerProfileMemoryRange', 'BareMetalServerProfileMemoryEnum', 'BareMetalServerProfileMemoryDependent']) - ) - raise Exception(msg) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkProfileCollection 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, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + return _dict -class BareMetalServerProfileNetworkAttachmentCount: - """ - BareMetalServerProfileNetworkAttachmentCount. + 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 ClusterNetworkProfileCollection object.""" + return json.dumps(self.to_dict(), indent=2) - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileNetworkAttachmentCount object. + def __eq__(self, other: 'ClusterNetworkProfileCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileNetworkAttachmentCountRange', 'BareMetalServerProfileNetworkAttachmentCountDependent']) - ) - raise Exception(msg) + def __ne__(self, other: 'ClusterNetworkProfileCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class BareMetalServerProfileNetworkInterfaceCount: +class ClusterNetworkProfileIdentity: """ - BareMetalServerProfileNetworkInterfaceCount. + Identifies an cluster network profile by a unique property. """ @@ -34725,77 +38587,73 @@ def __init__( self, ) -> None: """ - Initialize a BareMetalServerProfileNetworkInterfaceCount object. + Initialize a ClusterNetworkProfileIdentity object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileNetworkInterfaceCountRange', 'BareMetalServerProfileNetworkInterfaceCountDependent']) + ", ".join(['ClusterNetworkProfileIdentityByName', 'ClusterNetworkProfileIdentityByHref']) ) raise Exception(msg) -class BareMetalServerProfileOSArchitecture: +class ClusterNetworkProfileReference: """ - BareMetalServerProfileOSArchitecture. + ClusterNetworkProfileReference. - :param str default: The default OS architecture for a bare metal server with - this profile. - :param str type: The type for this profile field. - :param List[str] values: The supported OS architecture(s) for a bare metal - server with this profile. + :param str href: The URL for this cluster network profile. + :param str name: The globally unique name for this cluster network profile. + :param str resource_type: The resource type. """ def __init__( self, - default: str, - type: str, - values: List[str], + href: str, + name: str, + resource_type: str, ) -> None: """ - Initialize a BareMetalServerProfileOSArchitecture object. + Initialize a ClusterNetworkProfileReference object. - :param str default: The default OS architecture for a bare metal server - with this profile. - :param str type: The type for this profile field. - :param List[str] values: The supported OS architecture(s) for a bare metal - server with this profile. + :param str href: The URL for this cluster network profile. + :param str name: The globally unique name for this cluster network profile. + :param str resource_type: The resource type. """ - self.default = default - self.type = type - self.values = values + self.href = href + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileOSArchitecture': - """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkProfileReference': + """Initialize a ClusterNetworkProfileReference object from a json dictionary.""" args = {} - if (default := _dict.get('default')) is not None: - args['default'] = default + if (href := _dict.get('href')) is not None: + args['href'] = href else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileOSArchitecture JSON') - if (type := _dict.get('type')) is not None: - args['type'] = type + raise ValueError('Required property \'href\' not present in ClusterNetworkProfileReference JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileOSArchitecture JSON') - if (values := _dict.get('values')) is not None: - args['values'] = values + raise ValueError('Required property \'name\' not present in ClusterNetworkProfileReference JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileOSArchitecture JSON') + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkProfileReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary.""" + """Initialize a ClusterNetworkProfileReference 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, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + 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 + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -34803,82 +38661,120 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileOSArchitecture object.""" + """Return a `str` version of this ClusterNetworkProfileReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool: + def __eq__(self, other: 'ClusterNetworkProfileReference') -> 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: 'BareMetalServerProfileOSArchitecture') -> bool: + def __ne__(self, other: 'ClusterNetworkProfileReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The resource type. """ - ENUM = 'enum' + CLUSTER_NETWORK_PROFILE = 'cluster_network_profile' -class BareMetalServerProfileReference: +class ClusterNetworkReference: """ - BareMetalServerProfileReference. + ClusterNetworkReference. - :param str href: The URL for this bare metal server profile. - :param str name: The name for this bare metal server profile. + :param str crn: The CRN for this cluster network. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. + :param str href: The URL for this cluster network. + :param str id: The unique identifier for this cluster network. + :param str name: The name for this cluster network. The name must not be used by + another cluster network in the region. :param str resource_type: The resource type. """ def __init__( self, + crn: str, href: str, + id: str, name: str, resource_type: str, + *, + deleted: Optional['Deleted'] = None, ) -> None: """ - Initialize a BareMetalServerProfileReference object. + Initialize a ClusterNetworkReference object. - :param str href: The URL for this bare metal server profile. - :param str name: The name for this bare metal server profile. + :param str crn: The CRN for this cluster network. + :param str href: The URL for this cluster network. + :param str id: The unique identifier for this cluster network. + :param str name: The name for this cluster network. The name must not be + used by another cluster network in the region. :param str resource_type: The resource type. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. """ + self.crn = crn + self.deleted = deleted self.href = href + self.id = id self.name = name self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileReference': - """Initialize a BareMetalServerProfileReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkReference': + """Initialize a ClusterNetworkReference object from a json dictionary.""" args = {} + if (crn := _dict.get('crn')) is not None: + args['crn'] = crn + else: + raise ValueError('Required property \'crn\' not present in ClusterNetworkReference JSON') + if (deleted := _dict.get('deleted')) is not None: + args['deleted'] = Deleted.from_dict(deleted) if (href := _dict.get('href')) is not None: args['href'] = href else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfileReference JSON') + raise ValueError('Required property \'href\' not present in ClusterNetworkReference JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkReference JSON') if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in BareMetalServerProfileReference JSON') + raise ValueError('Required property \'name\' not present in ClusterNetworkReference JSON') if (resource_type := _dict.get('resource_type')) is not None: args['resource_type'] = resource_type else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfileReference JSON') + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileReference object from a json dictionary.""" + """Initialize a ClusterNetworkReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_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 if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_type') and self.resource_type is not None: @@ -34890,16 +38786,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileReference object.""" + """Return a `str` version of this ClusterNetworkReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileReference') -> bool: + def __eq__(self, other: 'ClusterNetworkReference') -> 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: 'BareMetalServerProfileReference') -> bool: + def __ne__(self, other: 'ClusterNetworkReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -34908,69 +38804,181 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile' + CLUSTER_NETWORK = 'cluster_network' -class BareMetalServerProfileSupportedTrustedPlatformModuleModes: +class ClusterNetworkSubnet: """ - The supported trusted platform module modes for this bare metal server profile. + ClusterNetworkSubnet. - :param str default: (optional) The default trusted platform module for a bare - metal server with this profile. - :param str type: The type for this profile field. - :param List[str] values: The supported trusted platform module modes. + :param int available_ipv4_address_count: The number of IPv4 addresses in this + cluster network subnet that are not in use, and have not been reserved by the + user or the provider. + :param datetime created_at: The date and time that the cluster network subnet + was created. + :param str href: The URL for this cluster network subnet. + :param str id: The unique identifier for this cluster network subnet. + :param str ip_version: The IP version for this cluster network subnet. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str ipv4_cidr_block: The IPv4 range of this cluster network subnet, + expressed in CIDR format. + :param List[ClusterNetworkSubnetLifecycleReason] lifecycle_reasons: The reasons + for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the cluster network subnet. + :param str name: The name for this cluster network subnet. The name is unique + across all cluster network subnets in the cluster network. + :param str resource_type: The resource type. + :param int total_ipv4_address_count: The total number of IPv4 addresses in this + cluster network subnet. + Note: This is calculated as 2(32 - prefix length). For example, the + prefix length `/24` gives:
2(32 - 24) = 28 = 256 + addresses. """ def __init__( self, - type: str, - values: List[str], - *, - default: Optional[str] = None, + available_ipv4_address_count: int, + created_at: datetime, + href: str, + id: str, + ip_version: str, + ipv4_cidr_block: str, + lifecycle_reasons: List['ClusterNetworkSubnetLifecycleReason'], + lifecycle_state: str, + name: str, + resource_type: str, + total_ipv4_address_count: int, ) -> None: """ - Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object. + Initialize a ClusterNetworkSubnet object. - :param str type: The type for this profile field. - :param List[str] values: The supported trusted platform module modes. - :param str default: (optional) The default trusted platform module for a - bare metal server with this profile. + :param int available_ipv4_address_count: The number of IPv4 addresses in + this cluster network subnet that are not in use, and have not been reserved + by the user or the provider. + :param datetime created_at: The date and time that the cluster network + subnet was created. + :param str href: The URL for this cluster network subnet. + :param str id: The unique identifier for this cluster network subnet. + :param str ip_version: The IP version for this cluster network subnet. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str ipv4_cidr_block: The IPv4 range of this cluster network subnet, + expressed in CIDR format. + :param List[ClusterNetworkSubnetLifecycleReason] lifecycle_reasons: The + reasons for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the cluster network + subnet. + :param str name: The name for this cluster network subnet. The name is + unique across all cluster network subnets in the cluster network. + :param str resource_type: The resource type. + :param int total_ipv4_address_count: The total number of IPv4 addresses in + this cluster network subnet. + Note: This is calculated as 2(32 - prefix length). For example, + the prefix length `/24` gives:
2(32 - 24) = 28 = + 256 addresses. """ - self.default = default - self.type = type - self.values = values + self.available_ipv4_address_count = available_ipv4_address_count + self.created_at = created_at + self.href = href + self.id = id + self.ip_version = ip_version + self.ipv4_cidr_block = ipv4_cidr_block + self.lifecycle_reasons = lifecycle_reasons + self.lifecycle_state = lifecycle_state + self.name = name + self.resource_type = resource_type + self.total_ipv4_address_count = total_ipv4_address_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileSupportedTrustedPlatformModuleModes': - """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnet': + """Initialize a ClusterNetworkSubnet object from a json dictionary.""" args = {} - if (default := _dict.get('default')) is not None: - args['default'] = default - if (type := _dict.get('type')) is not None: - args['type'] = type + if (available_ipv4_address_count := _dict.get('available_ipv4_address_count')) is not None: + args['available_ipv4_address_count'] = available_ipv4_address_count + else: + raise ValueError('Required property \'available_ipv4_address_count\' not present in ClusterNetworkSubnet JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in ClusterNetworkSubnet JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkSubnet JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkSubnet JSON') + if (ip_version := _dict.get('ip_version')) is not None: + args['ip_version'] = ip_version + else: + raise ValueError('Required property \'ip_version\' not present in ClusterNetworkSubnet JSON') + if (ipv4_cidr_block := _dict.get('ipv4_cidr_block')) is not None: + args['ipv4_cidr_block'] = ipv4_cidr_block + else: + raise ValueError('Required property \'ipv4_cidr_block\' not present in ClusterNetworkSubnet JSON') + if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None: + args['lifecycle_reasons'] = [ClusterNetworkSubnetLifecycleReason.from_dict(v) for v in lifecycle_reasons] + else: + raise ValueError('Required property \'lifecycle_reasons\' not present in ClusterNetworkSubnet JSON') + if (lifecycle_state := _dict.get('lifecycle_state')) is not None: + args['lifecycle_state'] = lifecycle_state + else: + raise ValueError('Required property \'lifecycle_state\' not present in ClusterNetworkSubnet JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON') - if (values := _dict.get('values')) is not None: - args['values'] = values + raise ValueError('Required property \'name\' not present in ClusterNetworkSubnet JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON') + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkSubnet JSON') + if (total_ipv4_address_count := _dict.get('total_ipv4_address_count')) is not None: + args['total_ipv4_address_count'] = total_ipv4_address_count + else: + raise ValueError('Required property \'total_ipv4_address_count\' not present in ClusterNetworkSubnet JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary.""" + """Initialize a ClusterNetworkSubnet 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, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'available_ipv4_address_count') and self.available_ipv4_address_count is not None: + _dict['available_ipv4_address_count'] = self.available_ipv4_address_count + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + 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 + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'ipv4_cidr_block') and self.ipv4_cidr_block is not None: + _dict['ipv4_cidr_block'] = self.ipv4_cidr_block + if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: + lifecycle_reasons_list = [] + for v in self.lifecycle_reasons: + if isinstance(v, dict): + lifecycle_reasons_list.append(v) + else: + lifecycle_reasons_list.append(v.to_dict()) + _dict['lifecycle_reasons'] = lifecycle_reasons_list + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'total_ipv4_address_count') and self.total_ipv4_address_count is not None: + _dict['total_ipv4_address_count'] = self.total_ipv4_address_count return _dict def _to_dict(self): @@ -34978,99 +38986,150 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileSupportedTrustedPlatformModuleModes object.""" + """Return a `str` version of this ClusterNetworkSubnet object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnet') -> 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: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnet') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DefaultEnum(str, Enum): + class IpVersionEnum(str, Enum): """ - The default trusted platform module for a bare metal server with this profile. + The IP version for this cluster network subnet. + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ - DISABLED = 'disabled' - TPM_2 = 'tpm_2' + IPV4 = 'ipv4' - class TypeEnum(str, Enum): + class LifecycleStateEnum(str, Enum): """ - The type for this profile field. + The lifecycle state of the cluster network subnet. """ - ENUM = 'enum' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - class ValuesEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `tpm_2`: TPM 2.0 - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. + The resource type. """ - DISABLED = 'disabled' - TPM_2 = 'tpm_2' + CLUSTER_NETWORK_SUBNET = 'cluster_network_subnet' -class BareMetalServerProfileVirtualNetworkInterfacesSupported: +class ClusterNetworkSubnetCollection: """ - Indicates whether this profile supports virtual network interfaces. + ClusterNetworkSubnetCollection. - :param str type: The type for this profile field. - :param bool value: The value for this profile field. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param List[ClusterNetworkSubnet] subnets: A page of subnets for the cluster + network. + :param int total_count: The total number of resources across all pages. """ def __init__( self, - type: str, - value: bool, + first: 'PageLink', + limit: int, + subnets: List['ClusterNetworkSubnet'], + total_count: int, + *, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported object. + Initialize a ClusterNetworkSubnetCollection object. - :param str type: The type for this profile field. - :param bool value: The value for this profile field. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[ClusterNetworkSubnet] subnets: A page of subnets for the + cluster network. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ - self.type = type - self.value = value + self.first = first + self.limit = limit + self.next = next + self.subnets = subnets + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileVirtualNetworkInterfacesSupported': - """Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetCollection': + """Initialize a ClusterNetworkSubnetCollection object from a json dictionary.""" args = {} - if (type := _dict.get('type')) is not None: - args['type'] = type + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileVirtualNetworkInterfacesSupported JSON') - if (value := _dict.get('value')) is not None: - args['value'] = value + raise ValueError('Required property \'first\' not present in ClusterNetworkSubnetCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileVirtualNetworkInterfacesSupported JSON') + raise ValueError('Required property \'limit\' not present in ClusterNetworkSubnetCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (subnets := _dict.get('subnets')) is not None: + args['subnets'] = [ClusterNetworkSubnet.from_dict(v) for v in subnets] + else: + raise ValueError('Required property \'subnets\' not present in ClusterNetworkSubnetCollection JSON') + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in ClusterNetworkSubnetCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetCollection 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, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'subnets') and self.subnets is not None: + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -35078,129 +39137,53 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileVirtualNetworkInterfacesSupported object.""" + """Return a `str` version of this ClusterNetworkSubnetCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileVirtualNetworkInterfacesSupported') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetCollection') -> 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: 'BareMetalServerProfileVirtualNetworkInterfacesSupported') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class BareMetalServerPrototype: +class ClusterNetworkSubnetIdentity: """ - BareMetalServerPrototype. + Identifies a cluster network subnet by a unique property. - :param int bandwidth: (optional) The total bandwidth (in megabits per second) - shared across the bare metal server's network interfaces. The specified value - must match one of the bandwidth values in the bare metal server's profile. If - unspecified, the default value from the profile will be used. - :param bool enable_secure_boot: (optional) Indicates whether secure boot is - enabled. If enabled, the image must support secure boot or the server will fail - to boot. - :param BareMetalServerInitializationPrototype initialization: - :param str name: (optional) The name for this bare metal server. The name must - not be used by another bare metal server in the region. If unspecified, the name - will be a hyphenated list of randomly-selected words. - The system hostname will be based on this name. - :param BareMetalServerProfileIdentity profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - to use for this bare metal server. - :param ResourceGroupIdentity resource_group: (optional) The resource group to - use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. - :param BareMetalServerTrustedPlatformModulePrototype trusted_platform_module: - (optional) - :param VPCIdentity vpc: (optional) The VPC this bare metal server will reside - in. - If specified, it must match the VPC for the subnets that the network attachments - or - network interfaces of the bare metal server are attached to. - :param ZoneIdentity zone: The zone this bare metal server will reside in. """ def __init__( self, - initialization: 'BareMetalServerInitializationPrototype', - profile: 'BareMetalServerProfileIdentity', - zone: 'ZoneIdentity', - *, - bandwidth: Optional[int] = None, - enable_secure_boot: Optional[bool] = None, - name: Optional[str] = None, - resource_group: Optional['ResourceGroupIdentity'] = None, - trusted_platform_module: Optional['BareMetalServerTrustedPlatformModulePrototype'] = None, - vpc: Optional['VPCIdentity'] = None, ) -> None: """ - Initialize a BareMetalServerPrototype object. + Initialize a ClusterNetworkSubnetIdentity object. - :param BareMetalServerInitializationPrototype initialization: - :param BareMetalServerProfileIdentity profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - to use for this bare metal server. - :param ZoneIdentity zone: The zone this bare metal server will reside in. - :param int bandwidth: (optional) The total bandwidth (in megabits per - second) shared across the bare metal server's network interfaces. The - specified value must match one of the bandwidth values in the bare metal - server's profile. If unspecified, the default value from the profile will - be used. - :param bool enable_secure_boot: (optional) Indicates whether secure boot is - enabled. If enabled, the image must support secure boot or the server will - fail to boot. - :param str name: (optional) The name for this bare metal server. The name - must not be used by another bare metal server in the region. If - unspecified, the name will be a hyphenated list of randomly-selected words. - The system hostname will be based on this name. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be - used. - :param BareMetalServerTrustedPlatformModulePrototype - trusted_platform_module: (optional) - :param VPCIdentity vpc: (optional) The VPC this bare metal server will - reside in. - If specified, it must match the VPC for the subnets that the network - attachments or - network interfaces of the bare metal server are attached to. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerPrototypeBareMetalServerByNetworkAttachment', 'BareMetalServerPrototypeBareMetalServerByNetworkInterface']) + ", ".join(['ClusterNetworkSubnetIdentityById', 'ClusterNetworkSubnetIdentityByHref']) ) raise Exception(msg) -class BareMetalServerStatusReason: +class ClusterNetworkSubnetLifecycleReason: """ - BareMetalServerStatusReason. + ClusterNetworkSubnetLifecycleReason. - :param str code: The status reason code: - - `cannot_start`: Failed to start due to an internal error - - `cannot_start_capacity`: Insufficient capacity within the selected zone - - `cannot_start_compute`: An error occurred while allocating compute resources - - `cannot_start_ip_address`: An error occurred while allocating an IP address - - `cannot_start_network`: An error occurred while allocating network resources - - `cannot_update_firmware`: An error occurred while updating bare metal server - firmware + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param str message: An explanation of the status reason. - :param str more_info: (optional) Link to documentation about this status reason. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for this + lifecycle state. """ def __init__( @@ -35211,49 +39194,43 @@ def __init__( more_info: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerStatusReason object. + Initialize a ClusterNetworkSubnetLifecycleReason object. - :param str code: The status reason code: - - `cannot_start`: Failed to start due to an internal error - - `cannot_start_capacity`: Insufficient capacity within the selected zone - - `cannot_start_compute`: An error occurred while allocating compute - resources - - `cannot_start_ip_address`: An error occurred while allocating an IP - address - - `cannot_start_network`: An error occurred while allocating network - resources - - `cannot_update_firmware`: An error occurred while updating bare metal - server firmware + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended + (contact IBM + support) The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param str message: An explanation of the status reason. - :param str more_info: (optional) Link to documentation about this status - reason. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. """ self.code = code self.message = message self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerStatusReason': - """Initialize a BareMetalServerStatusReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetLifecycleReason': + """Initialize a ClusterNetworkSubnetLifecycleReason object from a json dictionary.""" args = {} if (code := _dict.get('code')) is not None: args['code'] = code else: - raise ValueError('Required property \'code\' not present in BareMetalServerStatusReason JSON') + raise ValueError('Required property \'code\' not present in ClusterNetworkSubnetLifecycleReason JSON') if (message := _dict.get('message')) is not None: args['message'] = message else: - raise ValueError('Required property \'message\' not present in BareMetalServerStatusReason JSON') + raise ValueError('Required property \'message\' not present in ClusterNetworkSubnetLifecycleReason JSON') if (more_info := _dict.get('more_info')) is not None: args['more_info'] = more_info return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerStatusReason object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetLifecycleReason object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -35272,114 +39249,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerStatusReason object.""" + """Return a `str` version of this ClusterNetworkSubnetLifecycleReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerStatusReason') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetLifecycleReason') -> 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: 'BareMetalServerStatusReason') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetLifecycleReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class CodeEnum(str, Enum): """ - The status reason code: - - `cannot_start`: Failed to start due to an internal error - - `cannot_start_capacity`: Insufficient capacity within the selected zone - - `cannot_start_compute`: An error occurred while allocating compute resources - - `cannot_start_ip_address`: An error occurred while allocating an IP address - - `cannot_start_network`: An error occurred while allocating network resources - - `cannot_update_firmware`: An error occurred while updating bare metal server - firmware + A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. """ - CANNOT_REINITIALIZE = 'cannot_reinitialize' - CANNOT_START = 'cannot_start' - CANNOT_START_CAPACITY = 'cannot_start_capacity' - CANNOT_START_COMPUTE = 'cannot_start_compute' - CANNOT_START_IP_ADDRESS = 'cannot_start_ip_address' - CANNOT_START_NETWORK = 'cannot_start_network' - CANNOT_UPDATE_FIRMWARE = 'cannot_update_firmware' + INTERNAL_ERROR = 'internal_error' + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' -class BareMetalServerTrustedPlatformModule: +class ClusterNetworkSubnetPatch: """ - BareMetalServerTrustedPlatformModule. + ClusterNetworkSubnetPatch. - :param bool enabled: Indicates whether the trusted platform module is enabled. - :param str mode: The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `tpm_2`: TPM 2.0 - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param List[str] supported_modes: The supported trusted platform module modes. + :param str name: (optional) The name for this cluster network subnet. The name + must not be used by another cluster network subnet in the cluster network. Names + starting with `ibm-` are reserved for provider-owned resources, and are not + allowed. """ def __init__( self, - enabled: bool, - mode: str, - supported_modes: List[str], + *, + name: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerTrustedPlatformModule object. + Initialize a ClusterNetworkSubnetPatch object. - :param bool enabled: Indicates whether the trusted platform module is - enabled. - :param str mode: The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `tpm_2`: TPM 2.0 - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param List[str] supported_modes: The supported trusted platform module - modes. + :param str name: (optional) The name for this cluster network subnet. The + name must not be used by another cluster network subnet in the cluster + network. Names starting with `ibm-` are reserved for provider-owned + resources, and are not allowed. """ - self.enabled = enabled - self.mode = mode - self.supported_modes = supported_modes + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModule': - """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetPatch': + """Initialize a ClusterNetworkSubnetPatch object from a json dictionary.""" args = {} - if (enabled := _dict.get('enabled')) is not None: - args['enabled'] = enabled - else: - raise ValueError('Required property \'enabled\' not present in BareMetalServerTrustedPlatformModule JSON') - if (mode := _dict.get('mode')) is not None: - args['mode'] = mode - else: - raise ValueError('Required property \'mode\' not present in BareMetalServerTrustedPlatformModule JSON') - if (supported_modes := _dict.get('supported_modes')) is not None: - args['supported_modes'] = supported_modes - else: - raise ValueError('Required property \'supported_modes\' not present in BareMetalServerTrustedPlatformModule JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetPatch 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, 'enabled') and self.enabled is not None: - _dict['enabled'] = self.enabled - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode - if hasattr(self, 'supported_modes') and self.supported_modes is not None: - _dict['supported_modes'] = self.supported_modes + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -35387,92 +39328,72 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerTrustedPlatformModule object.""" + """Return a `str` version of this ClusterNetworkSubnetPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetPatch') -> 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: 'BareMetalServerTrustedPlatformModule') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ModeEnum(str, Enum): - """ - The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `tpm_2`: TPM 2.0 - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ - - DISABLED = 'disabled' - TPM_2 = 'tpm_2' - - - class SupportedModesEnum(str, Enum): - """ - The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `tpm_2`: TPM 2.0 - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ - - DISABLED = 'disabled' - TPM_2 = 'tpm_2' - - -class BareMetalServerTrustedPlatformModulePatch: +class ClusterNetworkSubnetPrefix: """ - BareMetalServerTrustedPlatformModulePatch. + A range of addresses available for subnets for this cluster network. - :param str mode: (optional) The trusted platform module mode to use. The - specified value must be listed in the bare metal server's `supported_modes`. - For the trusted platform module mode to be changed, the bare metal server - `status` must be `stopped`. + :param str allocation_policy: The allocation policy for this subnet prefix: + - `auto`: Subnets created by total count in this cluster network can use this + prefix. + :param str cidr: The CIDR block for this prefix. """ def __init__( self, - *, - mode: Optional[str] = None, + allocation_policy: str, + cidr: str, ) -> None: """ - Initialize a BareMetalServerTrustedPlatformModulePatch object. + Initialize a ClusterNetworkSubnetPrefix object. - :param str mode: (optional) The trusted platform module mode to use. The - specified value must be listed in the bare metal server's - `supported_modes`. - For the trusted platform module mode to be changed, the bare metal server - `status` must be `stopped`. + :param str allocation_policy: The allocation policy for this subnet prefix: + - `auto`: Subnets created by total count in this cluster network can use + this prefix. + :param str cidr: The CIDR block for this prefix. """ - self.mode = mode + self.allocation_policy = allocation_policy + self.cidr = cidr @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePatch': - """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetPrefix': + """Initialize a ClusterNetworkSubnetPrefix object from a json dictionary.""" args = {} - if (mode := _dict.get('mode')) is not None: - args['mode'] = mode + if (allocation_policy := _dict.get('allocation_policy')) is not None: + args['allocation_policy'] = allocation_policy + else: + raise ValueError('Required property \'allocation_policy\' not present in ClusterNetworkSubnetPrefix JSON') + if (cidr := _dict.get('cidr')) is not None: + args['cidr'] = cidr + else: + raise ValueError('Required property \'cidr\' not present in ClusterNetworkSubnetPrefix JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetPrefix 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, 'mode') and self.mode is not None: - _dict['mode'] = self.mode + if hasattr(self, 'allocation_policy') and self.allocation_policy is not None: + _dict['allocation_policy'] = self.allocation_policy + if hasattr(self, 'cidr') and self.cidr is not None: + _dict['cidr'] = self.cidr return _dict def _to_dict(self): @@ -35480,77 +39401,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerTrustedPlatformModulePatch object.""" + """Return a `str` version of this ClusterNetworkSubnetPrefix object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetPrefix') -> 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: 'BareMetalServerTrustedPlatformModulePatch') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetPrefix') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ModeEnum(str, Enum): + class AllocationPolicyEnum(str, Enum): """ - The trusted platform module mode to use. The specified value must be listed in the - bare metal server's `supported_modes`. - For the trusted platform module mode to be changed, the bare metal server `status` - must be `stopped`. + The allocation policy for this subnet prefix: + - `auto`: Subnets created by total count in this cluster network can use this + prefix. """ - DISABLED = 'disabled' - TPM_2 = 'tpm_2' + AUTO = 'auto' -class BareMetalServerTrustedPlatformModulePrototype: +class ClusterNetworkSubnetPrefixPrototype: """ - BareMetalServerTrustedPlatformModulePrototype. + ClusterNetworkSubnetPrefixPrototype. - :param str mode: (optional) The trusted platform module mode to use. The - specified value must be listed in the bare metal server profile's - `supported_trusted_platform_module_modes`. - If unspecified, the default trusted platform module mode from the profile will - be used. + :param str cidr: (optional) The IPv4 range of the cluster network's subnet + prefix, expressed in CIDR format. + The CIDR prefix length must be less than `/29` (at least 8 addresses). + If a range is specified that overlaps with address prefixes in the cluster + network's VPC, the operating systems of any virtual server instances attaching + to this cluster network must be [configured to avoid + conflicts](https://cloud.ibm.com/docs/vpc?topic=vpc-planning-cluster-network#advanced-consideration). """ def __init__( self, *, - mode: Optional[str] = None, + cidr: Optional[str] = None, ) -> None: """ - Initialize a BareMetalServerTrustedPlatformModulePrototype object. + Initialize a ClusterNetworkSubnetPrefixPrototype object. - :param str mode: (optional) The trusted platform module mode to use. The - specified value must be listed in the bare metal server profile's - `supported_trusted_platform_module_modes`. - If unspecified, the default trusted platform module mode from the profile - will be used. + :param str cidr: (optional) The IPv4 range of the cluster network's subnet + prefix, expressed in CIDR format. + The CIDR prefix length must be less than `/29` (at least 8 addresses). + If a range is specified that overlaps with address prefixes in the cluster + network's VPC, the operating systems of any virtual server instances + attaching to this cluster network must be [configured to avoid + conflicts](https://cloud.ibm.com/docs/vpc?topic=vpc-planning-cluster-network#advanced-consideration). """ - self.mode = mode + self.cidr = cidr @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePrototype': - """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetPrefixPrototype': + """Initialize a ClusterNetworkSubnetPrefixPrototype object from a json dictionary.""" args = {} - if (mode := _dict.get('mode')) is not None: - args['mode'] = mode + if (cidr := _dict.get('cidr')) is not None: + args['cidr'] = cidr return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetPrefixPrototype 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, 'mode') and self.mode is not None: - _dict['mode'] = self.mode + if hasattr(self, 'cidr') and self.cidr is not None: + _dict['cidr'] = self.cidr return _dict def _to_dict(self): @@ -35558,151 +39481,150 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerTrustedPlatformModulePrototype object.""" + """Return a `str` version of this ClusterNetworkSubnetPrefixPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetPrefixPrototype') -> 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: 'BareMetalServerTrustedPlatformModulePrototype') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetPrefixPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ModeEnum(str, Enum): - """ - The trusted platform module mode to use. The specified value must be listed in the - bare metal server profile's `supported_trusted_platform_module_modes`. - If unspecified, the default trusted platform module mode from the profile will be - used. - """ - - DISABLED = 'disabled' - TPM_2 = 'tpm_2' - - -class CatalogOfferingIdentity: +class ClusterNetworkSubnetPrototype: """ - Identifies a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - by a unique property. + ClusterNetworkSubnetPrototype. + :param str ip_version: (optional) The IP version(s) to support for this cluster + network subnet. + :param str name: (optional) The name for this cluster network subnet. The name + must not be used by another cluster network subnet in the cluster network. Names + starting with `ibm-` are reserved for provider-owned resources, and are not + allowed. If unspecified, the name will be a hyphenated list of randomly-selected + words. """ def __init__( self, + *, + ip_version: Optional[str] = None, + name: Optional[str] = None, ) -> None: """ - Initialize a CatalogOfferingIdentity object. + Initialize a ClusterNetworkSubnetPrototype object. + :param str ip_version: (optional) The IP version(s) to support for this + cluster network subnet. + :param str name: (optional) The name for this cluster network subnet. The + name must not be used by another cluster network subnet in the cluster + network. Names starting with `ibm-` are reserved for provider-owned + resources, and are not allowed. If unspecified, the name will be a + hyphenated list of randomly-selected words. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CatalogOfferingIdentityCatalogOfferingByCRN']) + ", ".join(['ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype', 'ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype']) ) raise Exception(msg) - -class CatalogOfferingVersionIdentity: - """ - Identifies a version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - by a unique property. - - """ - - def __init__( - self, - ) -> None: + class IpVersionEnum(str, Enum): """ - Initialize a CatalogOfferingVersionIdentity object. - + The IP version(s) to support for this cluster network subnet. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN']) - ) - raise Exception(msg) - - -class CatalogOfferingVersionPlanIdentity: - """ - Identifies a catalog offering version's billing plan by a unique property. - - """ - def __init__( - self, - ) -> None: - """ - Initialize a CatalogOfferingVersionPlanIdentity object. + IPV4 = 'ipv4' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CatalogOfferingVersionPlanIdentityCatalogOfferingVersionPlanByCRN']) - ) - raise Exception(msg) -class CatalogOfferingVersionPlanReference: +class ClusterNetworkSubnetReference: """ - CatalogOfferingVersionPlanReference. + ClusterNetworkSubnetReference. - :param str crn: The CRN for this - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering version's billing plan. :param Deleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + :param str href: The URL for this cluster network subnet. + :param str id: The unique identifier for this cluster network subnet. + :param str name: The name for this cluster network subnet. The name is unique + across all cluster network subnets in the cluster network. + :param str resource_type: The resource type. """ def __init__( self, - crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, deleted: Optional['Deleted'] = None, ) -> None: """ - Initialize a CatalogOfferingVersionPlanReference object. + Initialize a ClusterNetworkSubnetReference object. - :param str crn: The CRN for this - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering version's billing plan. + :param str href: The URL for this cluster network subnet. + :param str id: The unique identifier for this cluster network subnet. + :param str name: The name for this cluster network subnet. The name is + unique across all cluster network subnets in the cluster network. + :param str resource_type: The resource type. :param Deleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ - self.crn = crn self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionPlanReference': - """Initialize a CatalogOfferingVersionPlanReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetReference': + """Initialize a ClusterNetworkSubnetReference object from a json dictionary.""" args = {} - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - else: - raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionPlanReference JSON') if (deleted := _dict.get('deleted')) is not None: args['deleted'] = Deleted.from_dict(deleted) + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkSubnetReference JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkSubnetReference JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ClusterNetworkSubnetReference JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkSubnetReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CatalogOfferingVersionPlanReference object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: if isinstance(self.deleted, dict): _dict['deleted'] = self.deleted else: _dict['deleted'] = self.deleted.to_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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -35710,62 +39632,207 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CatalogOfferingVersionPlanReference object.""" + """Return a `str` version of this ClusterNetworkSubnetReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CatalogOfferingVersionPlanReference') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetReference') -> 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: 'CatalogOfferingVersionPlanReference') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class CatalogOfferingVersionReference: + CLUSTER_NETWORK_SUBNET = 'cluster_network_subnet' + + + +class ClusterNetworkSubnetReservedIP: """ - CatalogOfferingVersionReference. + ClusterNetworkSubnetReservedIP. - :param str crn: The CRN for this version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. + :param str address: The IP address. + If the address is pending allocation, the value will be `0.0.0.0`. + This property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support + IPv6 addresses in the future. + :param bool auto_delete: Indicates whether this cluster network subnet reserved + IP member will be automatically deleted when either `target` is deleted, or the + cluster network subnet reserved IP is unbound. + :param datetime created_at: The date and time that the cluster network subnet + reserved IP was created. + :param str href: The URL for this cluster network subnet reserved IP. + :param str id: The unique identifier for this cluster network subnet reserved + IP. + :param List[ClusterNetworkSubnetReservedIPLifecycleReason] lifecycle_reasons: + The reasons for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the cluster network subnet + reserved IP. + :param str name: The name for this cluster network subnet reserved IP. The name + is unique across all reserved IPs in a cluster network subnet. + :param str owner: The owner of the cluster network subnet reserved IP + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str resource_type: The resource type. + :param ClusterNetworkSubnetReservedIPTarget target: (optional) The target this + cluster network subnet reserved IP is bound to. + If absent, this cluster network subnet reserved IP is provider-owned or unbound. """ def __init__( self, - crn: str, + address: str, + auto_delete: bool, + created_at: datetime, + href: str, + id: str, + lifecycle_reasons: List['ClusterNetworkSubnetReservedIPLifecycleReason'], + lifecycle_state: str, + name: str, + owner: str, + resource_type: str, + *, + target: Optional['ClusterNetworkSubnetReservedIPTarget'] = None, ) -> None: """ - Initialize a CatalogOfferingVersionReference object. + Initialize a ClusterNetworkSubnetReservedIP object. - :param str crn: The CRN for this version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. + :param str address: The IP address. + If the address is pending allocation, the value will be `0.0.0.0`. + This property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to + support IPv6 addresses in the future. + :param bool auto_delete: Indicates whether this cluster network subnet + reserved IP member will be automatically deleted when either `target` is + deleted, or the cluster network subnet reserved IP is unbound. + :param datetime created_at: The date and time that the cluster network + subnet reserved IP was created. + :param str href: The URL for this cluster network subnet reserved IP. + :param str id: The unique identifier for this cluster network subnet + reserved IP. + :param List[ClusterNetworkSubnetReservedIPLifecycleReason] + lifecycle_reasons: The reasons for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the cluster network + subnet reserved IP. + :param str name: The name for this cluster network subnet reserved IP. The + name is unique across all reserved IPs in a cluster network subnet. + :param str owner: The owner of the cluster network subnet reserved IP + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str resource_type: The resource type. + :param ClusterNetworkSubnetReservedIPTarget target: (optional) The target + this cluster network subnet reserved IP is bound to. + If absent, this cluster network subnet reserved IP is provider-owned or + unbound. """ - self.crn = crn + self.address = address + self.auto_delete = auto_delete + self.created_at = created_at + self.href = href + self.id = id + self.lifecycle_reasons = lifecycle_reasons + self.lifecycle_state = lifecycle_state + self.name = name + self.owner = owner + self.resource_type = resource_type + self.target = target @classmethod - def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionReference': - """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetReservedIP': + """Initialize a ClusterNetworkSubnetReservedIP object from a json dictionary.""" args = {} - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn + if (address := _dict.get('address')) is not None: + args['address'] = address else: - raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionReference JSON') + raise ValueError('Required property \'address\' not present in ClusterNetworkSubnetReservedIP JSON') + if (auto_delete := _dict.get('auto_delete')) is not None: + args['auto_delete'] = auto_delete + else: + raise ValueError('Required property \'auto_delete\' not present in ClusterNetworkSubnetReservedIP JSON') + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = string_to_datetime(created_at) + else: + raise ValueError('Required property \'created_at\' not present in ClusterNetworkSubnetReservedIP JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkSubnetReservedIP JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkSubnetReservedIP JSON') + if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None: + args['lifecycle_reasons'] = [ClusterNetworkSubnetReservedIPLifecycleReason.from_dict(v) for v in lifecycle_reasons] + else: + raise ValueError('Required property \'lifecycle_reasons\' not present in ClusterNetworkSubnetReservedIP JSON') + if (lifecycle_state := _dict.get('lifecycle_state')) is not None: + args['lifecycle_state'] = lifecycle_state + else: + raise ValueError('Required property \'lifecycle_state\' not present in ClusterNetworkSubnetReservedIP JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ClusterNetworkSubnetReservedIP JSON') + if (owner := _dict.get('owner')) is not None: + args['owner'] = owner + else: + raise ValueError('Required property \'owner\' not present in ClusterNetworkSubnetReservedIP JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkSubnetReservedIP JSON') + if (target := _dict.get('target')) is not None: + args['target'] = target return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetReservedIP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + 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 + if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: + lifecycle_reasons_list = [] + for v in self.lifecycle_reasons: + if isinstance(v, dict): + lifecycle_reasons_list.append(v) + else: + lifecycle_reasons_list.append(v.to_dict()) + _dict['lifecycle_reasons'] = lifecycle_reasons_list + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'owner') and self.owner is not None: + _dict['owner'] = self.owner + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -35773,77 +39840,151 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CatalogOfferingVersionReference object.""" + """Return a `str` version of this ClusterNetworkSubnetReservedIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CatalogOfferingVersionReference') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetReservedIP') -> 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: 'CatalogOfferingVersionReference') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetReservedIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the cluster network subnet reserved IP. + """ -class CertificateInstanceIdentity: - """ - Identifies a certificate instance by a unique property. + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - """ - def __init__( - self, - ) -> None: + class OwnerEnum(str, Enum): """ - Initialize a CertificateInstanceIdentity object. + The owner of the cluster network subnet reserved IP + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + PROVIDER = 'provider' + USER = 'user' + + class ResourceTypeEnum(str, Enum): + """ + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CertificateInstanceIdentityByCRN']) - ) - raise Exception(msg) + CLUSTER_NETWORK_SUBNET_RESERVED_IP = 'cluster_network_subnet_reserved_ip' -class CertificateInstanceReference: + + +class ClusterNetworkSubnetReservedIPCollection: """ - CertificateInstanceReference. + ClusterNetworkSubnetReservedIPCollection. - :param str crn: The CRN for this certificate instance. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param List[ClusterNetworkSubnetReservedIP] reserved_ips: A page of reserved IPs + for the cluster network subnet. + :param int total_count: The total number of resources across all pages. """ def __init__( self, - crn: str, + first: 'PageLink', + limit: int, + reserved_ips: List['ClusterNetworkSubnetReservedIP'], + total_count: int, + *, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a CertificateInstanceReference object. + Initialize a ClusterNetworkSubnetReservedIPCollection object. - :param str crn: The CRN for this certificate instance. + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[ClusterNetworkSubnetReservedIP] reserved_ips: A page of + reserved IPs for the cluster network subnet. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ - self.crn = crn + self.first = first + self.limit = limit + self.next = next + self.reserved_ips = reserved_ips + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'CertificateInstanceReference': - """Initialize a CertificateInstanceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetReservedIPCollection': + """Initialize a ClusterNetworkSubnetReservedIPCollection object from a json dictionary.""" args = {} - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'crn\' not present in CertificateInstanceReference JSON') + raise ValueError('Required property \'first\' not present in ClusterNetworkSubnetReservedIPCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in ClusterNetworkSubnetReservedIPCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (reserved_ips := _dict.get('reserved_ips')) is not None: + args['reserved_ips'] = [ClusterNetworkSubnetReservedIP.from_dict(v) for v in reserved_ips] + else: + raise ValueError('Required property \'reserved_ips\' not present in ClusterNetworkSubnetReservedIPCollection JSON') + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in ClusterNetworkSubnetReservedIPCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CertificateInstanceReference object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetReservedIPCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'reserved_ips') and self.reserved_ips is not None: + reserved_ips_list = [] + for v in self.reserved_ips: + if isinstance(v, dict): + reserved_ips_list.append(v) + else: + reserved_ips_list.append(v.to_dict()) + _dict['reserved_ips'] = reserved_ips_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -35851,86 +39992,183 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CertificateInstanceReference object.""" + """Return a `str` version of this ClusterNetworkSubnetReservedIPCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CertificateInstanceReference') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetReservedIPCollection') -> 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: 'CertificateInstanceReference') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetReservedIPCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CloudObjectStorageBucketIdentity: +class ClusterNetworkSubnetReservedIPLifecycleReason: """ - Identifies a Cloud Object Storage bucket by a unique property. + ClusterNetworkSubnetReservedIPLifecycleReason. + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for this + lifecycle state. """ def __init__( self, + code: str, + message: str, + *, + more_info: Optional[str] = None, ) -> None: """ - Initialize a CloudObjectStorageBucketIdentity object. + Initialize a ClusterNetworkSubnetReservedIPLifecycleReason object. + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended + (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName', 'CloudObjectStorageBucketIdentityByCRN']) - ) - raise Exception(msg) + self.code = code + self.message = message + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetReservedIPLifecycleReason': + """Initialize a ClusterNetworkSubnetReservedIPLifecycleReason object from a json dictionary.""" + args = {} + if (code := _dict.get('code')) is not None: + args['code'] = code + else: + raise ValueError('Required property \'code\' not present in ClusterNetworkSubnetReservedIPLifecycleReason JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message + else: + raise ValueError('Required property \'message\' not present in ClusterNetworkSubnetReservedIPLifecycleReason JSON') + if (more_info := _dict.get('more_info')) is not None: + args['more_info'] = more_info + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkSubnetReservedIPLifecycleReason object from a json dictionary.""" + return cls.from_dict(_dict) -class CloudObjectStorageBucketReference: + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + 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 ClusterNetworkSubnetReservedIPLifecycleReason object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkSubnetReservedIPLifecycleReason') -> 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: 'ClusterNetworkSubnetReservedIPLifecycleReason') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class CodeEnum(str, Enum): + """ + A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + INTERNAL_ERROR = 'internal_error' + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' + + + +class ClusterNetworkSubnetReservedIPPatch: """ - CloudObjectStorageBucketReference. + ClusterNetworkSubnetReservedIPPatch. - :param str crn: The CRN of this Cloud Object Storage bucket. - :param str name: The globally unique name of this Cloud Object Storage bucket. + :param bool auto_delete: (optional) Indicates whether this cluster network + subnet reserved IP member will be automatically deleted when either `target` is + deleted, or the cluster network subnet reserved IP is unbound. Must be `false` + if the cluster network subnet reserved IP is unbound. + :param str name: (optional) The name for this cluster network subnet reserved + IP. The name must not be used by another reserved IP in the cluster network + subnet. Names starting with `ibm-` are reserved for provider-owned resources, + and are not allowed. """ def __init__( self, - crn: str, - name: str, + *, + auto_delete: Optional[bool] = None, + name: Optional[str] = None, ) -> None: """ - Initialize a CloudObjectStorageBucketReference object. + Initialize a ClusterNetworkSubnetReservedIPPatch object. - :param str crn: The CRN of this Cloud Object Storage bucket. - :param str name: The globally unique name of this Cloud Object Storage - bucket. + :param bool auto_delete: (optional) Indicates whether this cluster network + subnet reserved IP member will be automatically deleted when either + `target` is deleted, or the cluster network subnet reserved IP is unbound. + Must be `false` if the cluster network subnet reserved IP is unbound. + :param str name: (optional) The name for this cluster network subnet + reserved IP. The name must not be used by another reserved IP in the + cluster network subnet. Names starting with `ibm-` are reserved for + provider-owned resources, and are not allowed. """ - self.crn = crn + self.auto_delete = auto_delete self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketReference': - """Initialize a CloudObjectStorageBucketReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetReservedIPPatch': + """Initialize a ClusterNetworkSubnetReservedIPPatch object from a json dictionary.""" args = {} - if (crn := _dict.get('crn')) is not None: - args['crn'] = crn - else: - raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketReference JSON') + if (auto_delete := _dict.get('auto_delete')) is not None: + args['auto_delete'] = auto_delete if (name := _dict.get('name')) is not None: args['name'] = name - else: - raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CloudObjectStorageBucketReference object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetReservedIPPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name return _dict @@ -35940,60 +40178,126 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CloudObjectStorageBucketReference object.""" + """Return a `str` version of this ClusterNetworkSubnetReservedIPPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CloudObjectStorageBucketReference') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetReservedIPPatch') -> 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: 'CloudObjectStorageBucketReference') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetReservedIPPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CloudObjectStorageObjectReference: +class ClusterNetworkSubnetReservedIPReference: """ - CloudObjectStorageObjectReference. + ClusterNetworkSubnetReservedIPReference. - :param str name: The name of this Cloud Object Storage object. Names are unique - within a Cloud Object Storage bucket. + :param str address: The IP address. + If the address is pending allocation, the value will be `0.0.0.0`. + This property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support + IPv6 addresses in the future. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. + :param str href: The URL for this cluster network subnet reserved IP. + :param str id: The unique identifier for this cluster network subnet reserved + IP. + :param str name: The name for this cluster network subnet reserved IP. The name + is unique across all reserved IPs in a cluster network subnet. + :param str resource_type: The resource type. """ def __init__( self, + address: str, + href: str, + id: str, name: str, + resource_type: str, + *, + deleted: Optional['Deleted'] = None, ) -> None: """ - Initialize a CloudObjectStorageObjectReference object. + Initialize a ClusterNetworkSubnetReservedIPReference object. - :param str name: The name of this Cloud Object Storage object. Names are - unique within a Cloud Object Storage bucket. + :param str address: The IP address. + If the address is pending allocation, the value will be `0.0.0.0`. + This property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to + support IPv6 addresses in the future. + :param str href: The URL for this cluster network subnet reserved IP. + :param str id: The unique identifier for this cluster network subnet + reserved IP. + :param str name: The name for this cluster network subnet reserved IP. The + name is unique across all reserved IPs in a cluster network subnet. + :param str resource_type: The resource type. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. """ + self.address = address + self.deleted = deleted + self.href = href + self.id = id self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageObjectReference': - """Initialize a CloudObjectStorageObjectReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetReservedIPReference': + """Initialize a ClusterNetworkSubnetReservedIPReference object from a json dictionary.""" args = {} + if (address := _dict.get('address')) is not None: + args['address'] = address + else: + raise ValueError('Required property \'address\' not present in ClusterNetworkSubnetReservedIPReference JSON') + if (deleted := _dict.get('deleted')) is not None: + args['deleted'] = Deleted.from_dict(deleted) + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkSubnetReservedIPReference JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkSubnetReservedIPReference JSON') if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in CloudObjectStorageObjectReference JSON') + raise ValueError('Required property \'name\' not present in ClusterNetworkSubnetReservedIPReference JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkSubnetReservedIPReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CloudObjectStorageObjectReference object from a json dictionary.""" + """Initialize a ClusterNetworkSubnetReservedIPReference 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, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_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 if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -36001,19 +40305,47 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CloudObjectStorageObjectReference object.""" + """Return a `str` version of this ClusterNetworkSubnetReservedIPReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CloudObjectStorageObjectReference') -> bool: + def __eq__(self, other: 'ClusterNetworkSubnetReservedIPReference') -> 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: 'CloudObjectStorageObjectReference') -> bool: + def __ne__(self, other: 'ClusterNetworkSubnetReservedIPReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + CLUSTER_NETWORK_SUBNET_RESERVED_IP = 'cluster_network_subnet_reserved_ip' + + + +class ClusterNetworkSubnetReservedIPTarget: + """ + The target this cluster network subnet reserved IP is bound to. + If absent, this cluster network subnet reserved IP is provider-owned or unbound. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a ClusterNetworkSubnetReservedIPTarget object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext']) + ) + raise Exception(msg) + class DNSInstanceIdentity: """ @@ -36708,12 +41040,11 @@ class DedicatedHostCollection: DedicatedHostCollection. :param List[DedicatedHost] dedicated_hosts: A page of dedicated hosts. - :param DedicatedHostCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param DedicatedHostCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -36721,23 +41052,22 @@ class DedicatedHostCollection: def __init__( self, dedicated_hosts: List['DedicatedHost'], - first: 'DedicatedHostCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['DedicatedHostCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a DedicatedHostCollection object. :param List[DedicatedHost] dedicated_hosts: A page of dedicated hosts. - :param DedicatedHostCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param DedicatedHostCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.dedicated_hosts = dedicated_hosts @@ -36755,7 +41085,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollection': else: raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = DedicatedHostCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in DedicatedHostCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -36763,7 +41093,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollection': else: raise ValueError('Required property \'limit\' not present in DedicatedHostCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = DedicatedHostCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -36821,125 +41151,6 @@ def __ne__(self, other: 'DedicatedHostCollection') -> bool: return not self == other -class DedicatedHostCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a DedicatedHostCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionFirst': - """Initialize a DedicatedHostCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in DedicatedHostCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostCollectionFirst 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 DedicatedHostCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DedicatedHostCollectionFirst') -> 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: 'DedicatedHostCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class DedicatedHostCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a DedicatedHostCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionNext': - """Initialize a DedicatedHostCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in DedicatedHostCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostCollectionNext 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 DedicatedHostCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DedicatedHostCollectionNext') -> 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: 'DedicatedHostCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class DedicatedHostDisk: """ DedicatedHostDisk. @@ -37520,37 +41731,35 @@ class DedicatedHostGroupCollection: """ DedicatedHostGroupCollection. - :param DedicatedHostGroupCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[DedicatedHostGroup] groups: A page of dedicated host groups. :param int limit: The maximum number of resources that can be returned by the request. - :param DedicatedHostGroupCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'DedicatedHostGroupCollectionFirst', + first: 'PageLink', groups: List['DedicatedHostGroup'], limit: int, total_count: int, *, - next: Optional['DedicatedHostGroupCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a DedicatedHostGroupCollection object. - :param DedicatedHostGroupCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[DedicatedHostGroup] groups: A page of dedicated host groups. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param DedicatedHostGroupCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -37564,7 +41773,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollection': """Initialize a DedicatedHostGroupCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = DedicatedHostGroupCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in DedicatedHostGroupCollection JSON') if (groups := _dict.get('groups')) is not None: @@ -37576,7 +41785,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollection': else: raise ValueError('Required property \'limit\' not present in DedicatedHostGroupCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = DedicatedHostGroupCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -37634,125 +41843,6 @@ def __ne__(self, other: 'DedicatedHostGroupCollection') -> bool: return not self == other -class DedicatedHostGroupCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a DedicatedHostGroupCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionFirst': - """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupCollectionFirst 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 DedicatedHostGroupCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DedicatedHostGroupCollectionFirst') -> 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: 'DedicatedHostGroupCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class DedicatedHostGroupCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a DedicatedHostGroupCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionNext': - """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupCollectionNext 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 DedicatedHostGroupCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DedicatedHostGroupCollectionNext') -> 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: 'DedicatedHostGroupCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class DedicatedHostGroupIdentity: """ Identifies a dedicated host group by a unique property. @@ -38517,12 +42607,11 @@ class DedicatedHostProfileCollection: """ DedicatedHostProfileCollection. - :param DedicatedHostProfileCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param DedicatedHostProfileCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[DedicatedHostProfile] profiles: A page of dedicated host profiles. :param int total_count: The total number of resources across all pages. @@ -38530,25 +42619,24 @@ class DedicatedHostProfileCollection: def __init__( self, - first: 'DedicatedHostProfileCollectionFirst', + first: 'PageLink', limit: int, profiles: List['DedicatedHostProfile'], total_count: int, *, - next: Optional['DedicatedHostProfileCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a DedicatedHostProfileCollection object. - :param DedicatedHostProfileCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[DedicatedHostProfile] profiles: A page of dedicated host profiles. :param int total_count: The total number of resources across all pages. - :param DedicatedHostProfileCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -38562,7 +42650,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollection': """Initialize a DedicatedHostProfileCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = DedicatedHostProfileCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in DedicatedHostProfileCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -38570,7 +42658,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollection': else: raise ValueError('Required property \'limit\' not present in DedicatedHostProfileCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = DedicatedHostProfileCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (profiles := _dict.get('profiles')) is not None: args['profiles'] = [DedicatedHostProfile.from_dict(v) for v in profiles] else: @@ -38632,125 +42720,6 @@ def __ne__(self, other: 'DedicatedHostProfileCollection') -> bool: return not self == other -class DedicatedHostProfileCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a DedicatedHostProfileCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionFirst': - """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileCollectionFirst 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 DedicatedHostProfileCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DedicatedHostProfileCollectionFirst') -> 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: 'DedicatedHostProfileCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class DedicatedHostProfileCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a DedicatedHostProfileCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionNext': - """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileCollectionNext 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 DedicatedHostProfileCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DedicatedHostProfileCollectionNext') -> 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: 'DedicatedHostProfileCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class DedicatedHostProfileDisk: """ Disks provided by this profile. @@ -39854,9 +43823,9 @@ class DefaultRoutingTable: :param List[ResourceFilter] accept_routes_from: The filters specifying the resources that may create routes in this routing table. - At present, only the `resource_type` filter is permitted, and only the values - `vpn_gateway` and `vpn_server` are supported, but filter support is expected to - expand in the future. + The resources and types of filters supported by this property is expected to + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. :param List[str] advertise_routes_to: The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these sources. @@ -39945,10 +43914,10 @@ def __init__( :param List[ResourceFilter] accept_routes_from: The filters specifying the resources that may create routes in this routing table. - At present, only the `resource_type` filter is permitted, and only the - values - `vpn_gateway` and `vpn_server` are supported, but filter support is - expected to expand in the future. + The resources and types of filters supported by this property is expected + to + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. :param List[str] advertise_routes_to: The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these sources. @@ -40877,12 +44846,11 @@ class EndpointGatewayCollection: EndpointGatewayCollection. :param List[EndpointGateway] endpoint_gateways: A page of endpoint gateways. - :param EndpointGatewayCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param EndpointGatewayCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -40890,24 +44858,23 @@ class EndpointGatewayCollection: def __init__( self, endpoint_gateways: List['EndpointGateway'], - first: 'EndpointGatewayCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['EndpointGatewayCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a EndpointGatewayCollection object. :param List[EndpointGateway] endpoint_gateways: A page of endpoint gateways. - :param EndpointGatewayCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param EndpointGatewayCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.endpoint_gateways = endpoint_gateways @@ -40925,7 +44892,7 @@ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollection': else: raise ValueError('Required property \'endpoint_gateways\' not present in EndpointGatewayCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = EndpointGatewayCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in EndpointGatewayCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -40933,7 +44900,7 @@ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollection': else: raise ValueError('Required property \'limit\' not present in EndpointGatewayCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = EndpointGatewayCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -40991,125 +44958,6 @@ def __ne__(self, other: 'EndpointGatewayCollection') -> bool: return not self == other -class EndpointGatewayCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a EndpointGatewayCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionFirst': - """Initialize a EndpointGatewayCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a EndpointGatewayCollectionFirst 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 EndpointGatewayCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'EndpointGatewayCollectionFirst') -> 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: 'EndpointGatewayCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class EndpointGatewayCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a EndpointGatewayCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionNext': - """Initialize a EndpointGatewayCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a EndpointGatewayCollectionNext 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 EndpointGatewayCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'EndpointGatewayCollectionNext') -> 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: 'EndpointGatewayCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class EndpointGatewayLifecycleReason: """ EndpointGatewayLifecycleReason. @@ -41547,20 +45395,34 @@ class EndpointGatewayTarget: """ The target for this endpoint gateway. + :param str resource_type: The target resource type for this endpoint gateway. """ def __init__( self, + resource_type: str, ) -> None: """ Initialize a EndpointGatewayTarget object. + :param str resource_type: The target resource type for this endpoint + gateway. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join(['EndpointGatewayTargetPrivatePathServiceGatewayReference', 'EndpointGatewayTargetProviderCloudServiceReference', 'EndpointGatewayTargetProviderInfrastructureServiceReference']) ) raise Exception(msg) + class ResourceTypeEnum(str, Enum): + """ + The target resource type for this endpoint gateway. + """ + + PRIVATE_PATH_SERVICE_GATEWAY = 'private_path_service_gateway' + PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' + PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' + + class EndpointGatewayTargetPrototype: """ @@ -41570,26 +45432,29 @@ class EndpointGatewayTargetPrototype: `service_endpoints` of another endpoint gateway in the VPC. - :param str resource_type: The type of target for this endpoint gateway. + :param str resource_type: (optional) The target resource type for this endpoint + gateway. """ def __init__( self, - resource_type: str, + *, + resource_type: Optional[str] = None, ) -> None: """ Initialize a EndpointGatewayTargetPrototype object. - :param str resource_type: The type of target for this endpoint gateway. + :param str resource_type: (optional) The target resource type for this + endpoint gateway. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype', 'EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderCloudServicePrototype', 'EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype']) + ", ".join(['EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype', 'EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype', 'EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderCloudServicePrototype']) ) raise Exception(msg) class ResourceTypeEnum(str, Enum): """ - The type of target for this endpoint gateway. + The target resource type for this endpoint gateway. """ PRIVATE_PATH_SERVICE_GATEWAY = 'private_path_service_gateway' @@ -41784,36 +45649,35 @@ class FloatingIPCollection: """ FloatingIPCollection. - :param FloatingIPCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[FloatingIP] floating_ips: A page of floating IPs. :param int limit: The maximum number of resources that can be returned by the request. - :param FloatingIPCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'FloatingIPCollectionFirst', + first: 'PageLink', floating_ips: List['FloatingIP'], limit: int, total_count: int, *, - next: Optional['FloatingIPCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a FloatingIPCollection object. - :param FloatingIPCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[FloatingIP] floating_ips: A page of floating IPs. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param FloatingIPCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -41827,7 +45691,7 @@ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollection': """Initialize a FloatingIPCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = FloatingIPCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in FloatingIPCollection JSON') if (floating_ips := _dict.get('floating_ips')) is not None: @@ -41839,7 +45703,7 @@ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollection': else: raise ValueError('Required property \'limit\' not present in FloatingIPCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = FloatingIPCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -41897,163 +45761,41 @@ def __ne__(self, other: 'FloatingIPCollection') -> bool: return not self == other -class FloatingIPCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a FloatingIPCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionFirst': - """Initialize a FloatingIPCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in FloatingIPCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a FloatingIPCollectionFirst 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 FloatingIPCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'FloatingIPCollectionFirst') -> 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: 'FloatingIPCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class FloatingIPCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a FloatingIPCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionNext': - """Initialize a FloatingIPCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in FloatingIPCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a FloatingIPCollectionNext 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 FloatingIPCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'FloatingIPCollectionNext') -> 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: 'FloatingIPCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class FloatingIPCollectionVirtualNetworkInterfaceContext: """ FloatingIPCollectionVirtualNetworkInterfaceContext. - :param FloatingIPCollectionVirtualNetworkInterfaceContextFirst first: A link to - the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[FloatingIPReference] floating_ips: A page of floating IPs bound to the virtual network interface specified by the identifier in the URL. :param int limit: The maximum number of resources that can be returned by the request. - :param FloatingIPCollectionVirtualNetworkInterfaceContextNext next: (optional) A - link to the next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'FloatingIPCollectionVirtualNetworkInterfaceContextFirst', + first: 'PageLink', floating_ips: List['FloatingIPReference'], limit: int, total_count: int, *, - next: Optional['FloatingIPCollectionVirtualNetworkInterfaceContextNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a FloatingIPCollectionVirtualNetworkInterfaceContext object. - :param FloatingIPCollectionVirtualNetworkInterfaceContextFirst first: A - link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[FloatingIPReference] floating_ips: A page of floating IPs bound to the virtual network interface specified by the identifier in the URL. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param FloatingIPCollectionVirtualNetworkInterfaceContextNext next: - (optional) A link to the next page of resources. This property is present - for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -42067,7 +45809,7 @@ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionVirtualNetworkInterfaceC """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContext object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = FloatingIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in FloatingIPCollectionVirtualNetworkInterfaceContext JSON') if (floating_ips := _dict.get('floating_ips')) is not None: @@ -42079,7 +45821,7 @@ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionVirtualNetworkInterfaceC else: raise ValueError('Required property \'limit\' not present in FloatingIPCollectionVirtualNetworkInterfaceContext JSON') if (next := _dict.get('next')) is not None: - args['next'] = FloatingIPCollectionVirtualNetworkInterfaceContextNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -42137,125 +45879,6 @@ def __ne__(self, other: 'FloatingIPCollectionVirtualNetworkInterfaceContext') -> return not self == other -class FloatingIPCollectionVirtualNetworkInterfaceContextFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionVirtualNetworkInterfaceContextFirst': - """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in FloatingIPCollectionVirtualNetworkInterfaceContextFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextFirst 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 FloatingIPCollectionVirtualNetworkInterfaceContextFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'FloatingIPCollectionVirtualNetworkInterfaceContextFirst') -> 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: 'FloatingIPCollectionVirtualNetworkInterfaceContextFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class FloatingIPCollectionVirtualNetworkInterfaceContextNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionVirtualNetworkInterfaceContextNext': - """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in FloatingIPCollectionVirtualNetworkInterfaceContextNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextNext 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 FloatingIPCollectionVirtualNetworkInterfaceContextNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'FloatingIPCollectionVirtualNetworkInterfaceContextNext') -> 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: 'FloatingIPCollectionVirtualNetworkInterfaceContextNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class FloatingIPPatch: """ FloatingIPPatch. @@ -42902,39 +46525,37 @@ class FlowLogCollectorCollection: """ FlowLogCollectorCollection. - :param FlowLogCollectorCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[FlowLogCollector] flow_log_collectors: A page of flow log collectors. :param int limit: The maximum number of resources that can be returned by the request. - :param FlowLogCollectorCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'FlowLogCollectorCollectionFirst', + first: 'PageLink', flow_log_collectors: List['FlowLogCollector'], limit: int, total_count: int, *, - next: Optional['FlowLogCollectorCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a FlowLogCollectorCollection object. - :param FlowLogCollectorCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[FlowLogCollector] flow_log_collectors: A page of flow log collectors. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param FlowLogCollectorCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -42948,7 +46569,7 @@ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollection': """Initialize a FlowLogCollectorCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = FlowLogCollectorCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in FlowLogCollectorCollection JSON') if (flow_log_collectors := _dict.get('flow_log_collectors')) is not None: @@ -42960,7 +46581,7 @@ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollection': else: raise ValueError('Required property \'limit\' not present in FlowLogCollectorCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = FlowLogCollectorCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -43018,125 +46639,6 @@ def __ne__(self, other: 'FlowLogCollectorCollection') -> bool: return not self == other -class FlowLogCollectorCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a FlowLogCollectorCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionFirst': - """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorCollectionFirst 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 FlowLogCollectorCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'FlowLogCollectorCollectionFirst') -> 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: 'FlowLogCollectorCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class FlowLogCollectorCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a FlowLogCollectorCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionNext': - """Initialize a FlowLogCollectorCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorCollectionNext 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 FlowLogCollectorCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'FlowLogCollectorCollectionNext') -> 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: 'FlowLogCollectorCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class FlowLogCollectorPatch: """ FlowLogCollectorPatch. @@ -43543,36 +47045,35 @@ class IKEPolicyCollection: """ IKEPolicyCollection. - :param IKEPolicyCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[IKEPolicy] ike_policies: A page of IKE policies. :param int limit: The maximum number of resources that can be returned by the request. - :param IKEPolicyCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'IKEPolicyCollectionFirst', + first: 'PageLink', ike_policies: List['IKEPolicy'], limit: int, total_count: int, *, - next: Optional['IKEPolicyCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a IKEPolicyCollection object. - :param IKEPolicyCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[IKEPolicy] ike_policies: A page of IKE policies. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param IKEPolicyCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -43586,7 +47087,7 @@ def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollection': """Initialize a IKEPolicyCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = IKEPolicyCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in IKEPolicyCollection JSON') if (ike_policies := _dict.get('ike_policies')) is not None: @@ -43598,7 +47099,7 @@ def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollection': else: raise ValueError('Required property \'limit\' not present in IKEPolicyCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = IKEPolicyCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -43656,137 +47157,17 @@ def __ne__(self, other: 'IKEPolicyCollection') -> bool: return not self == other -class IKEPolicyCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a IKEPolicyCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionFirst': - """Initialize a IKEPolicyCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in IKEPolicyCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IKEPolicyCollectionFirst 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 IKEPolicyCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IKEPolicyCollectionFirst') -> 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: 'IKEPolicyCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class IKEPolicyCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a IKEPolicyCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionNext': - """Initialize a IKEPolicyCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in IKEPolicyCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IKEPolicyCollectionNext 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 IKEPolicyCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IKEPolicyCollectionNext') -> 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: 'IKEPolicyCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class IKEPolicyConnectionCollection: """ IKEPolicyConnectionCollection. :param List[VPNGatewayConnection] connections: A page of VPN gateway connections that use the IKE policy specified by the identifier in the URL. - :param IKEPolicyConnectionCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param IKEPolicyConnectionCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -43794,24 +47175,23 @@ class IKEPolicyConnectionCollection: def __init__( self, connections: List['VPNGatewayConnection'], - first: 'IKEPolicyConnectionCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['IKEPolicyConnectionCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a IKEPolicyConnectionCollection object. :param List[VPNGatewayConnection] connections: A page of VPN gateway connections that use the IKE policy specified by the identifier in the URL. - :param IKEPolicyConnectionCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param IKEPolicyConnectionCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.connections = connections @@ -43829,7 +47209,7 @@ def from_dict(cls, _dict: Dict) -> 'IKEPolicyConnectionCollection': else: raise ValueError('Required property \'connections\' not present in IKEPolicyConnectionCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = IKEPolicyConnectionCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in IKEPolicyConnectionCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -43837,7 +47217,7 @@ def from_dict(cls, _dict: Dict) -> 'IKEPolicyConnectionCollection': else: raise ValueError('Required property \'limit\' not present in IKEPolicyConnectionCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = IKEPolicyConnectionCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -43895,125 +47275,6 @@ def __ne__(self, other: 'IKEPolicyConnectionCollection') -> bool: return not self == other -class IKEPolicyConnectionCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a IKEPolicyConnectionCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyConnectionCollectionFirst': - """Initialize a IKEPolicyConnectionCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in IKEPolicyConnectionCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IKEPolicyConnectionCollectionFirst 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 IKEPolicyConnectionCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IKEPolicyConnectionCollectionFirst') -> 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: 'IKEPolicyConnectionCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class IKEPolicyConnectionCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a IKEPolicyConnectionCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyConnectionCollectionNext': - """Initialize a IKEPolicyConnectionCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in IKEPolicyConnectionCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IKEPolicyConnectionCollectionNext 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 IKEPolicyConnectionCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IKEPolicyConnectionCollectionNext') -> 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: 'IKEPolicyConnectionCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class IKEPolicyPatch: """ IKEPolicyPatch. @@ -44642,36 +47903,35 @@ class IPsecPolicyCollection: """ IPsecPolicyCollection. - :param IPsecPolicyCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[IPsecPolicy] ipsec_policies: A page of IPsec policies. :param int limit: The maximum number of resources that can be returned by the request. - :param IPsecPolicyCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'IPsecPolicyCollectionFirst', + first: 'PageLink', ipsec_policies: List['IPsecPolicy'], limit: int, total_count: int, *, - next: Optional['IPsecPolicyCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a IPsecPolicyCollection object. - :param IPsecPolicyCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[IPsecPolicy] ipsec_policies: A page of IPsec policies. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param IPsecPolicyCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -44685,7 +47945,7 @@ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollection': """Initialize a IPsecPolicyCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = IPsecPolicyCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in IPsecPolicyCollection JSON') if (ipsec_policies := _dict.get('ipsec_policies')) is not None: @@ -44697,7 +47957,7 @@ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollection': else: raise ValueError('Required property \'limit\' not present in IPsecPolicyCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = IPsecPolicyCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -44755,137 +48015,17 @@ def __ne__(self, other: 'IPsecPolicyCollection') -> bool: return not self == other -class IPsecPolicyCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a IPsecPolicyCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionFirst': - """Initialize a IPsecPolicyCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IPsecPolicyCollectionFirst 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 IPsecPolicyCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IPsecPolicyCollectionFirst') -> 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: 'IPsecPolicyCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class IPsecPolicyCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a IPsecPolicyCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionNext': - """Initialize a IPsecPolicyCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IPsecPolicyCollectionNext 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 IPsecPolicyCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IPsecPolicyCollectionNext') -> 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: 'IPsecPolicyCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class IPsecPolicyConnectionCollection: """ IPsecPolicyConnectionCollection. :param List[VPNGatewayConnection] connections: A page of VPN gateway connections that use the IPsec policy specified by the identifier in the URL. - :param IPsecPolicyConnectionCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param IPsecPolicyConnectionCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -44893,11 +48033,11 @@ class IPsecPolicyConnectionCollection: def __init__( self, connections: List['VPNGatewayConnection'], - first: 'IPsecPolicyConnectionCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['IPsecPolicyConnectionCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a IPsecPolicyConnectionCollection object. @@ -44905,13 +48045,12 @@ def __init__( :param List[VPNGatewayConnection] connections: A page of VPN gateway connections that use the IPsec policy specified by the identifier in the URL. - :param IPsecPolicyConnectionCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param IPsecPolicyConnectionCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.connections = connections @@ -44929,7 +48068,7 @@ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyConnectionCollection': else: raise ValueError('Required property \'connections\' not present in IPsecPolicyConnectionCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = IPsecPolicyConnectionCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in IPsecPolicyConnectionCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -44937,7 +48076,7 @@ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyConnectionCollection': else: raise ValueError('Required property \'limit\' not present in IPsecPolicyConnectionCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = IPsecPolicyConnectionCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -44995,125 +48134,6 @@ def __ne__(self, other: 'IPsecPolicyConnectionCollection') -> bool: return not self == other -class IPsecPolicyConnectionCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a IPsecPolicyConnectionCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyConnectionCollectionFirst': - """Initialize a IPsecPolicyConnectionCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in IPsecPolicyConnectionCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IPsecPolicyConnectionCollectionFirst 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 IPsecPolicyConnectionCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IPsecPolicyConnectionCollectionFirst') -> 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: 'IPsecPolicyConnectionCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class IPsecPolicyConnectionCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a IPsecPolicyConnectionCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyConnectionCollectionNext': - """Initialize a IPsecPolicyConnectionCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in IPsecPolicyConnectionCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IPsecPolicyConnectionCollectionNext 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 IPsecPolicyConnectionCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IPsecPolicyConnectionCollectionNext') -> 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: 'IPsecPolicyConnectionCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class IPsecPolicyPatch: """ IPsecPolicyPatch. @@ -45890,35 +48910,35 @@ class ImageCollection: """ ImageCollection. - :param ImageCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[Image] images: A page of images. :param int limit: The maximum number of resources that can be returned by the request. - :param ImageCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'ImageCollectionFirst', + first: 'PageLink', images: List['Image'], limit: int, total_count: int, *, - next: Optional['ImageCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a ImageCollection object. - :param ImageCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[Image] images: A page of images. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param ImageCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -45932,7 +48952,7 @@ def from_dict(cls, _dict: Dict) -> 'ImageCollection': """Initialize a ImageCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = ImageCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in ImageCollection JSON') if (images := _dict.get('images')) is not None: @@ -45944,7 +48964,7 @@ def from_dict(cls, _dict: Dict) -> 'ImageCollection': else: raise ValueError('Required property \'limit\' not present in ImageCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = ImageCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -46002,125 +49022,6 @@ def __ne__(self, other: 'ImageCollection') -> bool: return not self == other -class ImageCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ImageCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageCollectionFirst': - """Initialize a ImageCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ImageCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ImageCollectionFirst 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 ImageCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ImageCollectionFirst') -> 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: 'ImageCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ImageCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ImageCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageCollectionNext': - """Initialize a ImageCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ImageCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ImageCollectionNext 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 ImageCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ImageCollectionNext') -> 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: 'ImageCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ImageExportJob: """ ImageExportJob. @@ -47471,6 +50372,13 @@ class Instance: :param InstanceCatalogOffering catalog_offering: (optional) If present, this virtual server instance was provisioned from a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). + :param ClusterNetworkReference cluster_network: (optional) If present, the + cluster network that this virtual server instance resides in. + :param List[InstanceClusterNetworkAttachmentReference] + cluster_network_attachments: The cluster network attachments for this virtual + server instance. + The cluster network attachments are ordered for consistent instance + configuration. :param str confidential_compute_mode: The confidential compute mode for this virtual server instance. :param datetime created_at: The date and time that the virtual server instance @@ -47572,6 +50480,7 @@ def __init__( availability_policy: 'InstanceAvailabilityPolicy', bandwidth: int, boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext', + cluster_network_attachments: List['InstanceClusterNetworkAttachmentReference'], confidential_compute_mode: str, created_at: datetime, crn: str, @@ -47604,6 +50513,7 @@ def __init__( zone: 'ZoneReference', *, catalog_offering: Optional['InstanceCatalogOffering'] = None, + cluster_network: Optional['ClusterNetworkReference'] = None, dedicated_host: Optional['DedicatedHostReference'] = None, gpu: Optional['InstanceGPU'] = None, image: Optional['ImageReference'] = None, @@ -47622,6 +50532,11 @@ def __init__( storage volumes of the virtual server instance. :param VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot volume attachment. + :param List[InstanceClusterNetworkAttachmentReference] + cluster_network_attachments: The cluster network attachments for this + virtual server instance. + The cluster network attachments are ordered for consistent instance + configuration. :param str confidential_compute_mode: The confidential compute mode for this virtual server instance. :param datetime created_at: The date and time that the virtual server @@ -47711,6 +50626,8 @@ def __init__( :param InstanceCatalogOffering catalog_offering: (optional) If present, this virtual server instance was provisioned from a [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). + :param ClusterNetworkReference cluster_network: (optional) If present, the + cluster network that this virtual server instance resides in. :param DedicatedHostReference dedicated_host: (optional) If present, the dedicated host this virtual server instance has been placed on. :param InstanceGPU gpu: (optional) The virtual server instance GPU @@ -47732,6 +50649,8 @@ def __init__( self.bandwidth = bandwidth self.boot_volume_attachment = boot_volume_attachment self.catalog_offering = catalog_offering + self.cluster_network = cluster_network + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.created_at = created_at self.crn = crn @@ -47788,6 +50707,12 @@ def from_dict(cls, _dict: Dict) -> 'Instance': raise ValueError('Required property \'boot_volume_attachment\' not present in Instance JSON') if (catalog_offering := _dict.get('catalog_offering')) is not None: args['catalog_offering'] = InstanceCatalogOffering.from_dict(catalog_offering) + if (cluster_network := _dict.get('cluster_network')) is not None: + args['cluster_network'] = ClusterNetworkReference.from_dict(cluster_network) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentReference.from_dict(v) for v in cluster_network_attachments] + else: + raise ValueError('Required property \'cluster_network_attachments\' not present in Instance JSON') if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode else: @@ -47949,6 +50874,19 @@ def to_dict(self) -> Dict: _dict['catalog_offering'] = self.catalog_offering else: _dict['catalog_offering'] = self.catalog_offering.to_dict() + if hasattr(self, 'cluster_network') and self.cluster_network is not None: + if isinstance(self.cluster_network, dict): + _dict['cluster_network'] = self.cluster_network + else: + _dict['cluster_network'] = self.cluster_network.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'created_at') and self.created_at is not None: @@ -48716,93 +51654,399 @@ def __init__( raise Exception(msg) -class InstanceCollection: +class InstanceClusterNetworkAttachment: """ - InstanceCollection. + InstanceClusterNetworkAttachment. - :param InstanceCollectionFirst first: A link to the first page of resources. - :param List[Instance] instances: A page of virtual server instances. + :param InstanceClusterNetworkAttachmentBefore before: (optional) The instance + cluster network attachment that is immediately before. If absent, this is the + last instance cluster network attachment. + :param ClusterNetworkInterfaceReference cluster_network_interface: The cluster + network interface for this instance cluster network attachment. + :param str href: The URL for this instance cluster network attachment. + :param str id: The unique identifier for this instance cluster network + attachment. + :param List[InstanceClusterNetworkAttachmentLifecycleReason] lifecycle_reasons: + The reasons for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the instance cluster network + attachment. + :param str name: The name for this instance cluster network attachment. The name + is unique across all network attachments for the instance. + :param str resource_type: The resource type. + """ + + def __init__( + self, + cluster_network_interface: 'ClusterNetworkInterfaceReference', + href: str, + id: str, + lifecycle_reasons: List['InstanceClusterNetworkAttachmentLifecycleReason'], + lifecycle_state: str, + name: str, + resource_type: str, + *, + before: Optional['InstanceClusterNetworkAttachmentBefore'] = None, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachment object. + + :param ClusterNetworkInterfaceReference cluster_network_interface: The + cluster network interface for this instance cluster network attachment. + :param str href: The URL for this instance cluster network attachment. + :param str id: The unique identifier for this instance cluster network + attachment. + :param List[InstanceClusterNetworkAttachmentLifecycleReason] + lifecycle_reasons: The reasons for the current `lifecycle_state` (if any). + :param str lifecycle_state: The lifecycle state of the instance cluster + network attachment. + :param str name: The name for this instance cluster network attachment. The + name is unique across all network attachments for the instance. + :param str resource_type: The resource type. + :param InstanceClusterNetworkAttachmentBefore before: (optional) The + instance cluster network attachment that is immediately before. If absent, + this is the + last instance cluster network attachment. + """ + self.before = before + self.cluster_network_interface = cluster_network_interface + self.href = href + self.id = id + self.lifecycle_reasons = lifecycle_reasons + self.lifecycle_state = lifecycle_state + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachment': + """Initialize a InstanceClusterNetworkAttachment object from a json dictionary.""" + args = {} + if (before := _dict.get('before')) is not None: + args['before'] = InstanceClusterNetworkAttachmentBefore.from_dict(before) + if (cluster_network_interface := _dict.get('cluster_network_interface')) is not None: + args['cluster_network_interface'] = ClusterNetworkInterfaceReference.from_dict(cluster_network_interface) + else: + raise ValueError('Required property \'cluster_network_interface\' not present in InstanceClusterNetworkAttachment JSON') + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in InstanceClusterNetworkAttachment JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in InstanceClusterNetworkAttachment JSON') + if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None: + args['lifecycle_reasons'] = [InstanceClusterNetworkAttachmentLifecycleReason.from_dict(v) for v in lifecycle_reasons] + else: + raise ValueError('Required property \'lifecycle_reasons\' not present in InstanceClusterNetworkAttachment JSON') + if (lifecycle_state := _dict.get('lifecycle_state')) is not None: + args['lifecycle_state'] = lifecycle_state + else: + raise ValueError('Required property \'lifecycle_state\' not present in InstanceClusterNetworkAttachment JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in InstanceClusterNetworkAttachment JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in InstanceClusterNetworkAttachment JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachment 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, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.to_dict() + if hasattr(self, 'cluster_network_interface') and self.cluster_network_interface is not None: + if isinstance(self.cluster_network_interface, dict): + _dict['cluster_network_interface'] = self.cluster_network_interface + else: + _dict['cluster_network_interface'] = self.cluster_network_interface.to_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 + if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: + lifecycle_reasons_list = [] + for v in self.lifecycle_reasons: + if isinstance(v, dict): + lifecycle_reasons_list.append(v) + else: + lifecycle_reasons_list.append(v.to_dict()) + _dict['lifecycle_reasons'] = lifecycle_reasons_list + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + 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 InstanceClusterNetworkAttachment object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachment') -> 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: 'InstanceClusterNetworkAttachment') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the instance cluster network attachment. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + INSTANCE_CLUSTER_NETWORK_ATTACHMENT = 'instance_cluster_network_attachment' + + + +class InstanceClusterNetworkAttachmentBefore: + """ + The instance cluster network attachment that is immediately before. If absent, this is + the last instance cluster network attachment. + + :param str href: The URL for this instance cluster network attachment. + :param str id: The unique identifier for this instance cluster network + attachment. + :param str name: The name for this instance cluster network attachment. The name + is unique across all network attachments for the instance. + :param str resource_type: The resource type. + """ + + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentBefore object. + + :param str href: The URL for this instance cluster network attachment. + :param str id: The unique identifier for this instance cluster network + attachment. + :param str name: The name for this instance cluster network attachment. The + name is unique across all network attachments for the instance. + :param str resource_type: The resource type. + """ + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentBefore': + """Initialize a InstanceClusterNetworkAttachmentBefore object from a json dictionary.""" + args = {} + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in InstanceClusterNetworkAttachmentBefore JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in InstanceClusterNetworkAttachmentBefore JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in InstanceClusterNetworkAttachmentBefore JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in InstanceClusterNetworkAttachmentBefore JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachmentBefore 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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + 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 InstanceClusterNetworkAttachmentBefore object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentBefore') -> 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: 'InstanceClusterNetworkAttachmentBefore') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + INSTANCE_CLUSTER_NETWORK_ATTACHMENT = 'instance_cluster_network_attachment' + + + +class InstanceClusterNetworkAttachmentBeforePrototype: + """ + The instance cluster network attachment to insert this instance cluster network + attachment immediately before. + If unspecified, this instance cluster network attachment will be inserted after all + existing instance cluster network attachments. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentBeforePrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById', 'InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref']) + ) + raise Exception(msg) + + +class InstanceClusterNetworkAttachmentCollection: + """ + InstanceClusterNetworkAttachmentCollection. + + :param List[InstanceClusterNetworkAttachment] cluster_network_attachments: A + page of ordered cluster network attachments (sorted based on the `before` + property) for the instance. A cluster network attachment represents a device to + which a cluster network interface is attached. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param InstanceCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'InstanceCollectionFirst', - instances: List['Instance'], + cluster_network_attachments: List['InstanceClusterNetworkAttachment'], + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['InstanceCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a InstanceCollection object. + Initialize a InstanceClusterNetworkAttachmentCollection object. - :param InstanceCollectionFirst first: A link to the first page of - resources. - :param List[Instance] instances: A page of virtual server instances. + :param List[InstanceClusterNetworkAttachment] cluster_network_attachments: + A page of ordered cluster network attachments (sorted based on the `before` + property) for the instance. A cluster network attachment represents a + device to which a cluster network interface is attached. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param InstanceCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ + self.cluster_network_attachments = cluster_network_attachments self.first = first - self.instances = instances self.limit = limit self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCollection': - """Initialize a InstanceCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentCollection': + """Initialize a InstanceClusterNetworkAttachmentCollection object from a json dictionary.""" args = {} - if (first := _dict.get('first')) is not None: - args['first'] = InstanceCollectionFirst.from_dict(first) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachment.from_dict(v) for v in cluster_network_attachments] else: - raise ValueError('Required property \'first\' not present in InstanceCollection JSON') - if (instances := _dict.get('instances')) is not None: - args['instances'] = [Instance.from_dict(v) for v in instances] + raise ValueError('Required property \'cluster_network_attachments\' not present in InstanceClusterNetworkAttachmentCollection JSON') + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'instances\' not present in InstanceCollection JSON') + raise ValueError('Required property \'first\' not present in InstanceClusterNetworkAttachmentCollection JSON') if (limit := _dict.get('limit')) is not None: args['limit'] = limit else: - raise ValueError('Required property \'limit\' not present in InstanceCollection JSON') + raise ValueError('Required property \'limit\' not present in InstanceClusterNetworkAttachmentCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = InstanceCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: - raise ValueError('Required property \'total_count\' not present in InstanceCollection JSON') + raise ValueError('Required property \'total_count\' not present in InstanceClusterNetworkAttachmentCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCollection object from a json dictionary.""" + """Initialize a InstanceClusterNetworkAttachmentCollection 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, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'first') and self.first is not None: if isinstance(self.first, dict): _dict['first'] = self.first else: _dict['first'] = self.first.to_dict() - if hasattr(self, 'instances') and self.instances is not None: - instances_list = [] - for v in self.instances: - if isinstance(v, dict): - instances_list.append(v) - else: - instances_list.append(v.to_dict()) - _dict['instances'] = instances_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: @@ -48819,58 +52063,92 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCollection object.""" + """Return a `str` version of this InstanceClusterNetworkAttachmentCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCollection') -> bool: + def __eq__(self, other: 'InstanceClusterNetworkAttachmentCollection') -> 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: 'InstanceCollection') -> bool: + def __ne__(self, other: 'InstanceClusterNetworkAttachmentCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceCollectionFirst: +class InstanceClusterNetworkAttachmentLifecycleReason: """ - A link to the first page of resources. + InstanceClusterNetworkAttachmentLifecycleReason. - :param str href: The URL for a page of resources. + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for this + lifecycle state. """ def __init__( self, - href: str, + code: str, + message: str, + *, + more_info: Optional[str] = None, ) -> None: """ - Initialize a InstanceCollectionFirst object. + Initialize a InstanceClusterNetworkAttachmentLifecycleReason object. - :param str href: The URL for a page of resources. + :param str code: A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended + (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. """ - self.href = href + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCollectionFirst': - """Initialize a InstanceCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentLifecycleReason': + """Initialize a InstanceClusterNetworkAttachmentLifecycleReason object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (code := _dict.get('code')) is not None: + args['code'] = code else: - raise ValueError('Required property \'href\' not present in InstanceCollectionFirst JSON') + raise ValueError('Required property \'code\' not present in InstanceClusterNetworkAttachmentLifecycleReason JSON') + if (message := _dict.get('message')) is not None: + args['message'] = message + else: + raise ValueError('Required property \'message\' not present in InstanceClusterNetworkAttachmentLifecycleReason JSON') + if (more_info := _dict.get('more_info')) is not None: + args['more_info'] = more_info return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCollectionFirst object from a json dictionary.""" + """Initialize a InstanceClusterNetworkAttachmentLifecycleReason 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, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -48878,52 +52156,281 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCollectionFirst object.""" + """Return a `str` version of this InstanceClusterNetworkAttachmentLifecycleReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceClusterNetworkAttachmentLifecycleReason') -> 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: 'InstanceCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceClusterNetworkAttachmentLifecycleReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class CodeEnum(str, Enum): + """ + A reason code for this lifecycle state: + - `internal_error`: internal error (contact IBM support) + - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + support) + The enumerated values for this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. + """ + + INTERNAL_ERROR = 'internal_error' + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' + + -class InstanceCollectionNext: +class InstanceClusterNetworkAttachmentPatch: """ - A link to the next page of resources. This property is present for all pages except - the last page. + InstanceClusterNetworkAttachmentPatch. - :param str href: The URL for a page of resources. + :param str name: (optional) The name for this network attachment. The name must + not be used by another network attachment for the instance. Names starting with + `ibm-` are reserved for provider-owned resources, and are not allowed. + """ + + def __init__( + self, + *, + name: Optional[str] = None, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentPatch object. + + :param str name: (optional) The name for this network attachment. The name + must not be used by another network attachment for the instance. Names + starting with `ibm-` are reserved for provider-owned resources, and are not + allowed. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentPatch': + """Initialize a InstanceClusterNetworkAttachmentPatch object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachmentPatch 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 InstanceClusterNetworkAttachmentPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentPatch') -> 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: 'InstanceClusterNetworkAttachmentPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface: + """ + A cluster network interface for the instance cluster network attachment. This can be + specified using an existing cluster network interface that does not already have a + `target`, or a prototype object for a new cluster network interface. + This instance must reside in the same VPC as the specified cluster network interface. + The cluster network interface must reside in the same cluster network as the + `cluster_network_interface` of any other `cluster_network_attachments` for this + instance. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment', 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity']) + ) + raise Exception(msg) + + +class InstanceClusterNetworkAttachmentPrototypeInstanceContext: + """ + InstanceClusterNetworkAttachmentPrototypeInstanceContext. + + :param InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface + cluster_network_interface: A cluster network interface for the instance cluster + network attachment. This can be + specified using an existing cluster network interface that does not already have + a `target`, + or a prototype object for a new cluster network interface. + This instance must reside in the same VPC as the specified cluster network + interface. The + cluster network interface must reside in the same cluster network as the + `cluster_network_interface` of any other `cluster_network_attachments` for this + instance. + :param str name: (optional) The name for this cluster network attachment. Names + must be unique within the instance the cluster network attachment resides in. If + unspecified, the name will be a hyphenated list of randomly-selected words. + Names starting with `ibm-` are reserved for provider-owned resources, and are + not allowed. + """ + + def __init__( + self, + cluster_network_interface: 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface', + *, + name: Optional[str] = None, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentPrototypeInstanceContext object. + + :param InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface + cluster_network_interface: A cluster network interface for the instance + cluster network attachment. This can be + specified using an existing cluster network interface that does not already + have a `target`, + or a prototype object for a new cluster network interface. + This instance must reside in the same VPC as the specified cluster network + interface. The + cluster network interface must reside in the same cluster network as the + `cluster_network_interface` of any other `cluster_network_attachments` for + this instance. + :param str name: (optional) The name for this cluster network attachment. + Names must be unique within the instance the cluster network attachment + resides in. If unspecified, the name will be a hyphenated list of + randomly-selected words. Names starting with `ibm-` are reserved for + provider-owned resources, and are not allowed. + """ + self.cluster_network_interface = cluster_network_interface + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentPrototypeInstanceContext': + """Initialize a InstanceClusterNetworkAttachmentPrototypeInstanceContext object from a json dictionary.""" + args = {} + if (cluster_network_interface := _dict.get('cluster_network_interface')) is not None: + args['cluster_network_interface'] = cluster_network_interface + else: + raise ValueError('Required property \'cluster_network_interface\' not present in InstanceClusterNetworkAttachmentPrototypeInstanceContext JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachmentPrototypeInstanceContext 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, 'cluster_network_interface') and self.cluster_network_interface is not None: + if isinstance(self.cluster_network_interface, dict): + _dict['cluster_network_interface'] = self.cluster_network_interface + else: + _dict['cluster_network_interface'] = self.cluster_network_interface.to_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 InstanceClusterNetworkAttachmentPrototypeInstanceContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentPrototypeInstanceContext') -> 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: 'InstanceClusterNetworkAttachmentPrototypeInstanceContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceClusterNetworkAttachmentReference: + """ + InstanceClusterNetworkAttachmentReference. + + :param str href: The URL for this instance cluster network attachment. + :param str id: The unique identifier for this instance cluster network + attachment. + :param str name: The name for this instance cluster network attachment. The name + is unique across all network attachments for the instance. + :param str resource_type: The resource type. """ def __init__( self, href: str, + id: str, + name: str, + resource_type: str, ) -> None: """ - Initialize a InstanceCollectionNext object. + Initialize a InstanceClusterNetworkAttachmentReference object. - :param str href: The URL for a page of resources. + :param str href: The URL for this instance cluster network attachment. + :param str id: The unique identifier for this instance cluster network + attachment. + :param str name: The name for this instance cluster network attachment. The + name is unique across all network attachments for the instance. + :param str resource_type: The resource type. """ self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCollectionNext': - """Initialize a InstanceCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentReference': + """Initialize a InstanceClusterNetworkAttachmentReference object from a json dictionary.""" args = {} if (href := _dict.get('href')) is not None: args['href'] = href else: - raise ValueError('Required property \'href\' not present in InstanceCollectionNext JSON') + raise ValueError('Required property \'href\' not present in InstanceClusterNetworkAttachmentReference JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in InstanceClusterNetworkAttachmentReference JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in InstanceClusterNetworkAttachmentReference JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in InstanceClusterNetworkAttachmentReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCollectionNext object from a json dictionary.""" + """Initialize a InstanceClusterNetworkAttachmentReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -48931,6 +52438,136 @@ def to_dict(self) -> Dict: _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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + 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 InstanceClusterNetworkAttachmentReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentReference') -> 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: 'InstanceClusterNetworkAttachmentReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + INSTANCE_CLUSTER_NETWORK_ATTACHMENT = 'instance_cluster_network_attachment' + + + +class InstanceCollection: + """ + InstanceCollection. + + :param PageLink first: A link to the first page of resources. + :param List[Instance] instances: A page of virtual server instances. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. + """ + + def __init__( + self, + first: 'PageLink', + instances: List['Instance'], + limit: int, + total_count: int, + *, + next: Optional['PageLink'] = None, + ) -> None: + """ + Initialize a InstanceCollection object. + + :param PageLink first: A link to the first page of resources. + :param List[Instance] instances: A page of virtual server instances. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + """ + self.first = first + self.instances = instances + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceCollection': + """Initialize a InstanceCollection object from a json dictionary.""" + args = {} + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in InstanceCollection JSON') + if (instances := _dict.get('instances')) is not None: + args['instances'] = [Instance.from_dict(v) for v in instances] + else: + raise ValueError('Required property \'instances\' not present in InstanceCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in InstanceCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in InstanceCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceCollection 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, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'instances') and self.instances is not None: + instances_list = [] + for v in self.instances: + if isinstance(v, dict): + instances_list.append(v) + else: + instances_list.append(v.to_dict()) + _dict['instances'] = instances_list + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -48938,16 +52575,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCollectionNext object.""" + """Return a `str` version of this InstanceCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCollectionNext') -> bool: + def __eq__(self, other: 'InstanceCollection') -> 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: 'InstanceCollectionNext') -> bool: + def __ne__(self, other: 'InstanceCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -49958,37 +53595,35 @@ class InstanceGroupCollection: """ InstanceGroupCollection. - :param InstanceGroupCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[InstanceGroup] instance_groups: A page of instance groups. :param int limit: The maximum number of resources that can be returned by the request. - :param InstanceGroupCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'InstanceGroupCollectionFirst', + first: 'PageLink', instance_groups: List['InstanceGroup'], limit: int, total_count: int, *, - next: Optional['InstanceGroupCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a InstanceGroupCollection object. - :param InstanceGroupCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param List[InstanceGroup] instance_groups: A page of instance groups. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param InstanceGroupCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -50002,7 +53637,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollection': """Initialize a InstanceGroupCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = InstanceGroupCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in InstanceGroupCollection JSON') if (instance_groups := _dict.get('instance_groups')) is not None: @@ -50014,7 +53649,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollection': else: raise ValueError('Required property \'limit\' not present in InstanceGroupCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = InstanceGroupCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -50072,125 +53707,6 @@ def __ne__(self, other: 'InstanceGroupCollection') -> bool: return not self == other -class InstanceGroupCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionFirst': - """Initialize a InstanceGroupCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupCollectionFirst 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 InstanceGroupCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupCollectionFirst') -> 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: 'InstanceGroupCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceGroupCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionNext': - """Initialize a InstanceGroupCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupCollectionNext 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 InstanceGroupCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupCollectionNext') -> 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: 'InstanceGroupCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class InstanceGroupLifecycleReason: """ InstanceGroupLifecycleReason. @@ -50862,12 +54378,11 @@ class InstanceGroupManagerActionsCollection: :param List[InstanceGroupManagerAction] actions: A page of actions for the instance group manager. - :param InstanceGroupManagerActionsCollectionFirst first: A link to the first - page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param InstanceGroupManagerActionsCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -50875,24 +54390,23 @@ class InstanceGroupManagerActionsCollection: def __init__( self, actions: List['InstanceGroupManagerAction'], - first: 'InstanceGroupManagerActionsCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['InstanceGroupManagerActionsCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a InstanceGroupManagerActionsCollection object. :param List[InstanceGroupManagerAction] actions: A page of actions for the instance group manager. - :param InstanceGroupManagerActionsCollectionFirst first: A link to the - first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param InstanceGroupManagerActionsCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.actions = actions @@ -50910,7 +54424,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollection': else: raise ValueError('Required property \'actions\' not present in InstanceGroupManagerActionsCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = InstanceGroupManagerActionsCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in InstanceGroupManagerActionsCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -50918,7 +54432,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollection': else: raise ValueError('Required property \'limit\' not present in InstanceGroupManagerActionsCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = InstanceGroupManagerActionsCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -50976,162 +54490,41 @@ def __ne__(self, other: 'InstanceGroupManagerActionsCollection') -> bool: return not self == other -class InstanceGroupManagerActionsCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupManagerActionsCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionFirst': - """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionsCollectionFirst 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 InstanceGroupManagerActionsCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> 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: 'InstanceGroupManagerActionsCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceGroupManagerActionsCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupManagerActionsCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionNext': - """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionsCollectionNext 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 InstanceGroupManagerActionsCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerActionsCollectionNext') -> 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: 'InstanceGroupManagerActionsCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class InstanceGroupManagerCollection: """ InstanceGroupManagerCollection. - :param InstanceGroupManagerCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[InstanceGroupManager] managers: A page of managers for the instance group. - :param InstanceGroupManagerCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'InstanceGroupManagerCollectionFirst', + first: 'PageLink', limit: int, managers: List['InstanceGroupManager'], total_count: int, *, - next: Optional['InstanceGroupManagerCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a InstanceGroupManagerCollection object. - :param InstanceGroupManagerCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[InstanceGroupManager] managers: A page of managers for the instance group. :param int total_count: The total number of resources across all pages. - :param InstanceGroupManagerCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -51145,7 +54538,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollection': """Initialize a InstanceGroupManagerCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = InstanceGroupManagerCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in InstanceGroupManagerCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -51157,7 +54550,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollection': else: raise ValueError('Required property \'managers\' not present in InstanceGroupManagerCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = InstanceGroupManagerCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -51215,125 +54608,6 @@ def __ne__(self, other: 'InstanceGroupManagerCollection') -> bool: return not self == other -class InstanceGroupManagerCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupManagerCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollectionFirst': - """Initialize a InstanceGroupManagerCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerCollectionFirst 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 InstanceGroupManagerCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerCollectionFirst') -> 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: 'InstanceGroupManagerCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceGroupManagerCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupManagerCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollectionNext': - """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerCollectionNext 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 InstanceGroupManagerCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerCollectionNext') -> 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: 'InstanceGroupManagerCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class InstanceGroupManagerPatch: """ InstanceGroupManagerPatch. @@ -51489,12 +54763,11 @@ class InstanceGroupManagerPolicyCollection: """ InstanceGroupManagerPolicyCollection. - :param InstanceGroupManagerPolicyCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param InstanceGroupManagerPolicyCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[InstanceGroupManagerPolicy] policies: A page of policies for the instance group manager. @@ -51503,25 +54776,24 @@ class InstanceGroupManagerPolicyCollection: def __init__( self, - first: 'InstanceGroupManagerPolicyCollectionFirst', + first: 'PageLink', limit: int, policies: List['InstanceGroupManagerPolicy'], total_count: int, *, - next: Optional['InstanceGroupManagerPolicyCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a InstanceGroupManagerPolicyCollection object. - :param InstanceGroupManagerPolicyCollectionFirst first: A link to the first - page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[InstanceGroupManagerPolicy] policies: A page of policies for the instance group manager. :param int total_count: The total number of resources across all pages. - :param InstanceGroupManagerPolicyCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -51535,7 +54807,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollection': """Initialize a InstanceGroupManagerPolicyCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = InstanceGroupManagerPolicyCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in InstanceGroupManagerPolicyCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -51543,7 +54815,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollection': else: raise ValueError('Required property \'limit\' not present in InstanceGroupManagerPolicyCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = InstanceGroupManagerPolicyCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (policies := _dict.get('policies')) is not None: args['policies'] = policies else: @@ -51605,125 +54877,6 @@ def __ne__(self, other: 'InstanceGroupManagerPolicyCollection') -> bool: return not self == other -class InstanceGroupManagerPolicyCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupManagerPolicyCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollectionFirst': - """Initialize a InstanceGroupManagerPolicyCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyCollectionFirst 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 InstanceGroupManagerPolicyCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> 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: 'InstanceGroupManagerPolicyCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceGroupManagerPolicyCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupManagerPolicyCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollectionNext': - """Initialize a InstanceGroupManagerPolicyCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyCollectionNext 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 InstanceGroupManagerPolicyCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> 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: 'InstanceGroupManagerPolicyCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class InstanceGroupManagerPolicyPatch: """ InstanceGroupManagerPolicyPatch. @@ -52432,39 +55585,37 @@ class InstanceGroupMembershipCollection: """ InstanceGroupMembershipCollection. - :param InstanceGroupMembershipCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[InstanceGroupMembership] memberships: A page of memberships for the instance group. - :param InstanceGroupMembershipCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'InstanceGroupMembershipCollectionFirst', + first: 'PageLink', limit: int, memberships: List['InstanceGroupMembership'], total_count: int, *, - next: Optional['InstanceGroupMembershipCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a InstanceGroupMembershipCollection object. - :param InstanceGroupMembershipCollectionFirst first: A link to the first - page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[InstanceGroupMembership] memberships: A page of memberships for the instance group. :param int total_count: The total number of resources across all pages. - :param InstanceGroupMembershipCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -52478,7 +55629,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollection': """Initialize a InstanceGroupMembershipCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = InstanceGroupMembershipCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in InstanceGroupMembershipCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -52490,7 +55641,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollection': else: raise ValueError('Required property \'memberships\' not present in InstanceGroupMembershipCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = InstanceGroupMembershipCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -52548,125 +55699,6 @@ def __ne__(self, other: 'InstanceGroupMembershipCollection') -> bool: return not self == other -class InstanceGroupMembershipCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupMembershipCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionFirst': - """Initialize a InstanceGroupMembershipCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupMembershipCollectionFirst 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 InstanceGroupMembershipCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupMembershipCollectionFirst') -> 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: 'InstanceGroupMembershipCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceGroupMembershipCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupMembershipCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionNext': - """Initialize a InstanceGroupMembershipCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupMembershipCollectionNext 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 InstanceGroupMembershipCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupMembershipCollectionNext') -> 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: 'InstanceGroupMembershipCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class InstanceGroupMembershipPatch: """ InstanceGroupMembershipPatch. @@ -54451,14 +57483,13 @@ class InstancePatch: `stopped`. If set, `reservation_affinity.policy` must be `disabled`. :param InstancePatchProfile profile: (optional) The profile to use for this - virtual server instance. For the profile to be changed, - the instance `status` must be `stopping` or `stopped`. In addition, the - requested - profile must: - - Have matching instance disk support. Any disks associated with the current + virtual server instance. Any disks associated with the + current profile will be deleted, and any disks associated with the requested profile - will be deleted, and any disks associated with the requested profile will be - created. + will be created. + For the profile to be changed, the instance `status` must be `stopping` or + `stopped`. + In addition, the requested profile must: - Be compatible with any `placement_target` constraints. For example, if the instance is placed on a dedicated host, the requested profile `family` must be the same as the dedicated host `family`. @@ -54511,15 +57542,13 @@ def __init__( `stopping` or `stopped`. If set, `reservation_affinity.policy` must be `disabled`. :param InstancePatchProfile profile: (optional) The profile to use for this - virtual server instance. For the profile to be changed, - the instance `status` must be `stopping` or `stopped`. In addition, the - requested - profile must: - - Have matching instance disk support. Any disks associated with the - current profile - will be deleted, and any disks associated with the requested profile will - be - created. + virtual server instance. Any disks associated with the + current profile will be deleted, and any disks associated with the + requested profile + will be created. + For the profile to be changed, the instance `status` must be `stopping` or + `stopped`. + In addition, the requested profile must: - Be compatible with any `placement_target` constraints. For example, if the instance is placed on a dedicated host, the requested profile `family` @@ -54644,12 +57673,11 @@ class ConfidentialComputeModeEnum(str, Enum): class InstancePatchProfile: """ - The profile to use for this virtual server instance. For the profile to be changed, - the instance `status` must be `stopping` or `stopped`. In addition, the requested - profile must: - - Have matching instance disk support. Any disks associated with the current profile - will be deleted, and any disks associated with the requested profile will be - created. + The profile to use for this virtual server instance. Any disks associated with the + current profile will be deleted, and any disks associated with the requested profile + will be created. + For the profile to be changed, the instance `status` must be `stopping` or `stopped`. + In addition, the requested profile must: - Be compatible with any `placement_target` constraints. For example, if the instance is placed on a dedicated host, the requested profile `family` must be the same as the dedicated host `family`. @@ -54734,6 +57762,8 @@ class InstanceProfile: InstanceProfile. :param InstanceProfileBandwidth bandwidth: + :param InstanceProfileClusterNetworkAttachmentCount + cluster_network_attachment_count: :param InstanceProfileSupportedConfidentialComputeModes confidential_compute_modes: :param List[InstanceProfileDisk] disks: The disks for an instance with this @@ -54768,6 +57798,8 @@ class InstanceProfile: The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + :param List[ClusterNetworkProfileReference] supported_cluster_network_profiles: + The cluster network profiles that support this instance profile. :param InstanceProfileVolumeBandwidth total_volume_bandwidth: :param InstanceProfileVCPUArchitecture vcpu_architecture: :param InstanceProfileVCPU vcpu_count: @@ -54777,6 +57809,7 @@ class InstanceProfile: def __init__( self, bandwidth: 'InstanceProfileBandwidth', + cluster_network_attachment_count: 'InstanceProfileClusterNetworkAttachmentCount', confidential_compute_modes: 'InstanceProfileSupportedConfidentialComputeModes', disks: List['InstanceProfileDisk'], family: str, @@ -54791,6 +57824,7 @@ def __init__( resource_type: str, secure_boot_modes: 'InstanceProfileSupportedSecureBootModes', status: str, + supported_cluster_network_profiles: List['ClusterNetworkProfileReference'], total_volume_bandwidth: 'InstanceProfileVolumeBandwidth', vcpu_architecture: 'InstanceProfileVCPUArchitecture', vcpu_count: 'InstanceProfileVCPU', @@ -54806,6 +57840,8 @@ def __init__( Initialize a InstanceProfile object. :param InstanceProfileBandwidth bandwidth: + :param InstanceProfileClusterNetworkAttachmentCount + cluster_network_attachment_count: :param InstanceProfileSupportedConfidentialComputeModes confidential_compute_modes: :param List[InstanceProfileDisk] disks: The disks for an instance with this @@ -54835,6 +57871,9 @@ def __init__( The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + :param List[ClusterNetworkProfileReference] + supported_cluster_network_profiles: The cluster network profiles that + support this instance profile. :param InstanceProfileVolumeBandwidth total_volume_bandwidth: :param InstanceProfileVCPUArchitecture vcpu_architecture: :param InstanceProfileVCPU vcpu_count: @@ -54846,6 +57885,7 @@ def __init__( :param InstanceProfileNUMACount numa_count: (optional) """ self.bandwidth = bandwidth + self.cluster_network_attachment_count = cluster_network_attachment_count self.confidential_compute_modes = confidential_compute_modes self.disks = disks self.family = family @@ -54865,6 +57905,7 @@ def __init__( self.resource_type = resource_type self.secure_boot_modes = secure_boot_modes self.status = status + self.supported_cluster_network_profiles = supported_cluster_network_profiles self.total_volume_bandwidth = total_volume_bandwidth self.vcpu_architecture = vcpu_architecture self.vcpu_count = vcpu_count @@ -54878,6 +57919,10 @@ def from_dict(cls, _dict: Dict) -> 'InstanceProfile': args['bandwidth'] = bandwidth else: raise ValueError('Required property \'bandwidth\' not present in InstanceProfile JSON') + if (cluster_network_attachment_count := _dict.get('cluster_network_attachment_count')) is not None: + args['cluster_network_attachment_count'] = cluster_network_attachment_count + else: + raise ValueError('Required property \'cluster_network_attachment_count\' not present in InstanceProfile JSON') if (confidential_compute_modes := _dict.get('confidential_compute_modes')) is not None: args['confidential_compute_modes'] = InstanceProfileSupportedConfidentialComputeModes.from_dict(confidential_compute_modes) else: @@ -54944,6 +57989,10 @@ def from_dict(cls, _dict: Dict) -> 'InstanceProfile': args['status'] = status else: raise ValueError('Required property \'status\' not present in InstanceProfile JSON') + if (supported_cluster_network_profiles := _dict.get('supported_cluster_network_profiles')) is not None: + args['supported_cluster_network_profiles'] = [ClusterNetworkProfileReference.from_dict(v) for v in supported_cluster_network_profiles] + else: + raise ValueError('Required property \'supported_cluster_network_profiles\' not present in InstanceProfile JSON') if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None: args['total_volume_bandwidth'] = total_volume_bandwidth else: @@ -54975,6 +58024,11 @@ def to_dict(self) -> Dict: _dict['bandwidth'] = self.bandwidth else: _dict['bandwidth'] = self.bandwidth.to_dict() + if hasattr(self, 'cluster_network_attachment_count') and self.cluster_network_attachment_count is not None: + if isinstance(self.cluster_network_attachment_count, dict): + _dict['cluster_network_attachment_count'] = self.cluster_network_attachment_count + else: + _dict['cluster_network_attachment_count'] = self.cluster_network_attachment_count.to_dict() if hasattr(self, 'confidential_compute_modes') and self.confidential_compute_modes is not None: if isinstance(self.confidential_compute_modes, dict): _dict['confidential_compute_modes'] = self.confidential_compute_modes @@ -55058,6 +58112,14 @@ def to_dict(self) -> Dict: _dict['secure_boot_modes'] = self.secure_boot_modes.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status + if hasattr(self, 'supported_cluster_network_profiles') and self.supported_cluster_network_profiles is not None: + supported_cluster_network_profiles_list = [] + for v in self.supported_cluster_network_profiles: + if isinstance(v, dict): + supported_cluster_network_profiles_list.append(v) + else: + supported_cluster_network_profiles_list.append(v.to_dict()) + _dict['supported_cluster_network_profiles'] = supported_cluster_network_profiles_list if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: if isinstance(self.total_volume_bandwidth, dict): _dict['total_volume_bandwidth'] = self.total_volume_bandwidth @@ -55146,6 +58208,25 @@ def __init__( raise Exception(msg) +class InstanceProfileClusterNetworkAttachmentCount: + """ + InstanceProfileClusterNetworkAttachmentCount. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstanceProfileClusterNetworkAttachmentCount object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileClusterNetworkAttachmentCountDependent', 'InstanceProfileClusterNetworkAttachmentCountEnum', 'InstanceProfileClusterNetworkAttachmentCountRange']) + ) + raise Exception(msg) + + class InstanceProfileCollection: """ InstanceProfileCollection. @@ -56455,6 +59536,12 @@ class InstancePrototype: :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -56523,6 +59610,7 @@ def __init__( self, *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -56543,6 +59631,13 @@ def __init__( :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -57153,6 +60248,12 @@ class InstanceTemplate: :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -57228,6 +60329,7 @@ def __init__( resource_group: 'ResourceGroupReference', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -57255,6 +60357,13 @@ def __init__( instance template. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -57335,12 +60444,11 @@ class InstanceTemplateCollection: """ InstanceTemplateCollection. - :param InstanceTemplateCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param InstanceTemplateCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[InstanceTemplate] templates: A page of instance templates. :param int total_count: The total number of resources across all pages. @@ -57348,24 +60456,23 @@ class InstanceTemplateCollection: def __init__( self, - first: 'InstanceTemplateCollectionFirst', + first: 'PageLink', limit: int, templates: List['InstanceTemplate'], total_count: int, *, - next: Optional['InstanceTemplateCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a InstanceTemplateCollection object. - :param InstanceTemplateCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[InstanceTemplate] templates: A page of instance templates. :param int total_count: The total number of resources across all pages. - :param InstanceTemplateCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -57379,7 +60486,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollection': """Initialize a InstanceTemplateCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = InstanceTemplateCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in InstanceTemplateCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -57387,7 +60494,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollection': else: raise ValueError('Required property \'limit\' not present in InstanceTemplateCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = InstanceTemplateCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (templates := _dict.get('templates')) is not None: args['templates'] = templates else: @@ -57449,125 +60556,6 @@ def __ne__(self, other: 'InstanceTemplateCollection') -> bool: return not self == other -class InstanceTemplateCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceTemplateCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionFirst': - """Initialize a InstanceTemplateCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceTemplateCollectionFirst 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 InstanceTemplateCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceTemplateCollectionFirst') -> 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: 'InstanceTemplateCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceTemplateCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceTemplateCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionNext': - """Initialize a InstanceTemplateCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceTemplateCollectionNext 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 InstanceTemplateCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceTemplateCollectionNext') -> 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: 'InstanceTemplateCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class InstanceTemplateIdentity: """ Identifies an instance template by a unique property. @@ -57653,6 +60641,12 @@ class InstanceTemplatePrototype: :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -57720,6 +60714,7 @@ def __init__( self, *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -57740,6 +60735,13 @@ def __init__( :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -58193,35 +61195,35 @@ class KeyCollection: """ KeyCollection. - :param KeyCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[Key] keys: A page of keys. :param int limit: The maximum number of resources that can be returned by the request. - :param KeyCollectionNext next: (optional) A link to the next page of resources. - This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'KeyCollectionFirst', + first: 'PageLink', keys: List['Key'], limit: int, total_count: int, *, - next: Optional['KeyCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a KeyCollection object. - :param KeyCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[Key] keys: A page of keys. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param KeyCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -58235,7 +61237,7 @@ def from_dict(cls, _dict: Dict) -> 'KeyCollection': """Initialize a KeyCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = KeyCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in KeyCollection JSON') if (keys := _dict.get('keys')) is not None: @@ -58247,7 +61249,7 @@ def from_dict(cls, _dict: Dict) -> 'KeyCollection': else: raise ValueError('Required property \'limit\' not present in KeyCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = KeyCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -58305,125 +61307,6 @@ def __ne__(self, other: 'KeyCollection') -> bool: return not self == other -class KeyCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a KeyCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyCollectionFirst': - """Initialize a KeyCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in KeyCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a KeyCollectionFirst 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 KeyCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'KeyCollectionFirst') -> 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: 'KeyCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class KeyCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a KeyCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyCollectionNext': - """Initialize a KeyCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in KeyCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a KeyCollectionNext 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 KeyCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'KeyCollectionNext') -> 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: 'KeyCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class KeyIdentity: """ Identifies a key by a unique property. @@ -59277,36 +62160,35 @@ class LoadBalancerCollection: """ LoadBalancerCollection. - :param LoadBalancerCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[LoadBalancer] load_balancers: A page of load balancers. - :param LoadBalancerCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'LoadBalancerCollectionFirst', + first: 'PageLink', limit: int, load_balancers: List['LoadBalancer'], total_count: int, *, - next: Optional['LoadBalancerCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a LoadBalancerCollection object. - :param LoadBalancerCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[LoadBalancer] load_balancers: A page of load balancers. :param int total_count: The total number of resources across all pages. - :param LoadBalancerCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -59320,7 +62202,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollection': """Initialize a LoadBalancerCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = LoadBalancerCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in LoadBalancerCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -59332,7 +62214,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollection': else: raise ValueError('Required property \'load_balancers\' not present in LoadBalancerCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = LoadBalancerCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -59390,125 +62272,6 @@ def __ne__(self, other: 'LoadBalancerCollection') -> bool: return not self == other -class LoadBalancerCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a LoadBalancerCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionFirst': - """Initialize a LoadBalancerCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in LoadBalancerCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerCollectionFirst 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 LoadBalancerCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'LoadBalancerCollectionFirst') -> 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: 'LoadBalancerCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class LoadBalancerCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a LoadBalancerCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionNext': - """Initialize a LoadBalancerCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in LoadBalancerCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerCollectionNext 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 LoadBalancerCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'LoadBalancerCollectionNext') -> 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: 'LoadBalancerCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class LoadBalancerDNS: """ The DNS configuration for this load balancer. @@ -59805,7 +62568,9 @@ class LoadBalancerListener: :param CertificateInstanceReference certificate_instance: (optional) The certificate instance used for SSL termination. If absent, this listener is not using a certificate instance. - :param int connection_limit: The connection limit of the listener. + :param int connection_limit: (optional) The concurrent connection limit for the + listener. If reached, incoming connections may be queued or rejected. + This property will be present for load balancers in the `application` family. :param datetime created_at: The date and time that this listener was created. :param LoadBalancerPoolReference default_pool: (optional) The default pool for this listener. If absent, this listener has no default pool. @@ -59816,8 +62581,8 @@ class LoadBalancerListener: listener's `policies` match. :param str id: The unique identifier for this load balancer listener. :param int idle_connection_timeout: (optional) The idle connection timeout of - the listener in seconds. This property will be present for load balancers in the - `application` family. + the listener in seconds. + This property will be present for load balancers in the `application` family. :param List[LoadBalancerListenerPolicyReference] policies: (optional) The policies for this listener. :param int port: The listener port number, or the inclusive lower bound of the @@ -59843,7 +62608,6 @@ class LoadBalancerListener: def __init__( self, accept_proxy_protocol: bool, - connection_limit: int, created_at: datetime, href: str, id: str, @@ -59854,6 +62618,7 @@ def __init__( provisioning_status: str, *, certificate_instance: Optional['CertificateInstanceReference'] = None, + connection_limit: Optional[int] = None, default_pool: Optional['LoadBalancerPoolReference'] = None, https_redirect: Optional['LoadBalancerListenerHTTPSRedirect'] = None, idle_connection_timeout: Optional[int] = None, @@ -59873,7 +62638,6 @@ def __init__( its `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. - :param int connection_limit: The connection limit of the listener. :param datetime created_at: The date and time that this listener was created. :param str href: The URL for this load balancer listener. @@ -59899,6 +62663,10 @@ def __init__( :param CertificateInstanceReference certificate_instance: (optional) The certificate instance used for SSL termination. If absent, this listener is not using a certificate instance. + :param int connection_limit: (optional) The concurrent connection limit for + the listener. If reached, incoming connections may be queued or rejected. + This property will be present for load balancers in the `application` + family. :param LoadBalancerPoolReference default_pool: (optional) The default pool for this listener. If absent, this listener has no default pool. If `https_redirect` is set, the default pool will not be used. @@ -59906,8 +62674,9 @@ def __init__( present, the target listener that requests are redirected to if none of the listener's `policies` match. :param int idle_connection_timeout: (optional) The idle connection timeout - of the listener in seconds. This property will be present for load - balancers in the `application` family. + of the listener in seconds. + This property will be present for load balancers in the `application` + family. :param List[LoadBalancerListenerPolicyReference] policies: (optional) The policies for this listener. """ @@ -59939,8 +62708,6 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener': args['certificate_instance'] = CertificateInstanceReference.from_dict(certificate_instance) if (connection_limit := _dict.get('connection_limit')) is not None: args['connection_limit'] = connection_limit - else: - raise ValueError('Required property \'connection_limit\' not present in LoadBalancerListener JSON') if (created_at := _dict.get('created_at')) is not None: args['created_at'] = string_to_datetime(created_at) else: @@ -60457,7 +63224,9 @@ class LoadBalancerListenerPatch: :param CertificateInstanceIdentity certificate_instance: (optional) The certificate instance to use for SSL termination. The listener must have a `protocol` of `https`. - :param int connection_limit: (optional) The connection limit of the listener. + :param int connection_limit: (optional) The concurrent connection limit for the + listener. If reached, incoming connections may be queued or rejected. + Supported for load balancers in the `application` family. :param LoadBalancerListenerDefaultPoolPatch default_pool: (optional) The default pool for this listener. If `https_redirect` is set, the default pool will not be used. The specified pool must: @@ -60474,8 +63243,8 @@ class LoadBalancerListenerPatch: must have a `protocol` of `https`. Specify `null` to remove any existing https redirect. :param int idle_connection_timeout: (optional) The idle connection timeout of - the listener in seconds. Supported for load balancers in the `application` - family. + the listener in seconds. + Supported for load balancers in the `application` family. :param int port: (optional) The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. @@ -60541,8 +63310,9 @@ def __init__( :param CertificateInstanceIdentity certificate_instance: (optional) The certificate instance to use for SSL termination. The listener must have a `protocol` of `https`. - :param int connection_limit: (optional) The connection limit of the - listener. + :param int connection_limit: (optional) The concurrent connection limit for + the listener. If reached, incoming connections may be queued or rejected. + Supported for load balancers in the `application` family. :param LoadBalancerListenerDefaultPoolPatch default_pool: (optional) The default pool for this listener. If `https_redirect` is set, the default pool will not @@ -60561,8 +63331,8 @@ def __init__( must have a `protocol` of `https`. Specify `null` to remove any existing https redirect. :param int idle_connection_timeout: (optional) The idle connection timeout - of the listener in seconds. Supported for load balancers in the - `application` family. + of the listener in seconds. + Supported for load balancers in the `application` family. :param int port: (optional) The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. @@ -61105,10 +63875,10 @@ class LoadBalancerListenerPolicyPrototype: :param str action: The policy action: - `forward`: Requests will be forwarded to the specified `target` pool - - `https_redirect`: Requests will be redirected to the specified target - listener. The - listener must have a `protocol` of `http`, and the target listener must have a - `protocol` of `https` + - `https_redirect`: Requests will be redirected to the specified + `target.listener`. + This listener must have a `protocol` of `http`, and the target listener must + have a `protocol` of `https`. - `redirect`: Requests will be redirected to the specified `target.url` - `reject`: Requests will be rejected with a `403` status code. :param str name: (optional) The name for this policy. The name must not be used @@ -61119,11 +63889,15 @@ class LoadBalancerListenerPolicyPrototype: :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule prototype objects for this policy. :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If - `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPrototype`. + `action` is `forward`, use `LoadBalancerPoolIdentity` to specify a pool in this + load balancer to forward to. + - If `action` is `https_redirect`, use + `LoadBalancerListenerPolicyHTTPSRedirectPrototype` to specify a listener on + this + load balancer to redirect to. + - If `action` is `redirect`, use + `LoadBalancerListenerPolicyRedirectURLPrototype`to + specify a URL to redirect to. """ def __init__( @@ -61140,11 +63914,11 @@ def __init__( :param str action: The policy action: - `forward`: Requests will be forwarded to the specified `target` pool - - `https_redirect`: Requests will be redirected to the specified target - listener. The - listener must have a `protocol` of `http`, and the target listener must - have a - `protocol` of `https` + - `https_redirect`: Requests will be redirected to the specified + `target.listener`. + This listener must have a `protocol` of `http`, and the target listener + must + have a `protocol` of `https`. - `redirect`: Requests will be redirected to the specified `target.url` - `reject`: Requests will be rejected with a `403` status code. :param int priority: Priority of the policy. The priority is unique across @@ -61156,11 +63930,16 @@ def __init__( :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule prototype objects for this policy. :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If - `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPrototype`. + `action` is `forward`, use `LoadBalancerPoolIdentity` to specify a pool in + this + load balancer to forward to. + - If `action` is `https_redirect`, use + `LoadBalancerListenerPolicyHTTPSRedirectPrototype` to specify a listener + on this + load balancer to redirect to. + - If `action` is `redirect`, use + `LoadBalancerListenerPolicyRedirectURLPrototype`to + specify a URL to redirect to. """ self.action = action self.name = name @@ -61239,10 +64018,10 @@ class ActionEnum(str, Enum): """ The policy action: - `forward`: Requests will be forwarded to the specified `target` pool - - `https_redirect`: Requests will be redirected to the specified target listener. - The - listener must have a `protocol` of `http`, and the target listener must have a - `protocol` of `https` + - `https_redirect`: Requests will be redirected to the specified + `target.listener`. + This listener must have a `protocol` of `http`, and the target listener must + have a `protocol` of `https`. - `redirect`: Requests will be redirected to the specified `target.url` - `reject`: Requests will be rejected with a `403` status code. """ @@ -62008,11 +64787,13 @@ def __init__( class LoadBalancerListenerPolicyTargetPrototype: """ - - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPrototype`. + - If `action` is `forward`, use `LoadBalancerPoolIdentity` to specify a pool in this + load balancer to forward to. + - If `action` is `https_redirect`, use + `LoadBalancerListenerPolicyHTTPSRedirectPrototype` to specify a listener on this + load balancer to redirect to. + - If `action` is `redirect`, use `LoadBalancerListenerPolicyRedirectURLPrototype`to + specify a URL to redirect to. """ @@ -62045,7 +64826,9 @@ class LoadBalancerListenerPrototypeLoadBalancerContext: :param CertificateInstanceIdentity certificate_instance: (optional) The certificate instance to use for SSL termination. The listener must have a `protocol` of `https`. - :param int connection_limit: (optional) The connection limit of the listener. + :param int connection_limit: (optional) The concurrent connection limit for the + listener. If reached, incoming connections may be queued or rejected. + This property will be present for load balancers in the `application` family. :param LoadBalancerPoolIdentityByName default_pool: (optional) The default pool for this listener. If `https_redirect` is specified, the default pool will not be used. If specified, the pool must: @@ -62062,8 +64845,8 @@ class LoadBalancerListenerPrototypeLoadBalancerContext: If specified, this listener must have a `protocol` of `http`, and the target listener must have a `protocol` of `https`. :param int idle_connection_timeout: (optional) The idle connection timeout of - the listener in seconds. Supported for load balancers in the `application` - family. + the listener in seconds. + Supported for load balancers in the `application` family. :param int port: (optional) The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. @@ -62142,8 +64925,10 @@ def __init__( :param CertificateInstanceIdentity certificate_instance: (optional) The certificate instance to use for SSL termination. The listener must have a `protocol` of `https`. - :param int connection_limit: (optional) The connection limit of the - listener. + :param int connection_limit: (optional) The concurrent connection limit for + the listener. If reached, incoming connections may be queued or rejected. + This property will be present for load balancers in the `application` + family. :param LoadBalancerPoolIdentityByName default_pool: (optional) The default pool for this listener. If `https_redirect` is specified, the default pool will not be used. If specified, the pool must: @@ -62162,8 +64947,8 @@ def __init__( target listener must have a `protocol` of `https`. :param int idle_connection_timeout: (optional) The idle connection timeout - of the listener in seconds. Supported for load balancers in the - `application` family. + of the listener in seconds. + Supported for load balancers in the `application` family. :param int port: (optional) The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. @@ -63244,13 +66029,9 @@ class LoadBalancerPoolHealthMonitor: The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - :param object url: (optional) The health check URL path, in the format of an + :param str url_path: (optional) The health check URL path, in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). If `type` is `tcp`, this property will be absent. - :param str url_path: (optional) The health check URL path. If specified, `type` - must be `http` or `https`. - Must be in the format of an [origin-form request - target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ def __init__( @@ -63261,7 +66042,6 @@ def __init__( type: str, *, port: Optional[int] = None, - url: Optional[object] = None, url_path: Optional[str] = None, ) -> None: """ @@ -63276,21 +66056,16 @@ def __init__( future. :param int port: (optional) The health check port. If present, this overrides the pool member port values. - :param object url: (optional) The health check URL path, in the format of + :param str url_path: (optional) The health check URL path, in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). If `type` is `tcp`, this property will be absent. - :param str url_path: (optional) The health check URL path. If specified, - `type` must be `http` or `https`. - Must be in the format of an [origin-form request - target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ self.delay = delay self.max_retries = max_retries self.port = port self.timeout = timeout self.type = type - self.url = url self.url_path = url_path @classmethod @@ -63315,8 +66090,6 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitor': args['type'] = type else: raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitor JSON') - if (url := _dict.get('url')) is not None: - args['url'] = url if (url_path := _dict.get('url_path')) is not None: args['url_path'] = url_path return cls(**args) @@ -63339,8 +66112,6 @@ def to_dict(self) -> Dict: _dict['timeout'] = self.timeout if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'url') and self.url is not None: - _dict['url'] = self.url if hasattr(self, 'url_path') and self.url_path is not None: _dict['url_path'] = self.url_path return _dict @@ -64329,7 +67100,9 @@ class LoadBalancerPoolPatch: """ LoadBalancerPoolPatch. - :param str algorithm: (optional) The load balancing algorithm. + :param str algorithm: (optional) The load balancing algorithm. The + `least_connections` algorithm is only supported for load balancers that have + `availability` with value `subnet` in the profile. :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The health monitor of this pool. :param str name: (optional) The name for this load balancer pool. The name must @@ -64364,7 +67137,9 @@ def __init__( """ Initialize a LoadBalancerPoolPatch object. - :param str algorithm: (optional) The load balancing algorithm. + :param str algorithm: (optional) The load balancing algorithm. The + `least_connections` algorithm is only supported for load balancers that + have `availability` with value `subnet` in the profile. :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The health monitor of this pool. :param str name: (optional) The name for this load balancer pool. The name @@ -64460,7 +67235,8 @@ def __ne__(self, other: 'LoadBalancerPoolPatch') -> bool: class AlgorithmEnum(str, Enum): """ - The load balancing algorithm. + The load balancing algorithm. The `least_connections` algorithm is only supported + for load balancers that have `availability` with value `subnet` in the profile. """ LEAST_CONNECTIONS = 'least_connections' @@ -65396,12 +68172,11 @@ class LoadBalancerProfileCollection: """ LoadBalancerProfileCollection. - :param LoadBalancerProfileCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param LoadBalancerProfileCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[LoadBalancerProfile] profiles: A page of load balancer profiles. :param int total_count: The total number of resources across all pages. @@ -65409,25 +68184,24 @@ class LoadBalancerProfileCollection: def __init__( self, - first: 'LoadBalancerProfileCollectionFirst', + first: 'PageLink', limit: int, profiles: List['LoadBalancerProfile'], total_count: int, *, - next: Optional['LoadBalancerProfileCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a LoadBalancerProfileCollection object. - :param LoadBalancerProfileCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[LoadBalancerProfile] profiles: A page of load balancer profiles. :param int total_count: The total number of resources across all pages. - :param LoadBalancerProfileCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -65441,7 +68215,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollection': """Initialize a LoadBalancerProfileCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = LoadBalancerProfileCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in LoadBalancerProfileCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -65449,7 +68223,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollection': else: raise ValueError('Required property \'limit\' not present in LoadBalancerProfileCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = LoadBalancerProfileCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (profiles := _dict.get('profiles')) is not None: args['profiles'] = [LoadBalancerProfile.from_dict(v) for v in profiles] else: @@ -65511,125 +68285,6 @@ def __ne__(self, other: 'LoadBalancerProfileCollection') -> bool: return not self == other -class LoadBalancerProfileCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a LoadBalancerProfileCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionFirst': - """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileCollectionFirst 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 LoadBalancerProfileCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'LoadBalancerProfileCollectionFirst') -> 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: 'LoadBalancerProfileCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class LoadBalancerProfileCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a LoadBalancerProfileCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionNext': - """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileCollectionNext 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 LoadBalancerProfileCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'LoadBalancerProfileCollectionNext') -> 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: 'LoadBalancerProfileCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class LoadBalancerProfileIdentity: """ Identifies a load balancer profile by a unique property. @@ -66311,36 +68966,35 @@ class NetworkACLCollection: """ NetworkACLCollection. - :param NetworkACLCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[NetworkACL] network_acls: A page of network ACLs. - :param NetworkACLCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'NetworkACLCollectionFirst', + first: 'PageLink', limit: int, network_acls: List['NetworkACL'], total_count: int, *, - next: Optional['NetworkACLCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a NetworkACLCollection object. - :param NetworkACLCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[NetworkACL] network_acls: A page of network ACLs. :param int total_count: The total number of resources across all pages. - :param NetworkACLCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -66354,7 +69008,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection': """Initialize a NetworkACLCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = NetworkACLCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in NetworkACLCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -66366,7 +69020,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection': else: raise ValueError('Required property \'network_acls\' not present in NetworkACLCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = NetworkACLCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -66424,125 +69078,6 @@ def __ne__(self, other: 'NetworkACLCollection') -> bool: return not self == other -class NetworkACLCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a NetworkACLCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionFirst': - """Initialize a NetworkACLCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in NetworkACLCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkACLCollectionFirst 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 NetworkACLCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkACLCollectionFirst') -> 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: 'NetworkACLCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class NetworkACLCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a NetworkACLCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionNext': - """Initialize a NetworkACLCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in NetworkACLCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkACLCollectionNext 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 NetworkACLCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkACLCollectionNext') -> 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: 'NetworkACLCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class NetworkACLIdentity: """ Identifies a network ACL by a unique property. @@ -66945,12 +69480,11 @@ class NetworkACLRuleCollection: """ NetworkACLRuleCollection. - :param NetworkACLRuleCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param NetworkACLRuleCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[NetworkACLRuleItem] rules: A page of ordered rules (sorted based on the `before` property) for the network ACL. @@ -66959,25 +69493,24 @@ class NetworkACLRuleCollection: def __init__( self, - first: 'NetworkACLRuleCollectionFirst', + first: 'PageLink', limit: int, rules: List['NetworkACLRuleItem'], total_count: int, *, - next: Optional['NetworkACLRuleCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a NetworkACLRuleCollection object. - :param NetworkACLRuleCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[NetworkACLRuleItem] rules: A page of ordered rules (sorted based on the `before` property) for the network ACL. :param int total_count: The total number of resources across all pages. - :param NetworkACLRuleCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -66991,7 +69524,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollection': """Initialize a NetworkACLRuleCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = NetworkACLRuleCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in NetworkACLRuleCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -66999,7 +69532,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollection': else: raise ValueError('Required property \'limit\' not present in NetworkACLRuleCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = NetworkACLRuleCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (rules := _dict.get('rules')) is not None: args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in rules] else: @@ -67061,125 +69594,6 @@ def __ne__(self, other: 'NetworkACLRuleCollection') -> bool: return not self == other -class NetworkACLRuleCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a NetworkACLRuleCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionFirst': - """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleCollectionFirst 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 NetworkACLRuleCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkACLRuleCollectionFirst') -> 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: 'NetworkACLRuleCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class NetworkACLRuleCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a NetworkACLRuleCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionNext': - """Initialize a NetworkACLRuleCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleCollectionNext 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 NetworkACLRuleCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkACLRuleCollectionNext') -> 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: 'NetworkACLRuleCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class NetworkACLRuleItem: """ NetworkACLRuleItem. @@ -69042,12 +71456,11 @@ class OperatingSystemCollection: """ OperatingSystemCollection. - :param OperatingSystemCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param OperatingSystemCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[OperatingSystem] operating_systems: A page of operating systems. :param int total_count: The total number of resources across all pages. @@ -69055,25 +71468,24 @@ class OperatingSystemCollection: def __init__( self, - first: 'OperatingSystemCollectionFirst', + first: 'PageLink', limit: int, operating_systems: List['OperatingSystem'], total_count: int, *, - next: Optional['OperatingSystemCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a OperatingSystemCollection object. - :param OperatingSystemCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[OperatingSystem] operating_systems: A page of operating systems. :param int total_count: The total number of resources across all pages. - :param OperatingSystemCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -69087,7 +71499,7 @@ def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection': """Initialize a OperatingSystemCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = OperatingSystemCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in OperatingSystemCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -69095,7 +71507,7 @@ def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection': else: raise ValueError('Required property \'limit\' not present in OperatingSystemCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = OperatingSystemCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (operating_systems := _dict.get('operating_systems')) is not None: args['operating_systems'] = [OperatingSystem.from_dict(v) for v in operating_systems] else: @@ -69157,69 +71569,28 @@ def __ne__(self, other: 'OperatingSystemCollection') -> bool: return not self == other -class OperatingSystemCollectionFirst: +class OperatingSystemIdentity: """ - A link to the first page of resources. + Identifies an operating system by a unique property. - :param str href: The URL for a page of resources. """ def __init__( self, - href: str, ) -> None: """ - Initialize a OperatingSystemCollectionFirst object. + Initialize a OperatingSystemIdentity object. - :param str href: The URL for a page of resources. """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionFirst': - """Initialize a OperatingSystemCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in OperatingSystemCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a OperatingSystemCollectionFirst 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 OperatingSystemCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'OperatingSystemCollectionFirst') -> 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: 'OperatingSystemCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['OperatingSystemIdentityByName', 'OperatingSystemIdentityByHref']) + ) + raise Exception(msg) -class OperatingSystemCollectionNext: +class PageLink: """ - A link to the next page of resources. This property is present for all pages except - the last page. + PageLink. :param str href: The URL for a page of resources. """ @@ -69229,25 +71600,25 @@ def __init__( href: str, ) -> None: """ - Initialize a OperatingSystemCollectionNext object. + Initialize a PageLink object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionNext': - """Initialize a OperatingSystemCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PageLink': + """Initialize a PageLink object from a json dictionary.""" args = {} if (href := _dict.get('href')) is not None: args['href'] = href else: - raise ValueError('Required property \'href\' not present in OperatingSystemCollectionNext JSON') + raise ValueError('Required property \'href\' not present in PageLink JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystemCollectionNext object from a json dictionary.""" + """Initialize a PageLink object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -69262,39 +71633,20 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystemCollectionNext object.""" + """Return a `str` version of this PageLink object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystemCollectionNext') -> bool: + def __eq__(self, other: 'PageLink') -> 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: 'OperatingSystemCollectionNext') -> bool: + def __ne__(self, other: 'PageLink') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class OperatingSystemIdentity: - """ - Identifies an operating system by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a OperatingSystemIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['OperatingSystemIdentityByName', 'OperatingSystemIdentityByHref']) - ) - raise Exception(msg) - - class PlacementGroup: """ PlacementGroup. @@ -69493,12 +71845,11 @@ class PlacementGroupCollection: """ PlacementGroupCollection. - :param PlacementGroupCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param PlacementGroupCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[PlacementGroup] placement_groups: A page of placement groups. :param int total_count: The total number of resources across all pages. @@ -69506,24 +71857,23 @@ class PlacementGroupCollection: def __init__( self, - first: 'PlacementGroupCollectionFirst', + first: 'PageLink', limit: int, placement_groups: List['PlacementGroup'], total_count: int, *, - next: Optional['PlacementGroupCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a PlacementGroupCollection object. - :param PlacementGroupCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[PlacementGroup] placement_groups: A page of placement groups. :param int total_count: The total number of resources across all pages. - :param PlacementGroupCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -69537,7 +71887,7 @@ def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollection': """Initialize a PlacementGroupCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = PlacementGroupCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in PlacementGroupCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -69545,7 +71895,7 @@ def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollection': else: raise ValueError('Required property \'limit\' not present in PlacementGroupCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = PlacementGroupCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (placement_groups := _dict.get('placement_groups')) is not None: args['placement_groups'] = [PlacementGroup.from_dict(v) for v in placement_groups] else: @@ -69607,125 +71957,6 @@ def __ne__(self, other: 'PlacementGroupCollection') -> bool: return not self == other -class PlacementGroupCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PlacementGroupCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionFirst': - """Initialize a PlacementGroupCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PlacementGroupCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PlacementGroupCollectionFirst 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 PlacementGroupCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PlacementGroupCollectionFirst') -> 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: 'PlacementGroupCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class PlacementGroupCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PlacementGroupCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionNext': - """Initialize a PlacementGroupCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PlacementGroupCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PlacementGroupCollectionNext 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 PlacementGroupCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PlacementGroupCollectionNext') -> 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: 'PlacementGroupCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class PlacementGroupPatch: """ PlacementGroupPatch. @@ -70260,12 +72491,11 @@ class PrivatePathServiceGatewayAccountPolicyCollection: :param List[PrivatePathServiceGatewayAccountPolicy] account_policies: A page of account policies for the private path service gateway. - :param PrivatePathServiceGatewayAccountPolicyCollectionFirst first: A link to - the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param PrivatePathServiceGatewayAccountPolicyCollectionNext next: (optional) A - link to the next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -70273,25 +72503,23 @@ class PrivatePathServiceGatewayAccountPolicyCollection: def __init__( self, account_policies: List['PrivatePathServiceGatewayAccountPolicy'], - first: 'PrivatePathServiceGatewayAccountPolicyCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['PrivatePathServiceGatewayAccountPolicyCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a PrivatePathServiceGatewayAccountPolicyCollection object. :param List[PrivatePathServiceGatewayAccountPolicy] account_policies: A page of account policies for the private path service gateway. - :param PrivatePathServiceGatewayAccountPolicyCollectionFirst first: A link - to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param PrivatePathServiceGatewayAccountPolicyCollectionNext next: - (optional) A link to the next page of resources. This property is present - for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.account_policies = account_policies @@ -70309,7 +72537,7 @@ def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayAccountPolicyCollec else: raise ValueError('Required property \'account_policies\' not present in PrivatePathServiceGatewayAccountPolicyCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = PrivatePathServiceGatewayAccountPolicyCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in PrivatePathServiceGatewayAccountPolicyCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -70317,7 +72545,7 @@ def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayAccountPolicyCollec else: raise ValueError('Required property \'limit\' not present in PrivatePathServiceGatewayAccountPolicyCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = PrivatePathServiceGatewayAccountPolicyCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -70375,125 +72603,6 @@ def __ne__(self, other: 'PrivatePathServiceGatewayAccountPolicyCollection') -> b return not self == other -class PrivatePathServiceGatewayAccountPolicyCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PrivatePathServiceGatewayAccountPolicyCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayAccountPolicyCollectionFirst': - """Initialize a PrivatePathServiceGatewayAccountPolicyCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PrivatePathServiceGatewayAccountPolicyCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PrivatePathServiceGatewayAccountPolicyCollectionFirst 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 PrivatePathServiceGatewayAccountPolicyCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PrivatePathServiceGatewayAccountPolicyCollectionFirst') -> 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: 'PrivatePathServiceGatewayAccountPolicyCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class PrivatePathServiceGatewayAccountPolicyCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PrivatePathServiceGatewayAccountPolicyCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayAccountPolicyCollectionNext': - """Initialize a PrivatePathServiceGatewayAccountPolicyCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PrivatePathServiceGatewayAccountPolicyCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PrivatePathServiceGatewayAccountPolicyCollectionNext 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 PrivatePathServiceGatewayAccountPolicyCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PrivatePathServiceGatewayAccountPolicyCollectionNext') -> 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: 'PrivatePathServiceGatewayAccountPolicyCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class PrivatePathServiceGatewayAccountPolicyPatch: """ PrivatePathServiceGatewayAccountPolicyPatch. @@ -70603,12 +72712,11 @@ class PrivatePathServiceGatewayCollection: """ PrivatePathServiceGatewayCollection. - :param PrivatePathServiceGatewayCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param PrivatePathServiceGatewayCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[PrivatePathServiceGateway] private_path_service_gateways: A page of private path service gateways. @@ -70617,25 +72725,24 @@ class PrivatePathServiceGatewayCollection: def __init__( self, - first: 'PrivatePathServiceGatewayCollectionFirst', + first: 'PageLink', limit: int, private_path_service_gateways: List['PrivatePathServiceGateway'], total_count: int, *, - next: Optional['PrivatePathServiceGatewayCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a PrivatePathServiceGatewayCollection object. - :param PrivatePathServiceGatewayCollectionFirst first: A link to the first - page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[PrivatePathServiceGateway] private_path_service_gateways: A page of private path service gateways. :param int total_count: The total number of resources across all pages. - :param PrivatePathServiceGatewayCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -70649,7 +72756,7 @@ def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayCollection': """Initialize a PrivatePathServiceGatewayCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = PrivatePathServiceGatewayCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in PrivatePathServiceGatewayCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -70657,7 +72764,7 @@ def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayCollection': else: raise ValueError('Required property \'limit\' not present in PrivatePathServiceGatewayCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = PrivatePathServiceGatewayCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (private_path_service_gateways := _dict.get('private_path_service_gateways')) is not None: args['private_path_service_gateways'] = [PrivatePathServiceGateway.from_dict(v) for v in private_path_service_gateways] else: @@ -70719,125 +72826,6 @@ def __ne__(self, other: 'PrivatePathServiceGatewayCollection') -> bool: return not self == other -class PrivatePathServiceGatewayCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PrivatePathServiceGatewayCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayCollectionFirst': - """Initialize a PrivatePathServiceGatewayCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PrivatePathServiceGatewayCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PrivatePathServiceGatewayCollectionFirst 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 PrivatePathServiceGatewayCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PrivatePathServiceGatewayCollectionFirst') -> 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: 'PrivatePathServiceGatewayCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class PrivatePathServiceGatewayCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PrivatePathServiceGatewayCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayCollectionNext': - """Initialize a PrivatePathServiceGatewayCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PrivatePathServiceGatewayCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PrivatePathServiceGatewayCollectionNext 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 PrivatePathServiceGatewayCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PrivatePathServiceGatewayCollectionNext') -> 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: 'PrivatePathServiceGatewayCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class PrivatePathServiceGatewayEndpointGatewayBinding: """ PrivatePathServiceGatewayEndpointGatewayBinding. @@ -71054,13 +73042,11 @@ class PrivatePathServiceGatewayEndpointGatewayBindingCollection: :param List[PrivatePathServiceGatewayEndpointGatewayBinding] endpoint_gateway_bindings: A page of endpoint gateway bindings for the private path service gateway. - :param PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst first: A - link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext next: - (optional) A link to the next page of resources. This property is present for - all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -71068,11 +73054,11 @@ class PrivatePathServiceGatewayEndpointGatewayBindingCollection: def __init__( self, endpoint_gateway_bindings: List['PrivatePathServiceGatewayEndpointGatewayBinding'], - first: 'PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a PrivatePathServiceGatewayEndpointGatewayBindingCollection object. @@ -71080,14 +73066,12 @@ def __init__( :param List[PrivatePathServiceGatewayEndpointGatewayBinding] endpoint_gateway_bindings: A page of endpoint gateway bindings for the private path service gateway. - :param PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst - first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext next: - (optional) A link to the next page of resources. This property is present - for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.endpoint_gateway_bindings = endpoint_gateway_bindings @@ -71105,7 +73089,7 @@ def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayEndpointGatewayBind else: raise ValueError('Required property \'endpoint_gateway_bindings\' not present in PrivatePathServiceGatewayEndpointGatewayBindingCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in PrivatePathServiceGatewayEndpointGatewayBindingCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -71113,7 +73097,7 @@ def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayEndpointGatewayBind else: raise ValueError('Required property \'limit\' not present in PrivatePathServiceGatewayEndpointGatewayBindingCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -71171,125 +73155,6 @@ def __ne__(self, other: 'PrivatePathServiceGatewayEndpointGatewayBindingCollecti return not self == other -class PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst': - """Initialize a PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst 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 PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst') -> 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: 'PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext': - """Initialize a PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext 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 PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext') -> 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: 'PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class PrivatePathServiceGatewayPatch: """ PrivatePathServiceGatewayPatch. @@ -71696,12 +73561,11 @@ class PublicGatewayCollection: """ PublicGatewayCollection. - :param PublicGatewayCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param PublicGatewayCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[PublicGateway] public_gateways: A page of public gateways. :param int total_count: The total number of resources across all pages. @@ -71709,24 +73573,23 @@ class PublicGatewayCollection: def __init__( self, - first: 'PublicGatewayCollectionFirst', + first: 'PageLink', limit: int, public_gateways: List['PublicGateway'], total_count: int, *, - next: Optional['PublicGatewayCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a PublicGatewayCollection object. - :param PublicGatewayCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[PublicGateway] public_gateways: A page of public gateways. :param int total_count: The total number of resources across all pages. - :param PublicGatewayCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -71740,7 +73603,7 @@ def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollection': """Initialize a PublicGatewayCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = PublicGatewayCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in PublicGatewayCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -71748,7 +73611,7 @@ def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollection': else: raise ValueError('Required property \'limit\' not present in PublicGatewayCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = PublicGatewayCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (public_gateways := _dict.get('public_gateways')) is not None: args['public_gateways'] = [PublicGateway.from_dict(v) for v in public_gateways] else: @@ -71810,125 +73673,6 @@ def __ne__(self, other: 'PublicGatewayCollection') -> bool: return not self == other -class PublicGatewayCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PublicGatewayCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionFirst': - """Initialize a PublicGatewayCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PublicGatewayCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PublicGatewayCollectionFirst 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 PublicGatewayCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PublicGatewayCollectionFirst') -> 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: 'PublicGatewayCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class PublicGatewayCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a PublicGatewayCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionNext': - """Initialize a PublicGatewayCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in PublicGatewayCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a PublicGatewayCollectionNext 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 PublicGatewayCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'PublicGatewayCollectionNext') -> 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: 'PublicGatewayCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class PublicGatewayFloatingIPPrototype: """ PublicGatewayFloatingIPPrototype. @@ -72843,9 +74587,9 @@ class ReservationCapacity: - `allocated`: The total capacity of the reservation has been allocated for use - `degraded`: The capacity reservation has been allocated for use, but some of the - capacity is not available. - See https://cloud.ibm.com/docs/vpc?topic=vpc-capacity-status for more - information. + capacity is not available. See [capacity status + reasons](https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons) + for more information. - `unallocated`: The capacity reservation is not allocated for use The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the @@ -72875,9 +74619,9 @@ def __init__( use - `degraded`: The capacity reservation has been allocated for use, but some of the - capacity is not available. - See https://cloud.ibm.com/docs/vpc?topic=vpc-capacity-status for more - information. + capacity is not available. See [capacity status + reasons](https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons) + for more information. - `unallocated`: The capacity reservation is not allocated for use The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the @@ -72962,9 +74706,9 @@ class StatusEnum(str, Enum): - `allocating`: The capacity reservation is being allocated for use - `allocated`: The total capacity of the reservation has been allocated for use - `degraded`: The capacity reservation has been allocated for use, but some of the - capacity is not available. - See https://cloud.ibm.com/docs/vpc?topic=vpc-capacity-status for more - information. + capacity is not available. See [capacity status + reasons](https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons) + for more information. - `unallocated`: The capacity reservation is not allocated for use The enumerated values for this property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the @@ -73102,11 +74846,11 @@ class ReservationCollection: """ ReservationCollection. - :param ReservationCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param ReservationCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[Reservation] reservations: A page of reservations. :param int total_count: The total number of resources across all pages. @@ -73114,24 +74858,23 @@ class ReservationCollection: def __init__( self, - first: 'ReservationCollectionFirst', + first: 'PageLink', limit: int, reservations: List['Reservation'], total_count: int, *, - next: Optional['ReservationCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a ReservationCollection object. - :param ReservationCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[Reservation] reservations: A page of reservations. :param int total_count: The total number of resources across all pages. - :param ReservationCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -73145,7 +74888,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservationCollection': """Initialize a ReservationCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = ReservationCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in ReservationCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -73153,7 +74896,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservationCollection': else: raise ValueError('Required property \'limit\' not present in ReservationCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = ReservationCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (reservations := _dict.get('reservations')) is not None: args['reservations'] = [Reservation.from_dict(v) for v in reservations] else: @@ -73215,125 +74958,6 @@ def __ne__(self, other: 'ReservationCollection') -> bool: return not self == other -class ReservationCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservationCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservationCollectionFirst': - """Initialize a ReservationCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservationCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservationCollectionFirst 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 ReservationCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservationCollectionFirst') -> 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: 'ReservationCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservationCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservationCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservationCollectionNext': - """Initialize a ReservationCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservationCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservationCollectionNext 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 ReservationCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservationCollectionNext') -> 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: 'ReservationCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ReservationCommittedUse: """ The committed use reservation configuration. @@ -74269,6 +75893,9 @@ class ReservedIP: :param ReservedIPTarget target: (optional) The target this reserved IP is bound to. If absent, this reserved IP is provider-owned or unbound. + The resources supported by this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ def __init__( @@ -74311,6 +75938,9 @@ def __init__( :param ReservedIPTarget target: (optional) The target this reserved IP is bound to. If absent, this reserved IP is provider-owned or unbound. + The resources supported by this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. """ self.address = address self.auto_delete = auto_delete @@ -74457,11 +76087,11 @@ class ReservedIPCollection: """ ReservedIPCollection. - :param ReservedIPCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param ReservedIPCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[ReservedIP] reserved_ips: A page of reserved IPs in the subnet. :param int total_count: The total number of resources across all pages. @@ -74469,24 +76099,23 @@ class ReservedIPCollection: def __init__( self, - first: 'ReservedIPCollectionFirst', + first: 'PageLink', limit: int, reserved_ips: List['ReservedIP'], total_count: int, *, - next: Optional['ReservedIPCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a ReservedIPCollection object. - :param ReservedIPCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[ReservedIP] reserved_ips: A page of reserved IPs in the subnet. :param int total_count: The total number of resources across all pages. - :param ReservedIPCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -74500,7 +76129,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollection': """Initialize a ReservedIPCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = ReservedIPCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in ReservedIPCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -74508,7 +76137,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollection': else: raise ValueError('Required property \'limit\' not present in ReservedIPCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = ReservedIPCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (reserved_ips := _dict.get('reserved_ips')) is not None: args['reserved_ips'] = [ReservedIP.from_dict(v) for v in reserved_ips] else: @@ -74541,553 +76170,14 @@ def to_dict(self) -> Dict: _dict['next'] = self.next.to_dict() if hasattr(self, 'reserved_ips') and self.reserved_ips is not None: reserved_ips_list = [] - for v in self.reserved_ips: - if isinstance(v, dict): - reserved_ips_list.append(v) - else: - reserved_ips_list.append(v.to_dict()) - _dict['reserved_ips'] = reserved_ips_list - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count - 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 ReservedIPCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollection') -> 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: 'ReservedIPCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionBareMetalServerNetworkInterfaceContext: - """ - ReservedIPCollectionBareMetalServerNetworkInterfaceContext. - - :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst first: A - link to the first page of resources. - :param List[ReservedIP] ips: A page of reserved IPs bound to the bare metal - server network interface. - :param int limit: The maximum number of resources that can be returned by the - request. - :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext next: - (optional) A link to the next page of resources. This property is present for - all pages - except the last page. - :param int total_count: The total number of resources across all pages. - """ - - def __init__( - self, - first: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst', - ips: List['ReservedIP'], - limit: int, - total_count: int, - *, - next: Optional['ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext'] = None, - ) -> None: - """ - Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object. - - :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst - first: A link to the first page of resources. - :param List[ReservedIP] ips: A page of reserved IPs bound to the bare metal - server network interface. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext next: - (optional) A link to the next page of resources. This property is present - for all pages - except the last page. - """ - self.first = first - self.ips = ips - self.limit = limit - self.next = next - self.total_count = total_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext': - """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object from a json dictionary.""" - args = {} - if (first := _dict.get('first')) is not None: - args['first'] = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(first) - else: - raise ValueError('Required property \'first\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') - if (ips := _dict.get('ips')) is not None: - args['ips'] = [ReservedIP.from_dict(v) for v in ips] - else: - raise ValueError('Required property \'ips\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - else: - raise ValueError('Required property \'limit\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') - if (next := _dict.get('next')) is not None: - args['next'] = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(next) - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count - else: - raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'ips') and self.ips is not None: - ips_list = [] - for v in self.ips: - if isinstance(v, dict): - ips_list.append(v) - else: - ips_list.append(v.to_dict()) - _dict['ips'] = ips_list - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count - 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> 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: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst': - """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst') -> 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: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext': - """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext') -> 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: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionEndpointGatewayContext: - """ - ReservedIPCollectionEndpointGatewayContext. - - :param ReservedIPCollectionEndpointGatewayContextFirst first: A link to the - first page of resources. - :param List[ReservedIP] ips: A page of reserved IPs bound to the endpoint - gateway. - :param int limit: The maximum number of resources that can be returned by the - request. - :param ReservedIPCollectionEndpointGatewayContextNext next: (optional) A link to - the next page of resources. This property is present for all pages - except the last page. - :param int total_count: The total number of resources across all pages. - """ - - def __init__( - self, - first: 'ReservedIPCollectionEndpointGatewayContextFirst', - ips: List['ReservedIP'], - limit: int, - total_count: int, - *, - next: Optional['ReservedIPCollectionEndpointGatewayContextNext'] = None, - ) -> None: - """ - Initialize a ReservedIPCollectionEndpointGatewayContext object. - - :param ReservedIPCollectionEndpointGatewayContextFirst first: A link to the - first page of resources. - :param List[ReservedIP] ips: A page of reserved IPs bound to the endpoint - gateway. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param ReservedIPCollectionEndpointGatewayContextNext next: (optional) A - link to the next page of resources. This property is present for all pages - except the last page. - """ - self.first = first - self.ips = ips - self.limit = limit - self.next = next - self.total_count = total_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContext': - """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary.""" - args = {} - if (first := _dict.get('first')) is not None: - args['first'] = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(first) - else: - raise ValueError('Required property \'first\' not present in ReservedIPCollectionEndpointGatewayContext JSON') - if (ips := _dict.get('ips')) is not None: - args['ips'] = [ReservedIP.from_dict(v) for v in ips] - else: - raise ValueError('Required property \'ips\' not present in ReservedIPCollectionEndpointGatewayContext JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - else: - raise ValueError('Required property \'limit\' not present in ReservedIPCollectionEndpointGatewayContext JSON') - if (next := _dict.get('next')) is not None: - args['next'] = ReservedIPCollectionEndpointGatewayContextNext.from_dict(next) - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count - else: - raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionEndpointGatewayContext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionEndpointGatewayContext 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'ips') and self.ips is not None: - ips_list = [] - for v in self.ips: - if isinstance(v, dict): - ips_list.append(v) - else: - ips_list.append(v.to_dict()) - _dict['ips'] = ips_list - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count - 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 ReservedIPCollectionEndpointGatewayContext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> 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: 'ReservedIPCollectionEndpointGatewayContext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionEndpointGatewayContextFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservedIPCollectionEndpointGatewayContextFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextFirst': - """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionEndpointGatewayContextFirst 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 ReservedIPCollectionEndpointGatewayContextFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> 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: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionEndpointGatewayContextNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservedIPCollectionEndpointGatewayContextNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextNext': - """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionEndpointGatewayContextNext 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 ReservedIPCollectionEndpointGatewayContextNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextNext') -> 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: 'ReservedIPCollectionEndpointGatewayContextNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservedIPCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionFirst': - """Initialize a ReservedIPCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionFirst 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 + for v in self.reserved_ips: + if isinstance(v, dict): + reserved_ips_list.append(v) + else: + reserved_ips_list.append(v.to_dict()) + _dict['reserved_ips'] = reserved_ips_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -75095,58 +76185,55 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionFirst object.""" + """Return a `str` version of this ReservedIPCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionFirst') -> bool: + def __eq__(self, other: 'ReservedIPCollection') -> 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: 'ReservedIPCollectionFirst') -> bool: + def __ne__(self, other: 'ReservedIPCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionInstanceNetworkInterfaceContext: +class ReservedIPCollectionBareMetalServerNetworkInterfaceContext: """ - ReservedIPCollectionInstanceNetworkInterfaceContext. + ReservedIPCollectionBareMetalServerNetworkInterfaceContext. - :param ReservedIPCollectionInstanceNetworkInterfaceContextFirst first: A link to - the first page of resources. - :param List[ReservedIP] ips: A page of reserved IPs bound to the instance - network interface. + :param PageLink first: A link to the first page of resources. + :param List[ReservedIP] ips: A page of reserved IPs bound to the bare metal + server network interface. :param int limit: The maximum number of resources that can be returned by the request. - :param ReservedIPCollectionInstanceNetworkInterfaceContextNext next: (optional) - A link to the next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst', + first: 'PageLink', ips: List['ReservedIP'], limit: int, total_count: int, *, - next: Optional['ReservedIPCollectionInstanceNetworkInterfaceContextNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object. + Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object. - :param ReservedIPCollectionInstanceNetworkInterfaceContextFirst first: A - link to the first page of resources. - :param List[ReservedIP] ips: A page of reserved IPs bound to the instance - network interface. + :param PageLink first: A link to the first page of resources. + :param List[ReservedIP] ips: A page of reserved IPs bound to the bare metal + server network interface. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param ReservedIPCollectionInstanceNetworkInterfaceContextNext next: - (optional) A link to the next page of resources. This property is present - for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -75156,32 +76243,32 @@ def __init__( self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContext': - """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext': + """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'first\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + raise ValueError('Required property \'first\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') if (ips := _dict.get('ips')) is not None: args['ips'] = [ReservedIP.from_dict(v) for v in ips] else: - raise ValueError('Required property \'ips\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + raise ValueError('Required property \'ips\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') if (limit := _dict.get('limit')) is not None: args['limit'] = limit else: - raise ValueError('Required property \'limit\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + raise ValueError('Required property \'limit\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') if (next := _dict.get('next')) is not None: - args['next'] = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: - raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object from a json dictionary.""" + """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -75216,118 +76303,117 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContext object.""" + """Return a `str` version of this ReservedIPCollectionBareMetalServerNetworkInterfaceContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> bool: + def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> 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: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> bool: + def __ne__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionInstanceNetworkInterfaceContextFirst: +class ReservedIPCollectionEndpointGatewayContext: """ - A link to the first page of resources. + ReservedIPCollectionEndpointGatewayContext. - :param str href: The URL for a page of resources. + :param PageLink first: A link to the first page of resources. + :param List[ReservedIP] ips: A page of reserved IPs bound to the endpoint + gateway. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. """ def __init__( self, - href: str, + first: 'PageLink', + ips: List['ReservedIP'], + limit: int, + total_count: int, + *, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object. + Initialize a ReservedIPCollectionEndpointGatewayContext object. - :param str href: The URL for a page of resources. + :param PageLink first: A link to the first page of resources. + :param List[ReservedIP] ips: A page of reserved IPs bound to the endpoint + gateway. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ - self.href = href + self.first = first + self.ips = ips + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst': - """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContext': + """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionInstanceNetworkInterfaceContextFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst 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 ReservedIPCollectionInstanceNetworkInterfaceContextFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst') -> 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: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionInstanceNetworkInterfaceContextNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContextNext': - """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + raise ValueError('Required property \'first\' not present in ReservedIPCollectionEndpointGatewayContext JSON') + if (ips := _dict.get('ips')) is not None: + args['ips'] = [ReservedIP.from_dict(v) for v in ips] + else: + raise ValueError('Required property \'ips\' not present in ReservedIPCollectionEndpointGatewayContext JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in ReservedIPCollectionEndpointGatewayContext JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionInstanceNetworkInterfaceContextNext JSON') + raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionEndpointGatewayContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object from a json dictionary.""" + """Initialize a ReservedIPCollectionEndpointGatewayContext 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, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'ips') and self.ips is not None: + ips_list = [] + for v in self.ips: + if isinstance(v, dict): + ips_list.append(v) + else: + ips_list.append(v.to_dict()) + _dict['ips'] = ips_list + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -75335,59 +76421,117 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContextNext object.""" + """Return a `str` version of this ReservedIPCollectionEndpointGatewayContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext') -> bool: + def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> 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: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext') -> bool: + def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionNext: +class ReservedIPCollectionInstanceNetworkInterfaceContext: """ - A link to the next page of resources. This property is present for all pages except - the last page. + ReservedIPCollectionInstanceNetworkInterfaceContext. - :param str href: The URL for a page of resources. + :param PageLink first: A link to the first page of resources. + :param List[ReservedIP] ips: A page of reserved IPs bound to the instance + network interface. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param int total_count: The total number of resources across all pages. """ def __init__( self, - href: str, + first: 'PageLink', + ips: List['ReservedIP'], + limit: int, + total_count: int, + *, + next: Optional['PageLink'] = None, ) -> None: """ - Initialize a ReservedIPCollectionNext object. + Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object. - :param str href: The URL for a page of resources. + :param PageLink first: A link to the first page of resources. + :param List[ReservedIP] ips: A page of reserved IPs bound to the instance + network interface. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. """ - self.href = href + self.first = first + self.ips = ips + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNext': - """Initialize a ReservedIPCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContext': + """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object from a json dictionary.""" args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + if (ips := _dict.get('ips')) is not None: + args['ips'] = [ReservedIP.from_dict(v) for v in ips] + else: + raise ValueError('Required property \'ips\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionNext JSON') + raise ValueError('Required property \'limit\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionNext object from a json dictionary.""" + """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext 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, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'ips') and self.ips is not None: + ips_list = [] + for v in self.ips: + if isinstance(v, dict): + ips_list.append(v) + else: + ips_list.append(v.to_dict()) + _dict['ips'] = ips_list + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -75395,16 +76539,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionNext object.""" + """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionNext') -> bool: + def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> 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: 'ReservedIPCollectionNext') -> bool: + def __ne__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -75413,40 +76557,37 @@ class ReservedIPCollectionVirtualNetworkInterfaceContext: """ ReservedIPCollectionVirtualNetworkInterfaceContext. - :param ReservedIPCollectionVirtualNetworkInterfaceContextFirst first: A link to - the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[ReservedIPReference] ips: A page of reserved IPs bound to the virtual network interface specified by the identifier in the URL. :param int limit: The maximum number of resources that can be returned by the request. - :param ReservedIPCollectionVirtualNetworkInterfaceContextNext next: (optional) A - link to the next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'ReservedIPCollectionVirtualNetworkInterfaceContextFirst', + first: 'PageLink', ips: List['ReservedIPReference'], limit: int, total_count: int, *, - next: Optional['ReservedIPCollectionVirtualNetworkInterfaceContextNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a ReservedIPCollectionVirtualNetworkInterfaceContext object. - :param ReservedIPCollectionVirtualNetworkInterfaceContextFirst first: A - link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param List[ReservedIPReference] ips: A page of reserved IPs bound to the virtual network interface specified by the identifier in the URL. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param ReservedIPCollectionVirtualNetworkInterfaceContextNext next: - (optional) A link to the next page of resources. This property is present - for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -75460,7 +76601,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionVirtualNetworkInterfaceC """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContext object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = ReservedIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in ReservedIPCollectionVirtualNetworkInterfaceContext JSON') if (ips := _dict.get('ips')) is not None: @@ -75472,7 +76613,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionVirtualNetworkInterfaceC else: raise ValueError('Required property \'limit\' not present in ReservedIPCollectionVirtualNetworkInterfaceContext JSON') if (next := _dict.get('next')) is not None: - args['next'] = ReservedIPCollectionVirtualNetworkInterfaceContextNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -75530,125 +76671,6 @@ def __ne__(self, other: 'ReservedIPCollectionVirtualNetworkInterfaceContext') -> return not self == other -class ReservedIPCollectionVirtualNetworkInterfaceContextFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionVirtualNetworkInterfaceContextFirst': - """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionVirtualNetworkInterfaceContextFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextFirst 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 ReservedIPCollectionVirtualNetworkInterfaceContextFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionVirtualNetworkInterfaceContextFirst') -> 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: 'ReservedIPCollectionVirtualNetworkInterfaceContextFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ReservedIPCollectionVirtualNetworkInterfaceContextNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionVirtualNetworkInterfaceContextNext': - """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionVirtualNetworkInterfaceContextNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextNext 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 ReservedIPCollectionVirtualNetworkInterfaceContextNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ReservedIPCollectionVirtualNetworkInterfaceContextNext') -> 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: 'ReservedIPCollectionVirtualNetworkInterfaceContextNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ReservedIPPatch: """ ReservedIPPatch. @@ -75862,6 +76884,8 @@ class ReservedIPTarget: """ The target this reserved IP is bound to. If absent, this reserved IP is provider-owned or unbound. + The resources supported by this property may + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. """ @@ -76356,778 +77380,238 @@ class OriginEnum(str, Enum): -class RouteCollection: - """ - RouteCollection. - - :param RouteCollectionFirst first: A link to the first page of resources. - :param int limit: The maximum number of resources that can be returned by the - request. - :param RouteCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :param List[Route] routes: A page of routes in the routing table. - :param int total_count: The total number of resources across all pages. - """ - - def __init__( - self, - first: 'RouteCollectionFirst', - limit: int, - routes: List['Route'], - total_count: int, - *, - next: Optional['RouteCollectionNext'] = None, - ) -> None: - """ - Initialize a RouteCollection object. - - :param RouteCollectionFirst first: A link to the first page of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[Route] routes: A page of routes in the routing table. - :param int total_count: The total number of resources across all pages. - :param RouteCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - """ - self.first = first - self.limit = limit - self.next = next - self.routes = routes - self.total_count = total_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollection': - """Initialize a RouteCollection object from a json dictionary.""" - args = {} - if (first := _dict.get('first')) is not None: - args['first'] = RouteCollectionFirst.from_dict(first) - else: - raise ValueError('Required property \'first\' not present in RouteCollection JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - else: - raise ValueError('Required property \'limit\' not present in RouteCollection JSON') - if (next := _dict.get('next')) is not None: - args['next'] = RouteCollectionNext.from_dict(next) - if (routes := _dict.get('routes')) is not None: - args['routes'] = [Route.from_dict(v) for v in routes] - else: - raise ValueError('Required property \'routes\' not present in RouteCollection JSON') - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count - else: - raise ValueError('Required property \'total_count\' not present in RouteCollection JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RouteCollection 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'routes') and self.routes is not None: - routes_list = [] - for v in self.routes: - if isinstance(v, dict): - routes_list.append(v) - else: - routes_list.append(v.to_dict()) - _dict['routes'] = routes_list - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count - 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 RouteCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RouteCollection') -> 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: 'RouteCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class RouteCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a RouteCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionFirst': - """Initialize a RouteCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in RouteCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RouteCollectionFirst 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 RouteCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RouteCollectionFirst') -> 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: 'RouteCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class RouteCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a RouteCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionNext': - """Initialize a RouteCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in RouteCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RouteCollectionNext 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 RouteCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RouteCollectionNext') -> 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: 'RouteCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class RouteCollectionVPCContext: - """ - RouteCollectionVPCContext. - - :param RouteCollectionVPCContextFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by the - request. - :param RouteCollectionVPCContextNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :param List[RouteCollectionVPCContextRoutesItem] routes: A page of routes in the - routing table. - :param int total_count: The total number of resources across all pages. - """ - - def __init__( - self, - first: 'RouteCollectionVPCContextFirst', - limit: int, - routes: List['RouteCollectionVPCContextRoutesItem'], - total_count: int, - *, - next: Optional['RouteCollectionVPCContextNext'] = None, - ) -> None: - """ - Initialize a RouteCollectionVPCContext object. - - :param RouteCollectionVPCContextFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[RouteCollectionVPCContextRoutesItem] routes: A page of routes - in the routing table. - :param int total_count: The total number of resources across all pages. - :param RouteCollectionVPCContextNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. - """ - self.first = first - self.limit = limit - self.next = next - self.routes = routes - self.total_count = total_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContext': - """Initialize a RouteCollectionVPCContext object from a json dictionary.""" - args = {} - if (first := _dict.get('first')) is not None: - args['first'] = RouteCollectionVPCContextFirst.from_dict(first) - else: - raise ValueError('Required property \'first\' not present in RouteCollectionVPCContext JSON') - if (limit := _dict.get('limit')) is not None: - args['limit'] = limit - else: - raise ValueError('Required property \'limit\' not present in RouteCollectionVPCContext JSON') - if (next := _dict.get('next')) is not None: - args['next'] = RouteCollectionVPCContextNext.from_dict(next) - if (routes := _dict.get('routes')) is not None: - args['routes'] = [RouteCollectionVPCContextRoutesItem.from_dict(v) for v in routes] - else: - raise ValueError('Required property \'routes\' not present in RouteCollectionVPCContext JSON') - if (total_count := _dict.get('total_count')) is not None: - args['total_count'] = total_count - else: - raise ValueError('Required property \'total_count\' not present in RouteCollectionVPCContext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RouteCollectionVPCContext 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'routes') and self.routes is not None: - routes_list = [] - for v in self.routes: - if isinstance(v, dict): - routes_list.append(v) - else: - routes_list.append(v.to_dict()) - _dict['routes'] = routes_list - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count - 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 RouteCollectionVPCContext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RouteCollectionVPCContext') -> 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: 'RouteCollectionVPCContext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class RouteCollectionVPCContextFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a RouteCollectionVPCContextFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextFirst': - """Initialize a RouteCollectionVPCContextFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RouteCollectionVPCContextFirst 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 RouteCollectionVPCContextFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RouteCollectionVPCContextFirst') -> 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: 'RouteCollectionVPCContextFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class RouteCollectionVPCContextNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a RouteCollectionVPCContextNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextNext': - """Initialize a RouteCollectionVPCContextNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RouteCollectionVPCContextNext 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 RouteCollectionVPCContextNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RouteCollectionVPCContextNext') -> 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: 'RouteCollectionVPCContextNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class RouteCollectionVPCContextRoutesItem: - """ - RouteCollectionVPCContextRoutesItem. - - :param str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param bool advertise: Indicates whether this route will be advertised to the - ingress sources specified by the `advertise_routes_to` routing table property. - :param datetime created_at: The date and time that the route was created. - :param RouteCreator creator: (optional) If present, the resource that created - the route. Routes with this property present cannot - be directly deleted. All routes with an `origin` of `service` will have this - property set, - and future `origin` values may also have this property set. - :param str destination: The destination CIDR of the route. - :param str href: The URL for this route. - :param str id: The unique identifier for this route. - :param str lifecycle_state: The lifecycle state of the route. - :param str name: The name for this route. The name is unique across all routes - in the routing table. - :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that - packets will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :param str origin: The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is selected. - If two routes have the same `destination` and `priority`, traffic is distributed - between them. - :param ZoneReference zone: The zone the route applies to. - If subnets are attached to the route's routing table, egress traffic from those - subnets in this zone will be subject to this route. If this route's routing - table - has any of `route_direct_link_ingress`, `route_internet_ingress`, - `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, - traffic - from those ingress sources arriving in this zone will be subject to this route. - """ - - def __init__( - self, - action: str, - advertise: bool, - created_at: datetime, - destination: str, - href: str, - id: str, - lifecycle_state: str, - name: str, - next_hop: 'RouteNextHop', - origin: str, - priority: int, - zone: 'ZoneReference', - *, - creator: Optional['RouteCreator'] = None, - ) -> None: - """ - Initialize a RouteCollectionVPCContextRoutesItem object. - - :param str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring - Internet-bound routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param bool advertise: Indicates whether this route will be advertised to - the ingress sources specified by the `advertise_routes_to` routing table - property. - :param datetime created_at: The date and time that the route was created. - :param str destination: The destination CIDR of the route. - :param str href: The URL for this route. - :param str id: The unique identifier for this route. - :param str lifecycle_state: The lifecycle state of the route. - :param str name: The name for this route. The name is unique across all - routes in the routing table. - :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that - packets will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :param str origin: The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - :param int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is - selected. If two routes have the same `destination` and `priority`, traffic - is distributed between them. - :param ZoneReference zone: The zone the route applies to. - If subnets are attached to the route's routing table, egress traffic from - those - subnets in this zone will be subject to this route. If this route's routing - table - has any of `route_direct_link_ingress`, `route_internet_ingress`, - `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, - traffic - from those ingress sources arriving in this zone will be subject to this - route. - """ - self.action = action - self.advertise = advertise - self.created_at = created_at - self.creator = creator - self.destination = destination - self.href = href - self.id = id - self.lifecycle_state = lifecycle_state - self.name = name - self.next_hop = next_hop - self.origin = origin - self.priority = priority - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextRoutesItem': - """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary.""" - args = {} - if (action := _dict.get('action')) is not None: - args['action'] = action - else: - raise ValueError('Required property \'action\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (advertise := _dict.get('advertise')) is not None: - args['advertise'] = advertise - else: - raise ValueError('Required property \'advertise\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (created_at := _dict.get('created_at')) is not None: - args['created_at'] = string_to_datetime(created_at) - else: - raise ValueError('Required property \'created_at\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (creator := _dict.get('creator')) is not None: - args['creator'] = creator - if (destination := _dict.get('destination')) is not None: - args['destination'] = destination - else: - raise ValueError('Required property \'destination\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (id := _dict.get('id')) is not None: - args['id'] = id - else: - raise ValueError('Required property \'id\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (lifecycle_state := _dict.get('lifecycle_state')) is not None: - args['lifecycle_state'] = lifecycle_state - else: - raise ValueError('Required property \'lifecycle_state\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (name := _dict.get('name')) is not None: - args['name'] = name - else: - raise ValueError('Required property \'name\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (next_hop := _dict.get('next_hop')) is not None: - args['next_hop'] = next_hop - else: - raise ValueError('Required property \'next_hop\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (origin := _dict.get('origin')) is not None: - args['origin'] = origin - else: - raise ValueError('Required property \'origin\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (priority := _dict.get('priority')) is not None: - args['priority'] = priority - else: - raise ValueError('Required property \'priority\' not present in RouteCollectionVPCContextRoutesItem JSON') - if (zone := _dict.get('zone')) is not None: - args['zone'] = ZoneReference.from_dict(zone) - else: - raise ValueError('Required property \'zone\' not present in RouteCollectionVPCContextRoutesItem JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RouteCollectionVPCContextRoutesItem 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, 'advertise') and self.advertise is not None: - _dict['advertise'] = self.advertise - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'creator') and getattr(self, 'creator') is not None: - if isinstance(getattr(self, 'creator'), dict): - _dict['creator'] = getattr(self, 'creator') - else: - _dict['creator'] = getattr(self, 'creator').to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - 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 - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'next_hop') and self.next_hop is not None: - if isinstance(self.next_hop, dict): - _dict['next_hop'] = self.next_hop - else: - _dict['next_hop'] = self.next_hop.to_dict() - if hasattr(self, 'origin') and self.origin is not None: - _dict['origin'] = self.origin - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this RouteCollectionVPCContextRoutesItem object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RouteCollectionVPCContextRoutesItem') -> 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: 'RouteCollectionVPCContextRoutesItem') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ActionEnum(str, Enum): - """ - The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ - - DELEGATE = 'delegate' - DELEGATE_VPC = 'delegate_vpc' - DELIVER = 'deliver' - DROP = 'drop' - - - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the route. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - - class OriginEnum(str, Enum): - """ - The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property may - [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the - future. - """ - - SERVICE = 'service' - USER = 'user' - - - +class RouteCollection: + """ + RouteCollection. + + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param List[Route] routes: A page of routes in the routing table. + :param int total_count: The total number of resources across all pages. + """ + + def __init__( + self, + first: 'PageLink', + limit: int, + routes: List['Route'], + total_count: int, + *, + next: Optional['PageLink'] = None, + ) -> None: + """ + Initialize a RouteCollection object. + + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[Route] routes: A page of routes in the routing table. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + """ + self.first = first + self.limit = limit + self.next = next + self.routes = routes + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RouteCollection': + """Initialize a RouteCollection object from a json dictionary.""" + args = {} + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in RouteCollection JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in RouteCollection JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (routes := _dict.get('routes')) is not None: + args['routes'] = [Route.from_dict(v) for v in routes] + else: + raise ValueError('Required property \'routes\' not present in RouteCollection JSON') + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in RouteCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RouteCollection 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, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'routes') and self.routes is not None: + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + 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 RouteCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RouteCollection') -> 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: 'RouteCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RouteCollectionVPCContext: + """ + RouteCollectionVPCContext. + + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by the + request. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + :param List[Route] routes: A page of routes in the routing table. + :param int total_count: The total number of resources across all pages. + """ + + def __init__( + self, + first: 'PageLink', + limit: int, + routes: List['Route'], + total_count: int, + *, + next: Optional['PageLink'] = None, + ) -> None: + """ + Initialize a RouteCollectionVPCContext object. + + :param PageLink first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[Route] routes: A page of routes in the routing table. + :param int total_count: The total number of resources across all pages. + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages + except the last page. + """ + self.first = first + self.limit = limit + self.next = next + self.routes = routes + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContext': + """Initialize a RouteCollectionVPCContext object from a json dictionary.""" + args = {} + if (first := _dict.get('first')) is not None: + args['first'] = PageLink.from_dict(first) + else: + raise ValueError('Required property \'first\' not present in RouteCollectionVPCContext JSON') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + else: + raise ValueError('Required property \'limit\' not present in RouteCollectionVPCContext JSON') + if (next := _dict.get('next')) is not None: + args['next'] = PageLink.from_dict(next) + if (routes := _dict.get('routes')) is not None: + args['routes'] = [Route.from_dict(v) for v in routes] + else: + raise ValueError('Required property \'routes\' not present in RouteCollectionVPCContext JSON') + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + else: + raise ValueError('Required property \'total_count\' not present in RouteCollectionVPCContext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RouteCollectionVPCContext 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, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'routes') and self.routes is not None: + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + 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 RouteCollectionVPCContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RouteCollectionVPCContext') -> 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: 'RouteCollectionVPCContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class RouteCreator: """ If present, the resource that created the route. Routes with this property present @@ -77658,9 +78142,9 @@ class RoutingTable: :param List[ResourceFilter] accept_routes_from: The filters specifying the resources that may create routes in this routing table. - At present, only the `resource_type` filter is permitted, and only the values - `vpn_gateway` and `vpn_server` are supported, but filter support is expected to - expand in the future. + The resources and types of filters supported by this property is expected to + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. :param List[str] advertise_routes_to: The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these sources. @@ -77746,10 +78230,10 @@ def __init__( :param List[ResourceFilter] accept_routes_from: The filters specifying the resources that may create routes in this routing table. - At present, only the `resource_type` filter is permitted, and only the - values - `vpn_gateway` and `vpn_server` are supported, but filter support is - expected to expand in the future. + The resources and types of filters supported by this property is expected + to + [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the + future. :param List[str] advertise_routes_to: The ingress sources to advertise routes to. Routes in the table with `advertise` enabled will be advertised to these sources. @@ -78027,11 +78511,11 @@ class RoutingTableCollection: """ RoutingTableCollection. - :param RoutingTableCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param RoutingTableCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[RoutingTable] routing_tables: A page of routing tables. :param int total_count: The total number of resources across all pages. @@ -78039,24 +78523,23 @@ class RoutingTableCollection: def __init__( self, - first: 'RoutingTableCollectionFirst', + first: 'PageLink', limit: int, routing_tables: List['RoutingTable'], total_count: int, *, - next: Optional['RoutingTableCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a RoutingTableCollection object. - :param RoutingTableCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[RoutingTable] routing_tables: A page of routing tables. :param int total_count: The total number of resources across all pages. - :param RoutingTableCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -78070,7 +78553,7 @@ def from_dict(cls, _dict: Dict) -> 'RoutingTableCollection': """Initialize a RoutingTableCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = RoutingTableCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in RoutingTableCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -78078,7 +78561,7 @@ def from_dict(cls, _dict: Dict) -> 'RoutingTableCollection': else: raise ValueError('Required property \'limit\' not present in RoutingTableCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = RoutingTableCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (routing_tables := _dict.get('routing_tables')) is not None: args['routing_tables'] = [RoutingTable.from_dict(v) for v in routing_tables] else: @@ -78140,125 +78623,6 @@ def __ne__(self, other: 'RoutingTableCollection') -> bool: return not self == other -class RoutingTableCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a RoutingTableCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableCollectionFirst': - """Initialize a RoutingTableCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in RoutingTableCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RoutingTableCollectionFirst 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 RoutingTableCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RoutingTableCollectionFirst') -> 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: 'RoutingTableCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class RoutingTableCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a RoutingTableCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableCollectionNext': - """Initialize a RoutingTableCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in RoutingTableCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RoutingTableCollectionNext 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 RoutingTableCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RoutingTableCollectionNext') -> 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: 'RoutingTableCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class RoutingTableIdentity: """ Identifies a routing table by a unique property. @@ -78288,6 +78652,7 @@ class RoutingTablePatch: given filter will be removed when an existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, resulting in all routes not directly created by the user being removed. + If specified, `resource_type` must be `vpn_gateway` or `vpn_server`. :param List[str] advertise_routes_to: (optional) The ingress sources to advertise routes to, replacing any existing sources to advertise to. Routes in the table with `advertise` enabled will be advertised to these sources. @@ -78372,6 +78737,7 @@ def __init__( match a given filter will be removed when an existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, resulting in all routes not directly created by the user being removed. + If specified, `resource_type` must be `vpn_gateway` or `vpn_server`. :param List[str] advertise_routes_to: (optional) The ingress sources to advertise routes to, replacing any existing sources to advertise to. Routes in the table with `advertise` enabled will be advertised to these sources. @@ -78823,12 +79189,11 @@ class SecurityGroupCollection: """ SecurityGroupCollection. - :param SecurityGroupCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param SecurityGroupCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[SecurityGroup] security_groups: A page of security groups. :param int total_count: The total number of resources across all pages. @@ -78836,24 +79201,23 @@ class SecurityGroupCollection: def __init__( self, - first: 'SecurityGroupCollectionFirst', + first: 'PageLink', limit: int, security_groups: List['SecurityGroup'], total_count: int, *, - next: Optional['SecurityGroupCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a SecurityGroupCollection object. - :param SecurityGroupCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[SecurityGroup] security_groups: A page of security groups. :param int total_count: The total number of resources across all pages. - :param SecurityGroupCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -78867,7 +79231,7 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollection': """Initialize a SecurityGroupCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = SecurityGroupCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in SecurityGroupCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -78875,7 +79239,7 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollection': else: raise ValueError('Required property \'limit\' not present in SecurityGroupCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = SecurityGroupCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (security_groups := _dict.get('security_groups')) is not None: args['security_groups'] = [SecurityGroup.from_dict(v) for v in security_groups] else: @@ -78937,125 +79301,6 @@ def __ne__(self, other: 'SecurityGroupCollection') -> bool: return not self == other -class SecurityGroupCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SecurityGroupCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionFirst': - """Initialize a SecurityGroupCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SecurityGroupCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SecurityGroupCollectionFirst 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 SecurityGroupCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SecurityGroupCollectionFirst') -> 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: 'SecurityGroupCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class SecurityGroupCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SecurityGroupCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionNext': - """Initialize a SecurityGroupCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SecurityGroupCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SecurityGroupCollectionNext 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 SecurityGroupCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SecurityGroupCollectionNext') -> 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: 'SecurityGroupCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class SecurityGroupIdentity: """ Identifies a security group by a unique property. @@ -79781,41 +80026,6 @@ def __init__( ) raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototype': - """Initialize a SecurityGroupRulePrototype object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'SecurityGroupRulePrototype'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP']) - ) - raise Exception(msg) - - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a SecurityGroupRulePrototype object from a json dictionary.""" - return cls.from_dict(_dict) - - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['all'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll' - mapping['icmp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP' - mapping['tcp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' - mapping['udp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' - disc_value = _dict.get('protocol') - if disc_value is None: - raise ValueError('Discriminator property \'protocol\' not found in SecurityGroupRulePrototype JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - class DirectionEnum(str, Enum): """ The direction of traffic to allow. @@ -79920,12 +80130,11 @@ class SecurityGroupTargetCollection: """ SecurityGroupTargetCollection. - :param SecurityGroupTargetCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param SecurityGroupTargetCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[SecurityGroupTargetReference] targets: A page of targets for the security group. @@ -79934,25 +80143,24 @@ class SecurityGroupTargetCollection: def __init__( self, - first: 'SecurityGroupTargetCollectionFirst', + first: 'PageLink', limit: int, targets: List['SecurityGroupTargetReference'], total_count: int, *, - next: Optional['SecurityGroupTargetCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a SecurityGroupTargetCollection object. - :param SecurityGroupTargetCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[SecurityGroupTargetReference] targets: A page of targets for the security group. :param int total_count: The total number of resources across all pages. - :param SecurityGroupTargetCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -79966,7 +80174,7 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollection': """Initialize a SecurityGroupTargetCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = SecurityGroupTargetCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in SecurityGroupTargetCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -79974,7 +80182,7 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollection': else: raise ValueError('Required property \'limit\' not present in SecurityGroupTargetCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = SecurityGroupTargetCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (targets := _dict.get('targets')) is not None: args['targets'] = targets else: @@ -80036,125 +80244,6 @@ def __ne__(self, other: 'SecurityGroupTargetCollection') -> bool: return not self == other -class SecurityGroupTargetCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SecurityGroupTargetCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionFirst': - """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetCollectionFirst 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 SecurityGroupTargetCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SecurityGroupTargetCollectionFirst') -> 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: 'SecurityGroupTargetCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class SecurityGroupTargetCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SecurityGroupTargetCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionNext': - """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetCollectionNext 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 SecurityGroupTargetCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SecurityGroupTargetCollectionNext') -> 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: 'SecurityGroupTargetCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class SecurityGroupTargetReference: """ A target of this security group. @@ -80980,12 +81069,11 @@ class ShareAccessorBindingCollection: :param List[ShareAccessorBinding] accessor_bindings: A page of accessor bindings for the share. - :param ShareAccessorBindingCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param ShareAccessorBindingCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -80993,24 +81081,23 @@ class ShareAccessorBindingCollection: def __init__( self, accessor_bindings: List['ShareAccessorBinding'], - first: 'ShareAccessorBindingCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['ShareAccessorBindingCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a ShareAccessorBindingCollection object. :param List[ShareAccessorBinding] accessor_bindings: A page of accessor bindings for the share. - :param ShareAccessorBindingCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param ShareAccessorBindingCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.accessor_bindings = accessor_bindings @@ -81028,7 +81115,7 @@ def from_dict(cls, _dict: Dict) -> 'ShareAccessorBindingCollection': else: raise ValueError('Required property \'accessor_bindings\' not present in ShareAccessorBindingCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = ShareAccessorBindingCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in ShareAccessorBindingCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -81036,7 +81123,7 @@ def from_dict(cls, _dict: Dict) -> 'ShareAccessorBindingCollection': else: raise ValueError('Required property \'limit\' not present in ShareAccessorBindingCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = ShareAccessorBindingCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -81094,125 +81181,6 @@ def __ne__(self, other: 'ShareAccessorBindingCollection') -> bool: return not self == other -class ShareAccessorBindingCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ShareAccessorBindingCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ShareAccessorBindingCollectionFirst': - """Initialize a ShareAccessorBindingCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ShareAccessorBindingCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ShareAccessorBindingCollectionFirst 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 ShareAccessorBindingCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ShareAccessorBindingCollectionFirst') -> 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: 'ShareAccessorBindingCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ShareAccessorBindingCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ShareAccessorBindingCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ShareAccessorBindingCollectionNext': - """Initialize a ShareAccessorBindingCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ShareAccessorBindingCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ShareAccessorBindingCollectionNext 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 ShareAccessorBindingCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ShareAccessorBindingCollectionNext') -> 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: 'ShareAccessorBindingCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ShareAccessorBindingReference: """ ShareAccessorBindingReference. @@ -81304,11 +81272,11 @@ class ShareCollection: """ ShareCollection. - :param ShareCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param ShareCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[Share] shares: A page of file shares. :param int total_count: The total number of resources across all pages. @@ -81316,23 +81284,23 @@ class ShareCollection: def __init__( self, - first: 'ShareCollectionFirst', + first: 'PageLink', limit: int, shares: List['Share'], total_count: int, *, - next: Optional['ShareCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a ShareCollection object. - :param ShareCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[Share] shares: A page of file shares. :param int total_count: The total number of resources across all pages. - :param ShareCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -81346,7 +81314,7 @@ def from_dict(cls, _dict: Dict) -> 'ShareCollection': """Initialize a ShareCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = ShareCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in ShareCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -81354,7 +81322,7 @@ def from_dict(cls, _dict: Dict) -> 'ShareCollection': else: raise ValueError('Required property \'limit\' not present in ShareCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = ShareCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (shares := _dict.get('shares')) is not None: args['shares'] = [Share.from_dict(v) for v in shares] else: @@ -81416,125 +81384,6 @@ def __ne__(self, other: 'ShareCollection') -> bool: return not self == other -class ShareCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ShareCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ShareCollectionFirst': - """Initialize a ShareCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ShareCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ShareCollectionFirst 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 ShareCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ShareCollectionFirst') -> 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: 'ShareCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ShareCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ShareCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ShareCollectionNext': - """Initialize a ShareCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ShareCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ShareCollectionNext 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 ShareCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ShareCollectionNext') -> 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: 'ShareCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ShareIdentity: """ Identifies a file share by a unique property. @@ -82393,39 +82242,37 @@ class ShareMountTargetCollection: """ ShareMountTargetCollection. - :param ShareMountTargetCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[ShareMountTarget] mount_targets: A page of mount targets for the share. - :param ShareMountTargetCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'ShareMountTargetCollectionFirst', + first: 'PageLink', limit: int, mount_targets: List['ShareMountTarget'], total_count: int, *, - next: Optional['ShareMountTargetCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a ShareMountTargetCollection object. - :param ShareMountTargetCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[ShareMountTarget] mount_targets: A page of mount targets for the share. :param int total_count: The total number of resources across all pages. - :param ShareMountTargetCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -82439,7 +82286,7 @@ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollection': """Initialize a ShareMountTargetCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = ShareMountTargetCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in ShareMountTargetCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -82451,7 +82298,7 @@ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollection': else: raise ValueError('Required property \'mount_targets\' not present in ShareMountTargetCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = ShareMountTargetCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -82509,125 +82356,6 @@ def __ne__(self, other: 'ShareMountTargetCollection') -> bool: return not self == other -class ShareMountTargetCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ShareMountTargetCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollectionFirst': - """Initialize a ShareMountTargetCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ShareMountTargetCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ShareMountTargetCollectionFirst 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 ShareMountTargetCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ShareMountTargetCollectionFirst') -> 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: 'ShareMountTargetCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ShareMountTargetCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ShareMountTargetCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollectionNext': - """Initialize a ShareMountTargetCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ShareMountTargetCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ShareMountTargetCollectionNext 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 ShareMountTargetCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ShareMountTargetCollectionNext') -> 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: 'ShareMountTargetCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ShareMountTargetPatch: """ ShareMountTargetPatch. @@ -82908,7 +82636,7 @@ class SharePatch: The requested profile must be in the same `family`. :param str replication_cron_spec: (optional) The cron specification for the file share replication schedule. - Replication of a share can be scheduled to occur at most once per hour. + Replication of a share can be scheduled to occur at most once every 15 minutes. For this property to be changed, the share `replication_role` must be `replica`. :param int size: (optional) The size of the file share rounded up to the next gigabyte. The value must not be less than the share's current size, and must not @@ -82961,7 +82689,8 @@ def __init__( The requested profile must be in the same `family`. :param str replication_cron_spec: (optional) The cron specification for the file share replication schedule. - Replication of a share can be scheduled to occur at most once per hour. + Replication of a share can be scheduled to occur at most once every 15 + minutes. For this property to be changed, the share `replication_role` must be `replica`. :param int size: (optional) The size of the file share rounded up to the @@ -83240,7 +82969,7 @@ def __init__( """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ShareProfileCapacityFixed', 'ShareProfileCapacityRange', 'ShareProfileCapacityEnum', 'ShareProfileCapacityDependentRange']) + ", ".join(['ShareProfileCapacityFixed', 'ShareProfileCapacityEnum', 'ShareProfileCapacityRange', 'ShareProfileCapacityDependentRange']) ) raise Exception(msg) @@ -83249,11 +82978,11 @@ class ShareProfileCollection: """ ShareProfileCollection. - :param ShareProfileCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param ShareProfileCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[ShareProfile] profiles: A page of share profiles. :param int total_count: The total number of resources across all pages. @@ -83261,24 +82990,23 @@ class ShareProfileCollection: def __init__( self, - first: 'ShareProfileCollectionFirst', + first: 'PageLink', limit: int, profiles: List['ShareProfile'], total_count: int, *, - next: Optional['ShareProfileCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a ShareProfileCollection object. - :param ShareProfileCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[ShareProfile] profiles: A page of share profiles. :param int total_count: The total number of resources across all pages. - :param ShareProfileCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -83292,7 +83020,7 @@ def from_dict(cls, _dict: Dict) -> 'ShareProfileCollection': """Initialize a ShareProfileCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = ShareProfileCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in ShareProfileCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -83300,7 +83028,7 @@ def from_dict(cls, _dict: Dict) -> 'ShareProfileCollection': else: raise ValueError('Required property \'limit\' not present in ShareProfileCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = ShareProfileCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (profiles := _dict.get('profiles')) is not None: args['profiles'] = [ShareProfile.from_dict(v) for v in profiles] else: @@ -83362,125 +83090,6 @@ def __ne__(self, other: 'ShareProfileCollection') -> bool: return not self == other -class ShareProfileCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ShareProfileCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ShareProfileCollectionFirst': - """Initialize a ShareProfileCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ShareProfileCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ShareProfileCollectionFirst 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 ShareProfileCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ShareProfileCollectionFirst') -> 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: 'ShareProfileCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ShareProfileCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a ShareProfileCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ShareProfileCollectionNext': - """Initialize a ShareProfileCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in ShareProfileCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ShareProfileCollectionNext 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 ShareProfileCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ShareProfileCollectionNext') -> 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: 'ShareProfileCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ShareProfileIOPS: """ ShareProfileIOPS. @@ -83712,7 +83321,7 @@ class SharePrototypeShareContext: size. :param str replication_cron_spec: The cron specification for the file share replication schedule. - Replication of a share can be scheduled to occur at most once per hour. + Replication of a share can be scheduled to occur at most once every 15 minutes. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the resource group from the source share will be used. @@ -83745,7 +83354,8 @@ def __init__( and size. :param str replication_cron_spec: The cron specification for the file share replication schedule. - Replication of a share can be scheduled to occur at most once per hour. + Replication of a share can be scheduled to occur at most once every 15 + minutes. :param ZoneIdentity zone: The zone this replica file share will reside in. For a replica share in the same region as the source share, this must be a different zone from the source @@ -84251,6 +83861,8 @@ class Snapshot: snapshots in the region. :param OperatingSystem operating_system: (optional) The operating system included in this snapshot. + :param int progress: Indicates the progress (as a percentage) of storing this + snapshot. Only stored snapshots can be used for restoration. :param ResourceGroupReference resource_group: The resource group for this snapshot. :param str resource_type: The resource type. @@ -84287,6 +83899,7 @@ def __init__( lifecycle_state: str, minimum_capacity: int, name: str, + progress: int, resource_group: 'ResourceGroupReference', resource_type: str, service_tags: List[str], @@ -84324,6 +83937,8 @@ def __init__( of the `source_volume`. :param str name: The name for this snapshot. The name is unique across all snapshots in the region. + :param int progress: Indicates the progress (as a percentage) of storing + this snapshot. Only stored snapshots can be used for restoration. :param ResourceGroupReference resource_group: The resource group for this snapshot. :param str resource_type: The resource type. @@ -84384,6 +83999,7 @@ def __init__( self.minimum_capacity = minimum_capacity self.name = name self.operating_system = operating_system + self.progress = progress self.resource_group = resource_group self.resource_type = resource_type self.service_tags = service_tags @@ -84456,6 +84072,10 @@ def from_dict(cls, _dict: Dict) -> 'Snapshot': raise ValueError('Required property \'name\' not present in Snapshot JSON') if (operating_system := _dict.get('operating_system')) is not None: args['operating_system'] = OperatingSystem.from_dict(operating_system) + if (progress := _dict.get('progress')) is not None: + args['progress'] = progress + else: + raise ValueError('Required property \'progress\' not present in Snapshot JSON') if (resource_group := _dict.get('resource_group')) is not None: args['resource_group'] = ResourceGroupReference.from_dict(resource_group) else: @@ -84554,6 +84174,8 @@ def to_dict(self) -> Dict: _dict['operating_system'] = self.operating_system else: _dict['operating_system'] = self.operating_system.to_dict() + if hasattr(self, 'progress') and self.progress is not None: + _dict['progress'] = self.progress if hasattr(self, 'resource_group') and self.resource_group is not None: if isinstance(self.resource_group, dict): _dict['resource_group'] = self.resource_group @@ -84944,11 +84566,11 @@ class SnapshotCollection: """ SnapshotCollection. - :param SnapshotCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param SnapshotCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[Snapshot] snapshots: A page of snapshots. :param int total_count: The total number of resources across all pages. @@ -84956,24 +84578,23 @@ class SnapshotCollection: def __init__( self, - first: 'SnapshotCollectionFirst', + first: 'PageLink', limit: int, snapshots: List['Snapshot'], total_count: int, *, - next: Optional['SnapshotCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a SnapshotCollection object. - :param SnapshotCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[Snapshot] snapshots: A page of snapshots. :param int total_count: The total number of resources across all pages. - :param SnapshotCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -84987,7 +84608,7 @@ def from_dict(cls, _dict: Dict) -> 'SnapshotCollection': """Initialize a SnapshotCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = SnapshotCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in SnapshotCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -84995,7 +84616,7 @@ def from_dict(cls, _dict: Dict) -> 'SnapshotCollection': else: raise ValueError('Required property \'limit\' not present in SnapshotCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = SnapshotCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (snapshots := _dict.get('snapshots')) is not None: args['snapshots'] = [Snapshot.from_dict(v) for v in snapshots] else: @@ -85057,125 +84678,6 @@ def __ne__(self, other: 'SnapshotCollection') -> bool: return not self == other -class SnapshotCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SnapshotCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionFirst': - """Initialize a SnapshotCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SnapshotCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SnapshotCollectionFirst 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 SnapshotCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SnapshotCollectionFirst') -> 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: 'SnapshotCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class SnapshotCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SnapshotCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionNext': - """Initialize a SnapshotCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SnapshotCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SnapshotCollectionNext 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 SnapshotCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SnapshotCollectionNext') -> 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: 'SnapshotCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class SnapshotConsistencyGroup: """ SnapshotConsistencyGroup. @@ -85404,12 +84906,11 @@ class SnapshotConsistencyGroupCollection: """ SnapshotConsistencyGroupCollection. - :param SnapshotConsistencyGroupCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param SnapshotConsistencyGroupCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[SnapshotConsistencyGroup] snapshot_consistency_groups: A page of snapshot consistency groups. @@ -85418,25 +84919,24 @@ class SnapshotConsistencyGroupCollection: def __init__( self, - first: 'SnapshotConsistencyGroupCollectionFirst', + first: 'PageLink', limit: int, snapshot_consistency_groups: List['SnapshotConsistencyGroup'], total_count: int, *, - next: Optional['SnapshotConsistencyGroupCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a SnapshotConsistencyGroupCollection object. - :param SnapshotConsistencyGroupCollectionFirst first: A link to the first - page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[SnapshotConsistencyGroup] snapshot_consistency_groups: A page of snapshot consistency groups. :param int total_count: The total number of resources across all pages. - :param SnapshotConsistencyGroupCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -85450,7 +84950,7 @@ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupCollection': """Initialize a SnapshotConsistencyGroupCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = SnapshotConsistencyGroupCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in SnapshotConsistencyGroupCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -85458,7 +84958,7 @@ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupCollection': else: raise ValueError('Required property \'limit\' not present in SnapshotConsistencyGroupCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = SnapshotConsistencyGroupCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (snapshot_consistency_groups := _dict.get('snapshot_consistency_groups')) is not None: args['snapshot_consistency_groups'] = [SnapshotConsistencyGroup.from_dict(v) for v in snapshot_consistency_groups] else: @@ -85520,125 +85020,6 @@ def __ne__(self, other: 'SnapshotConsistencyGroupCollection') -> bool: return not self == other -class SnapshotConsistencyGroupCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SnapshotConsistencyGroupCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupCollectionFirst': - """Initialize a SnapshotConsistencyGroupCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SnapshotConsistencyGroupCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SnapshotConsistencyGroupCollectionFirst 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 SnapshotConsistencyGroupCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SnapshotConsistencyGroupCollectionFirst') -> 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: 'SnapshotConsistencyGroupCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class SnapshotConsistencyGroupCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SnapshotConsistencyGroupCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupCollectionNext': - """Initialize a SnapshotConsistencyGroupCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SnapshotConsistencyGroupCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SnapshotConsistencyGroupCollectionNext 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 SnapshotConsistencyGroupCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SnapshotConsistencyGroupCollectionNext') -> 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: 'SnapshotConsistencyGroupCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class SnapshotConsistencyGroupPatch: """ SnapshotConsistencyGroupPatch. @@ -86903,11 +86284,11 @@ class SubnetCollection: """ SubnetCollection. - :param SubnetCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param SubnetCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[Subnet] subnets: A page of subnets. :param int total_count: The total number of resources across all pages. @@ -86915,23 +86296,23 @@ class SubnetCollection: def __init__( self, - first: 'SubnetCollectionFirst', + first: 'PageLink', limit: int, subnets: List['Subnet'], total_count: int, *, - next: Optional['SubnetCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a SubnetCollection object. - :param SubnetCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[Subnet] subnets: A page of subnets. :param int total_count: The total number of resources across all pages. - :param SubnetCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -86945,7 +86326,7 @@ def from_dict(cls, _dict: Dict) -> 'SubnetCollection': """Initialize a SubnetCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = SubnetCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in SubnetCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -86953,7 +86334,7 @@ def from_dict(cls, _dict: Dict) -> 'SubnetCollection': else: raise ValueError('Required property \'limit\' not present in SubnetCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = SubnetCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (subnets := _dict.get('subnets')) is not None: args['subnets'] = [Subnet.from_dict(v) for v in subnets] else: @@ -87015,125 +86396,6 @@ def __ne__(self, other: 'SubnetCollection') -> bool: return not self == other -class SubnetCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SubnetCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetCollectionFirst': - """Initialize a SubnetCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SubnetCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SubnetCollectionFirst 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 SubnetCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SubnetCollectionFirst') -> 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: 'SubnetCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class SubnetCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a SubnetCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetCollectionNext': - """Initialize a SubnetCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in SubnetCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SubnetCollectionNext 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 SubnetCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SubnetCollectionNext') -> 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: 'SubnetCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class SubnetIdentity: """ Identifies a subnet by a unique property. @@ -87490,7 +86752,7 @@ def __init__( """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['TrustedProfileIdentityTrustedProfileById', 'TrustedProfileIdentityTrustedProfileByCRN']) + ", ".join(['TrustedProfileIdentityById', 'TrustedProfileIdentityByCRN']) ) raise Exception(msg) @@ -88074,11 +87336,11 @@ class VPCCollection: """ VPCCollection. - :param VPCCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VPCCollectionNext next: (optional) A link to the next page of resources. - This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. :param List[VPC] vpcs: A page of VPCs. @@ -88086,23 +87348,23 @@ class VPCCollection: def __init__( self, - first: 'VPCCollectionFirst', + first: 'PageLink', limit: int, total_count: int, vpcs: List['VPC'], *, - next: Optional['VPCCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VPCCollection object. - :param VPCCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. :param List[VPC] vpcs: A page of VPCs. - :param VPCCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -88116,7 +87378,7 @@ def from_dict(cls, _dict: Dict) -> 'VPCCollection': """Initialize a VPCCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = VPCCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VPCCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -88124,7 +87386,7 @@ def from_dict(cls, _dict: Dict) -> 'VPCCollection': else: raise ValueError('Required property \'limit\' not present in VPCCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VPCCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -88186,125 +87448,6 @@ def __ne__(self, other: 'VPCCollection') -> bool: return not self == other -class VPCCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPCCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCCollectionFirst': - """Initialize a VPCCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPCCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPCCollectionFirst 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 VPCCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPCCollectionFirst') -> 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: 'VPCCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPCCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPCCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCCollectionNext': - """Initialize a VPCCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPCCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPCCollectionNext 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 VPCCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPCCollectionNext') -> 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: 'VPCCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VPCDNS: """ The DNS configuration for this VPC. @@ -88789,12 +87932,11 @@ class VPCDNSResolutionBindingCollection: :param List[VPCDNSResolutionBinding] dns_resolution_bindings: A page of DNS resolution bindings for the VPC. - :param VPCDNSResolutionBindingCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VPCDNSResolutionBindingCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -88802,24 +87944,23 @@ class VPCDNSResolutionBindingCollection: def __init__( self, dns_resolution_bindings: List['VPCDNSResolutionBinding'], - first: 'VPCDNSResolutionBindingCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['VPCDNSResolutionBindingCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VPCDNSResolutionBindingCollection object. :param List[VPCDNSResolutionBinding] dns_resolution_bindings: A page of DNS resolution bindings for the VPC. - :param VPCDNSResolutionBindingCollectionFirst first: A link to the first - page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param VPCDNSResolutionBindingCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.dns_resolution_bindings = dns_resolution_bindings @@ -88837,7 +87978,7 @@ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollection': else: raise ValueError('Required property \'dns_resolution_bindings\' not present in VPCDNSResolutionBindingCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = VPCDNSResolutionBindingCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VPCDNSResolutionBindingCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -88845,7 +87986,7 @@ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollection': else: raise ValueError('Required property \'limit\' not present in VPCDNSResolutionBindingCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VPCDNSResolutionBindingCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -88903,125 +88044,6 @@ def __ne__(self, other: 'VPCDNSResolutionBindingCollection') -> bool: return not self == other -class VPCDNSResolutionBindingCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPCDNSResolutionBindingCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollectionFirst': - """Initialize a VPCDNSResolutionBindingCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPCDNSResolutionBindingCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPCDNSResolutionBindingCollectionFirst 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 VPCDNSResolutionBindingCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPCDNSResolutionBindingCollectionFirst') -> 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: 'VPCDNSResolutionBindingCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPCDNSResolutionBindingCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPCDNSResolutionBindingCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollectionNext': - """Initialize a VPCDNSResolutionBindingCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPCDNSResolutionBindingCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPCDNSResolutionBindingCollectionNext 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 VPCDNSResolutionBindingCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPCDNSResolutionBindingCollectionNext') -> 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: 'VPCDNSResolutionBindingCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VPCDNSResolutionBindingHealthReason: """ VPCDNSResolutionBindingHealthReason. @@ -90278,11 +89300,11 @@ class VPNGatewayCollection: """ VPNGatewayCollection. - :param VPNGatewayCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VPNGatewayCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. :param List[VPNGateway] vpn_gateways: A page of VPN gateways. @@ -90290,24 +89312,23 @@ class VPNGatewayCollection: def __init__( self, - first: 'VPNGatewayCollectionFirst', + first: 'PageLink', limit: int, total_count: int, vpn_gateways: List['VPNGateway'], *, - next: Optional['VPNGatewayCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VPNGatewayCollection object. - :param VPNGatewayCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. :param List[VPNGateway] vpn_gateways: A page of VPN gateways. - :param VPNGatewayCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -90321,7 +89342,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollection': """Initialize a VPNGatewayCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = VPNGatewayCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VPNGatewayCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -90329,7 +89350,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollection': else: raise ValueError('Required property \'limit\' not present in VPNGatewayCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VPNGatewayCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -90391,125 +89412,6 @@ def __ne__(self, other: 'VPNGatewayCollection') -> bool: return not self == other -class VPNGatewayCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNGatewayCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionFirst': - """Initialize a VPNGatewayCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNGatewayCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNGatewayCollectionFirst 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 VPNGatewayCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNGatewayCollectionFirst') -> 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: 'VPNGatewayCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPNGatewayCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNGatewayCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionNext': - """Initialize a VPNGatewayCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNGatewayCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNGatewayCollectionNext 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 VPNGatewayCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNGatewayCollectionNext') -> 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: 'VPNGatewayCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VPNGatewayConnection: """ VPNGatewayConnection. @@ -90780,12 +89682,11 @@ class VPNGatewayConnectionCollection: :param List[VPNGatewayConnection] connections: A page of connections for the VPN gateway. - :param VPNGatewayConnectionCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VPNGatewayConnectionCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -90793,24 +89694,23 @@ class VPNGatewayConnectionCollection: def __init__( self, connections: List['VPNGatewayConnection'], - first: 'VPNGatewayConnectionCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['VPNGatewayConnectionCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VPNGatewayConnectionCollection object. :param List[VPNGatewayConnection] connections: A page of connections for the VPN gateway. - :param VPNGatewayConnectionCollectionFirst first: A link to the first page - of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param VPNGatewayConnectionCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.connections = connections @@ -90828,7 +89728,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollection': else: raise ValueError('Required property \'connections\' not present in VPNGatewayConnectionCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = VPNGatewayConnectionCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VPNGatewayConnectionCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -90836,7 +89736,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollection': else: raise ValueError('Required property \'limit\' not present in VPNGatewayConnectionCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VPNGatewayConnectionCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -90894,125 +89794,6 @@ def __ne__(self, other: 'VPNGatewayConnectionCollection') -> bool: return not self == other -class VPNGatewayConnectionCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNGatewayConnectionCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollectionFirst': - """Initialize a VPNGatewayConnectionCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNGatewayConnectionCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionCollectionFirst 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 VPNGatewayConnectionCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNGatewayConnectionCollectionFirst') -> 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: 'VPNGatewayConnectionCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPNGatewayConnectionCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNGatewayConnectionCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollectionNext': - """Initialize a VPNGatewayConnectionCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNGatewayConnectionCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionCollectionNext 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 VPNGatewayConnectionCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNGatewayConnectionCollectionNext') -> 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: 'VPNGatewayConnectionCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VPNGatewayConnectionDPD: """ The Dead Peer Detection settings. @@ -94284,12 +93065,11 @@ class VPNServerClientCollection: VPNServerClientCollection. :param List[VPNServerClient] clients: A page of clients of the VPN server. - :param VPNServerClientCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VPNServerClientCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. """ @@ -94297,23 +93077,22 @@ class VPNServerClientCollection: def __init__( self, clients: List['VPNServerClient'], - first: 'VPNServerClientCollectionFirst', + first: 'PageLink', limit: int, total_count: int, *, - next: Optional['VPNServerClientCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VPNServerClientCollection object. :param List[VPNServerClient] clients: A page of clients of the VPN server. - :param VPNServerClientCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param VPNServerClientCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.clients = clients @@ -94331,7 +93110,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollection': else: raise ValueError('Required property \'clients\' not present in VPNServerClientCollection JSON') if (first := _dict.get('first')) is not None: - args['first'] = VPNServerClientCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VPNServerClientCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -94339,7 +93118,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollection': else: raise ValueError('Required property \'limit\' not present in VPNServerClientCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VPNServerClientCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -94397,134 +93176,15 @@ def __ne__(self, other: 'VPNServerClientCollection') -> bool: return not self == other -class VPNServerClientCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNServerClientCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollectionFirst': - """Initialize a VPNServerClientCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNServerClientCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNServerClientCollectionFirst 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 VPNServerClientCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNServerClientCollectionFirst') -> 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: 'VPNServerClientCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPNServerClientCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNServerClientCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollectionNext': - """Initialize a VPNServerClientCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNServerClientCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNServerClientCollectionNext 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 VPNServerClientCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNServerClientCollectionNext') -> 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: 'VPNServerClientCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VPNServerCollection: """ VPNServerCollection. - :param VPNServerCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VPNServerCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. :param List[VPNServer] vpn_servers: A page of VPN servers. @@ -94532,24 +93192,23 @@ class VPNServerCollection: def __init__( self, - first: 'VPNServerCollectionFirst', + first: 'PageLink', limit: int, total_count: int, vpn_servers: List['VPNServer'], *, - next: Optional['VPNServerCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VPNServerCollection object. - :param VPNServerCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. :param List[VPNServer] vpn_servers: A page of VPN servers. - :param VPNServerCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -94563,7 +93222,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerCollection': """Initialize a VPNServerCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = VPNServerCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VPNServerCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -94571,7 +93230,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerCollection': else: raise ValueError('Required property \'limit\' not present in VPNServerCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VPNServerCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -94633,125 +93292,6 @@ def __ne__(self, other: 'VPNServerCollection') -> bool: return not self == other -class VPNServerCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNServerCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionFirst': - """Initialize a VPNServerCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNServerCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNServerCollectionFirst 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 VPNServerCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNServerCollectionFirst') -> 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: 'VPNServerCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPNServerCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNServerCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionNext': - """Initialize a VPNServerCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNServerCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNServerCollectionNext 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 VPNServerCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNServerCollectionNext') -> 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: 'VPNServerCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VPNServerHealthReason: """ VPNServerHealthReason. @@ -95493,12 +94033,11 @@ class VPNServerRouteCollection: """ VPNServerRouteCollection. - :param VPNServerRouteCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VPNServerRouteCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[VPNServerRoute] routes: A page of routes for the VPN server. :param int total_count: The total number of resources across all pages. @@ -95506,24 +94045,23 @@ class VPNServerRouteCollection: def __init__( self, - first: 'VPNServerRouteCollectionFirst', + first: 'PageLink', limit: int, routes: List['VPNServerRoute'], total_count: int, *, - next: Optional['VPNServerRouteCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VPNServerRouteCollection object. - :param VPNServerRouteCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[VPNServerRoute] routes: A page of routes for the VPN server. :param int total_count: The total number of resources across all pages. - :param VPNServerRouteCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -95537,7 +94075,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollection': """Initialize a VPNServerRouteCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = VPNServerRouteCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VPNServerRouteCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -95545,7 +94083,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollection': else: raise ValueError('Required property \'limit\' not present in VPNServerRouteCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VPNServerRouteCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (routes := _dict.get('routes')) is not None: args['routes'] = [VPNServerRoute.from_dict(v) for v in routes] else: @@ -95607,125 +94145,6 @@ def __ne__(self, other: 'VPNServerRouteCollection') -> bool: return not self == other -class VPNServerRouteCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNServerRouteCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollectionFirst': - """Initialize a VPNServerRouteCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNServerRouteCollectionFirst 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 VPNServerRouteCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNServerRouteCollectionFirst') -> 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: 'VPNServerRouteCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPNServerRouteCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPNServerRouteCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollectionNext': - """Initialize a VPNServerRouteCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNServerRouteCollectionNext 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 VPNServerRouteCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNServerRouteCollectionNext') -> 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: 'VPNServerRouteCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VPNServerRouteHealthReason: """ VPNServerRouteHealthReason. @@ -96385,12 +94804,11 @@ class VirtualNetworkInterfaceCollection: """ VirtualNetworkInterfaceCollection. - :param VirtualNetworkInterfaceCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VirtualNetworkInterfaceCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. :param List[VirtualNetworkInterface] virtual_network_interfaces: A page of @@ -96399,25 +94817,24 @@ class VirtualNetworkInterfaceCollection: def __init__( self, - first: 'VirtualNetworkInterfaceCollectionFirst', + first: 'PageLink', limit: int, total_count: int, virtual_network_interfaces: List['VirtualNetworkInterface'], *, - next: Optional['VirtualNetworkInterfaceCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VirtualNetworkInterfaceCollection object. - :param VirtualNetworkInterfaceCollectionFirst first: A link to the first - page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. :param List[VirtualNetworkInterface] virtual_network_interfaces: A page of virtual network interfaces. - :param VirtualNetworkInterfaceCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -96431,7 +94848,7 @@ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollection': """Initialize a VirtualNetworkInterfaceCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = VirtualNetworkInterfaceCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VirtualNetworkInterfaceCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -96439,7 +94856,7 @@ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollection': else: raise ValueError('Required property \'limit\' not present in VirtualNetworkInterfaceCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VirtualNetworkInterfaceCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -96501,125 +94918,6 @@ def __ne__(self, other: 'VirtualNetworkInterfaceCollection') -> bool: return not self == other -class VirtualNetworkInterfaceCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VirtualNetworkInterfaceCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollectionFirst': - """Initialize a VirtualNetworkInterfaceCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VirtualNetworkInterfaceCollectionFirst 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 VirtualNetworkInterfaceCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VirtualNetworkInterfaceCollectionFirst') -> 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: 'VirtualNetworkInterfaceCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VirtualNetworkInterfaceCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VirtualNetworkInterfaceCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollectionNext': - """Initialize a VirtualNetworkInterfaceCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VirtualNetworkInterfaceCollectionNext 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 VirtualNetworkInterfaceCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VirtualNetworkInterfaceCollectionNext') -> 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: 'VirtualNetworkInterfaceCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VirtualNetworkInterfaceIPPrototype: """ VirtualNetworkInterfaceIPPrototype. @@ -96664,16 +94962,19 @@ class VirtualNetworkInterfacePatch: beginning with `ibm-` are reserved for provider-owned resources, and are not allowed. :param str protocol_state_filtering_mode: (optional) The protocol state - filtering mode used for this virtual network interface. If `auto`, protocol - state packet filtering is enabled or disabled based on the virtual network - interface's `target` resource type: + filtering mode to use for this virtual network interface. If + `auto`, protocol state packet filtering is enabled or disabled based on the + virtual network interface's `target` resource type: - `bare_metal_server_network_attachment`: disabled - `instance_network_attachment`: enabled - `share_mount_target`: enabled + Must not be `disabled` if the virtual network interface's `target` resource type + is + `share_mount_target`. Protocol state filtering monitors each network connection flowing over this virtual network interface, and drops any packets that are invalid based on the current connection state and protocol. See [Protocol state filtering - mode](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#protocol-state-filtering)) + mode](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#protocol-state-filtering) for more information. """ @@ -96710,16 +95011,19 @@ def __init__( region. Names beginning with `ibm-` are reserved for provider-owned resources, and are not allowed. :param str protocol_state_filtering_mode: (optional) The protocol state - filtering mode used for this virtual network interface. If `auto`, protocol - state packet filtering is enabled or disabled based on the virtual network - interface's `target` resource type: + filtering mode to use for this virtual network interface. If + `auto`, protocol state packet filtering is enabled or disabled based on the + virtual network interface's `target` resource type: - `bare_metal_server_network_attachment`: disabled - `instance_network_attachment`: enabled - `share_mount_target`: enabled + Must not be `disabled` if the virtual network interface's `target` resource + type is + `share_mount_target`. Protocol state filtering monitors each network connection flowing over this virtual network interface, and drops any packets that are invalid based on the current connection state and protocol. See [Protocol state filtering - mode](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#protocol-state-filtering)) + mode](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#protocol-state-filtering) for more information. """ self.allow_ip_spoofing = allow_ip_spoofing @@ -96784,16 +95088,19 @@ def __ne__(self, other: 'VirtualNetworkInterfacePatch') -> bool: class ProtocolStateFilteringModeEnum(str, Enum): """ - The protocol state filtering mode used for this virtual network interface. If + The protocol state filtering mode to use for this virtual network interface. If `auto`, protocol state packet filtering is enabled or disabled based on the virtual network interface's `target` resource type: - `bare_metal_server_network_attachment`: disabled - `instance_network_attachment`: enabled - `share_mount_target`: enabled + Must not be `disabled` if the virtual network interface's `target` resource type + is + `share_mount_target`. Protocol state filtering monitors each network connection flowing over this virtual network interface, and drops any packets that are invalid based on the current connection state and protocol. See [Protocol state filtering - mode](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#protocol-state-filtering)) + mode](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#protocol-state-filtering) for more information. """ @@ -97801,20 +96108,19 @@ class VolumeAttachmentDevice: """ VolumeAttachmentDevice. - :param str id: (optional) A unique identifier for the device which is exposed to - the instance operating system. + :param str id: A unique identifier for the device which is exposed to the + instance operating system. """ def __init__( self, - *, - id: Optional[str] = None, + id: str, ) -> None: """ Initialize a VolumeAttachmentDevice object. - :param str id: (optional) A unique identifier for the device which is - exposed to the instance operating system. + :param str id: A unique identifier for the device which is exposed to the + instance operating system. """ self.id = id @@ -97824,6 +96130,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentDevice': args = {} if (id := _dict.get('id')) is not None: args['id'] = id + else: + raise ValueError('Required property \'id\' not present in VolumeAttachmentDevice JSON') return cls(**args) @classmethod @@ -98676,11 +96984,11 @@ class VolumeCollection: """ VolumeCollection. - :param VolumeCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VolumeCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param int total_count: The total number of resources across all pages. :param List[Volume] volumes: A page of volumes. @@ -98688,23 +96996,23 @@ class VolumeCollection: def __init__( self, - first: 'VolumeCollectionFirst', + first: 'PageLink', limit: int, total_count: int, volumes: List['Volume'], *, - next: Optional['VolumeCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VolumeCollection object. - :param VolumeCollectionFirst first: A link to the first page of resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. :param List[Volume] volumes: A page of volumes. - :param VolumeCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -98718,7 +97026,7 @@ def from_dict(cls, _dict: Dict) -> 'VolumeCollection': """Initialize a VolumeCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = VolumeCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VolumeCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -98726,7 +97034,7 @@ def from_dict(cls, _dict: Dict) -> 'VolumeCollection': else: raise ValueError('Required property \'limit\' not present in VolumeCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VolumeCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (total_count := _dict.get('total_count')) is not None: args['total_count'] = total_count else: @@ -98788,125 +97096,6 @@ def __ne__(self, other: 'VolumeCollection') -> bool: return not self == other -class VolumeCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VolumeCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeCollectionFirst': - """Initialize a VolumeCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VolumeCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeCollectionFirst 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 VolumeCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeCollectionFirst') -> 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: 'VolumeCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VolumeCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VolumeCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeCollectionNext': - """Initialize a VolumeCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VolumeCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeCollectionNext 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 VolumeCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeCollectionNext') -> 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: 'VolumeCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VolumeHealthReason: """ VolumeHealthReason. @@ -99556,12 +97745,11 @@ class VolumeProfileCollection: """ VolumeProfileCollection. - :param VolumeProfileCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param VolumeProfileCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. :param List[VolumeProfile] profiles: A page of volume profiles. :param int total_count: The total number of resources across all pages. @@ -99569,24 +97757,23 @@ class VolumeProfileCollection: def __init__( self, - first: 'VolumeProfileCollectionFirst', + first: 'PageLink', limit: int, profiles: List['VolumeProfile'], total_count: int, *, - next: Optional['VolumeProfileCollectionNext'] = None, + next: Optional['PageLink'] = None, ) -> None: """ Initialize a VolumeProfileCollection object. - :param VolumeProfileCollectionFirst first: A link to the first page of - resources. + :param PageLink first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param List[VolumeProfile] profiles: A page of volume profiles. :param int total_count: The total number of resources across all pages. - :param VolumeProfileCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param PageLink next: (optional) A link to the next page of resources. This + property is present for all pages except the last page. """ self.first = first @@ -99600,7 +97787,7 @@ def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollection': """Initialize a VolumeProfileCollection object from a json dictionary.""" args = {} if (first := _dict.get('first')) is not None: - args['first'] = VolumeProfileCollectionFirst.from_dict(first) + args['first'] = PageLink.from_dict(first) else: raise ValueError('Required property \'first\' not present in VolumeProfileCollection JSON') if (limit := _dict.get('limit')) is not None: @@ -99608,7 +97795,7 @@ def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollection': else: raise ValueError('Required property \'limit\' not present in VolumeProfileCollection JSON') if (next := _dict.get('next')) is not None: - args['next'] = VolumeProfileCollectionNext.from_dict(next) + args['next'] = PageLink.from_dict(next) if (profiles := _dict.get('profiles')) is not None: args['profiles'] = [VolumeProfile.from_dict(v) for v in profiles] else: @@ -99670,125 +97857,6 @@ def __ne__(self, other: 'VolumeProfileCollection') -> bool: return not self == other -class VolumeProfileCollectionFirst: - """ - A link to the first page of resources. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VolumeProfileCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionFirst': - """Initialize a VolumeProfileCollectionFirst object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VolumeProfileCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeProfileCollectionFirst 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 VolumeProfileCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeProfileCollectionFirst') -> 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: 'VolumeProfileCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VolumeProfileCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :param str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VolumeProfileCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionNext': - """Initialize a VolumeProfileCollectionNext object from a json dictionary.""" - args = {} - if (href := _dict.get('href')) is not None: - args['href'] = href - else: - raise ValueError('Required property \'href\' not present in VolumeProfileCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeProfileCollectionNext 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 VolumeProfileCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeProfileCollectionNext') -> 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: 'VolumeProfileCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class VolumeProfileIOPS: """ VolumeProfileIOPS. @@ -109442,6 +107510,796 @@ def __ne__(self, other: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucke return not self == other +class ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext(ClusterNetworkInterfacePrimaryIPPrototype): + """ + Identifies a cluster network subnet reserved IP by a unique property. Required if + `subnet` is not specified. The cluster network subnet reserved IP must be currently + unbound. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById', 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref']) + ) + raise Exception(msg) + + +class ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext(ClusterNetworkInterfacePrimaryIPPrototype): + """ + The prototype for a new cluster network subnet reserved IP. Requires `subnet` to be + specified. + + :param str address: (optional) The IP address to reserve, which must not already + be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :param bool auto_delete: (optional) Indicates whether this cluster network + subnet reserved IP member will be automatically deleted when either `target` is + deleted, or the cluster network subnet reserved IP is unbound. + :param str name: (optional) The name for this cluster network subnet reserved + IP. The name must not be used by another reserved IP in the cluster network + subnet. Names starting with `ibm-` are reserved for provider-owned resources, + and are not allowed. If unspecified, the name will be a hyphenated list of + randomly-selected words. + """ + + def __init__( + self, + *, + address: Optional[str] = None, + auto_delete: Optional[bool] = None, + name: Optional[str] = None, + ) -> None: + """ + Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext object. + + :param str address: (optional) The IP address to reserve, which must not + already be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :param bool auto_delete: (optional) Indicates whether this cluster network + subnet reserved IP member will be automatically deleted when either + `target` is deleted, or the cluster network subnet reserved IP is unbound. + :param str name: (optional) The name for this cluster network subnet + reserved IP. The name must not be used by another reserved IP in the + cluster network subnet. Names starting with `ibm-` are reserved for + provider-owned resources, and are not allowed. If unspecified, the name + will be a hyphenated list of randomly-selected words. + """ + # pylint: disable=super-init-not-called + self.address = address + self.auto_delete = auto_delete + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext': + """Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext object from a json dictionary.""" + args = {} + if (address := _dict.get('address')) is not None: + args['address'] = address + if (auto_delete := _dict.get('auto_delete')) is not None: + args['auto_delete'] = auto_delete + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext 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, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + 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 ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext') -> 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: 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext(ClusterNetworkInterfaceTarget): + """ + ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext. + + :param str href: The URL for this instance cluster network attachment. + :param str id: The unique identifier for this instance cluster network + attachment. + :param str name: The name for this instance cluster network attachment. The name + is unique across all network attachments for the instance. + :param str resource_type: The resource type. + """ + + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + ) -> None: + """ + Initialize a ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext object. + + :param str href: The URL for this instance cluster network attachment. + :param str id: The unique identifier for this instance cluster network + attachment. + :param str name: The name for this instance cluster network attachment. The + name is unique across all network attachments for the instance. + :param str resource_type: The resource type. + """ + # pylint: disable=super-init-not-called + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext': + """Initialize a ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext object from a json dictionary.""" + args = {} + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext 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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + 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 ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext') -> 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: 'ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + INSTANCE_CLUSTER_NETWORK_ATTACHMENT = 'instance_cluster_network_attachment' + + + +class ClusterNetworkProfileIdentityByHref(ClusterNetworkProfileIdentity): + """ + ClusterNetworkProfileIdentityByHref. + + :param str href: The URL for this cluster network profile. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a ClusterNetworkProfileIdentityByHref object. + + :param str href: The URL for this cluster network profile. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkProfileIdentityByHref': + """Initialize a ClusterNetworkProfileIdentityByHref object from a json dictionary.""" + args = {} + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkProfileIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkProfileIdentityByHref 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 ClusterNetworkProfileIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkProfileIdentityByHref') -> 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: 'ClusterNetworkProfileIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ClusterNetworkProfileIdentityByName(ClusterNetworkProfileIdentity): + """ + ClusterNetworkProfileIdentityByName. + + :param str name: The globally unique name for this cluster network profile. + """ + + def __init__( + self, + name: str, + ) -> None: + """ + Initialize a ClusterNetworkProfileIdentityByName object. + + :param str name: The globally unique name for this cluster network profile. + """ + # pylint: disable=super-init-not-called + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkProfileIdentityByName': + """Initialize a ClusterNetworkProfileIdentityByName object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ClusterNetworkProfileIdentityByName JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkProfileIdentityByName 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 ClusterNetworkProfileIdentityByName object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkProfileIdentityByName') -> 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: 'ClusterNetworkProfileIdentityByName') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ClusterNetworkSubnetIdentityByHref(ClusterNetworkSubnetIdentity): + """ + ClusterNetworkSubnetIdentityByHref. + + :param str href: The URL for this cluster network subnet. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a ClusterNetworkSubnetIdentityByHref object. + + :param str href: The URL for this cluster network subnet. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetIdentityByHref': + """Initialize a ClusterNetworkSubnetIdentityByHref object from a json dictionary.""" + args = {} + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkSubnetIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkSubnetIdentityByHref 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 ClusterNetworkSubnetIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkSubnetIdentityByHref') -> 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: 'ClusterNetworkSubnetIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ClusterNetworkSubnetIdentityById(ClusterNetworkSubnetIdentity): + """ + ClusterNetworkSubnetIdentityById. + + :param str id: The unique identifier for this cluster network subnet. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a ClusterNetworkSubnetIdentityById object. + + :param str id: The unique identifier for this cluster network subnet. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetIdentityById': + """Initialize a ClusterNetworkSubnetIdentityById object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkSubnetIdentityById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkSubnetIdentityById 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 ClusterNetworkSubnetIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkSubnetIdentityById') -> 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: 'ClusterNetworkSubnetIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype(ClusterNetworkSubnetPrototype): + """ + ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype. + + :param str ip_version: (optional) The IP version(s) to support for this cluster + network subnet. + :param str name: (optional) The name for this cluster network subnet. The name + must not be used by another cluster network subnet in the cluster network. Names + starting with `ibm-` are reserved for provider-owned resources, and are not + allowed. If unspecified, the name will be a hyphenated list of randomly-selected + words. + :param str ipv4_cidr_block: The IPv4 range of the cluster network subnet, + expressed in CIDR format. The prefix length of the cluster network subnet's CIDR + must be between `/8` (16,777,216 addresses) and `/29` + (8 addresses). The IPv4 range of the cluster network subnet's CIDR must be + within the cluster network's `subnet_prefixes`. + The range must not overlap with any of the following reserved address ranges: + - `127.0.0.0/8` (IPv4 loopback addresses) + - `169.254.0.0/16` (IPv4 link-local addresses) + - `224.0.0.0/4` (IPv4 multicast addresses). + """ + + def __init__( + self, + ipv4_cidr_block: str, + *, + ip_version: Optional[str] = None, + name: Optional[str] = None, + ) -> None: + """ + Initialize a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype object. + + :param str ipv4_cidr_block: The IPv4 range of the cluster network subnet, + expressed in CIDR format. The prefix length of the cluster network subnet's + CIDR must be between `/8` (16,777,216 addresses) and `/29` + (8 addresses). The IPv4 range of the cluster network subnet's CIDR must be + within the cluster network's `subnet_prefixes`. + The range must not overlap with any of the following reserved address + ranges: + - `127.0.0.0/8` (IPv4 loopback addresses) + - `169.254.0.0/16` (IPv4 link-local addresses) + - `224.0.0.0/4` (IPv4 multicast addresses). + :param str ip_version: (optional) The IP version(s) to support for this + cluster network subnet. + :param str name: (optional) The name for this cluster network subnet. The + name must not be used by another cluster network subnet in the cluster + network. Names starting with `ibm-` are reserved for provider-owned + resources, and are not allowed. If unspecified, the name will be a + hyphenated list of randomly-selected words. + """ + # pylint: disable=super-init-not-called + self.ip_version = ip_version + self.name = name + self.ipv4_cidr_block = ipv4_cidr_block + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype': + """Initialize a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype object from a json dictionary.""" + args = {} + if (ip_version := _dict.get('ip_version')) is not None: + args['ip_version'] = ip_version + if (name := _dict.get('name')) is not None: + args['name'] = name + if (ipv4_cidr_block := _dict.get('ipv4_cidr_block')) is not None: + args['ipv4_cidr_block'] = ipv4_cidr_block + else: + raise ValueError('Required property \'ipv4_cidr_block\' not present in ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype 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, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'ipv4_cidr_block') and self.ipv4_cidr_block is not None: + _dict['ipv4_cidr_block'] = self.ipv4_cidr_block + 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 ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype') -> 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: 'ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class IpVersionEnum(str, Enum): + """ + The IP version(s) to support for this cluster network subnet. + """ + + IPV4 = 'ipv4' + + + +class ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype(ClusterNetworkSubnetPrototype): + """ + ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype. + + :param str ip_version: (optional) The IP version(s) to support for this cluster + network subnet. + :param str name: (optional) The name for this cluster network subnet. The name + must not be used by another cluster network subnet in the cluster network. Names + starting with `ibm-` are reserved for provider-owned resources, and are not + allowed. If unspecified, the name will be a hyphenated list of randomly-selected + words. + :param int total_ipv4_address_count: The total number of IPv4 addresses + required. Must be a power of 2. + A CIDR will be allocated from a subnet prefix in the cluster network that has an + `allocation_policy` of `auto`. There must be a subnet prefix that has a free + CIDR range with at least this number of addresses. + """ + + def __init__( + self, + total_ipv4_address_count: int, + *, + ip_version: Optional[str] = None, + name: Optional[str] = None, + ) -> None: + """ + Initialize a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype object. + + :param int total_ipv4_address_count: The total number of IPv4 addresses + required. Must be a power of 2. + A CIDR will be allocated from a subnet prefix in the cluster network that + has an + `allocation_policy` of `auto`. There must be a subnet prefix that has a + free CIDR range with at least this number of addresses. + :param str ip_version: (optional) The IP version(s) to support for this + cluster network subnet. + :param str name: (optional) The name for this cluster network subnet. The + name must not be used by another cluster network subnet in the cluster + network. Names starting with `ibm-` are reserved for provider-owned + resources, and are not allowed. If unspecified, the name will be a + hyphenated list of randomly-selected words. + """ + # pylint: disable=super-init-not-called + self.ip_version = ip_version + self.name = name + self.total_ipv4_address_count = total_ipv4_address_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype': + """Initialize a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype object from a json dictionary.""" + args = {} + if (ip_version := _dict.get('ip_version')) is not None: + args['ip_version'] = ip_version + if (name := _dict.get('name')) is not None: + args['name'] = name + if (total_ipv4_address_count := _dict.get('total_ipv4_address_count')) is not None: + args['total_ipv4_address_count'] = total_ipv4_address_count + else: + raise ValueError('Required property \'total_ipv4_address_count\' not present in ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype 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, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'total_ipv4_address_count') and self.total_ipv4_address_count is not None: + _dict['total_ipv4_address_count'] = self.total_ipv4_address_count + 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 ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype') -> 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: 'ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class IpVersionEnum(str, Enum): + """ + The IP version(s) to support for this cluster network subnet. + """ + + IPV4 = 'ipv4' + + + +class ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext(ClusterNetworkSubnetReservedIPTarget): + """ + ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext. + + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. + :param str href: The URL for this cluster network interface. + :param str id: The unique identifier for this cluster network interface. + :param str name: The name for this cluster network interface. The name is unique + across all interfaces in the cluster network. + :param str resource_type: The resource type. + """ + + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: Optional['Deleted'] = None, + ) -> None: + """ + Initialize a ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext object. + + :param str href: The URL for this cluster network interface. + :param str id: The unique identifier for this cluster network interface. + :param str name: The name for this cluster network interface. The name is + unique across all interfaces in the cluster network. + :param str resource_type: The resource type. + :param Deleted deleted: (optional) If present, this property indicates the + referenced resource has been deleted, and provides + some supplementary information. + """ + # pylint: disable=super-init-not-called + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext': + """Initialize a ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext object from a json dictionary.""" + args = {} + if (deleted := _dict.get('deleted')) is not None: + args['deleted'] = Deleted.from_dict(deleted) + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext JSON') + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext JSON') + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext JSON') + if (resource_type := _dict.get('resource_type')) is not None: + args['resource_type'] = resource_type + else: + raise ValueError('Required property \'resource_type\' not present in ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext 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, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + 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 ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext') -> 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: 'ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + CLUSTER_NETWORK_INTERFACE = 'cluster_network_interface' + + + class DNSInstanceIdentityByCRN(DNSInstanceIdentity): """ DNSInstanceIdentityByCRN. @@ -114366,6 +113224,280 @@ def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersio return not self == other +class InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref(InstanceClusterNetworkAttachmentBeforePrototype): + """ + InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref. + + :param str href: The URL for this instance cluster network attachment. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref object. + + :param str href: The URL for this instance cluster network attachment. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref': + """Initialize a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref object from a json dictionary.""" + args = {} + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref 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 InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref') -> 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: 'InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById(InstanceClusterNetworkAttachmentBeforePrototype): + """ + InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById. + + :param str id: The unique identifier for this instance cluster network + attachment. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById object. + + :param str id: The unique identifier for this instance cluster network + attachment. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById': + """Initialize a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById 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 InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById') -> 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: 'InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity(InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface): + """ + Identifies a cluster network interface by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById', 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref']) + ) + raise Exception(msg) + + +class InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment(InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterface): + """ + The cluster network interface for this target. + + :param bool auto_delete: (optional) Indicates whether this cluster network + interface will be automatically deleted when `target` is deleted. + :param str name: (optional) The name for this cluster network interface. The + name must not be used by another interface in the cluster network. Names + beginning with `ibm-` are reserved for provider-owned resources, and are not + allowed. If unspecified, the name will be a hyphenated list of randomly-selected + words. + :param ClusterNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The + primary IP address to bind to the cluster network interface. May be either + a cluster network subnet reserved IP identity, or a cluster network subnet + reserved IP + prototype object which will be used to create a new cluster network subnet + reserved IP. + If a cluster network subnet reserved IP identity is provided, the specified + cluster + network subnet reserved IP must be unbound. + If a cluster network subnet reserved IP prototype object with an address is + provided, + the address must be available on the cluster network interface's cluster network + subnet. If no address is specified, an available address on the cluster network + subnet + will be automatically selected and reserved. + :param ClusterNetworkSubnetIdentity subnet: (optional) The associated cluster + network subnet. Required if `primary_ip` does not specify a + cluster network subnet reserved IP identity. + """ + + def __init__( + self, + *, + auto_delete: Optional[bool] = None, + name: Optional[str] = None, + primary_ip: Optional['ClusterNetworkInterfacePrimaryIPPrototype'] = None, + subnet: Optional['ClusterNetworkSubnetIdentity'] = None, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment object. + + :param bool auto_delete: (optional) Indicates whether this cluster network + interface will be automatically deleted when `target` is deleted. + :param str name: (optional) The name for this cluster network interface. + The name must not be used by another interface in the cluster network. + Names beginning with `ibm-` are reserved for provider-owned resources, and + are not allowed. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param ClusterNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The + primary IP address to bind to the cluster network interface. May be either + a cluster network subnet reserved IP identity, or a cluster network subnet + reserved IP + prototype object which will be used to create a new cluster network subnet + reserved IP. + If a cluster network subnet reserved IP identity is provided, the specified + cluster + network subnet reserved IP must be unbound. + If a cluster network subnet reserved IP prototype object with an address is + provided, + the address must be available on the cluster network interface's cluster + network + subnet. If no address is specified, an available address on the cluster + network subnet + will be automatically selected and reserved. + :param ClusterNetworkSubnetIdentity subnet: (optional) The associated + cluster network subnet. Required if `primary_ip` does not specify a + cluster network subnet reserved IP identity. + """ + # pylint: disable=super-init-not-called + self.auto_delete = auto_delete + self.name = name + self.primary_ip = primary_ip + self.subnet = subnet + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment': + """Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment object from a json dictionary.""" + args = {} + if (auto_delete := _dict.get('auto_delete')) is not None: + args['auto_delete'] = auto_delete + if (name := _dict.get('name')) is not None: + args['name'] = name + if (primary_ip := _dict.get('primary_ip')) is not None: + args['primary_ip'] = primary_ip + if (subnet := _dict.get('subnet')) is not None: + args['subnet'] = subnet + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment 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, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment') -> 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: 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class InstanceGroupManagerActionPrototypeScheduledActionPrototype(InstanceGroupManagerActionPrototype): """ InstanceGroupManagerActionPrototypeScheduledActionPrototype. @@ -116802,6 +115934,256 @@ class TypeEnum(str, Enum): +class InstanceProfileClusterNetworkAttachmentCountDependent(InstanceProfileClusterNetworkAttachmentCount): + """ + The number of cluster network attachments supported on an instance with this profile + is dependent on its configuration. + + :param str type: The type for this profile field. + """ + + def __init__( + self, + type: str, + ) -> None: + """ + Initialize a InstanceProfileClusterNetworkAttachmentCountDependent object. + + :param str type: The type for this profile field. + """ + # pylint: disable=super-init-not-called + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileClusterNetworkAttachmentCountDependent': + """Initialize a InstanceProfileClusterNetworkAttachmentCountDependent object from a json dictionary.""" + args = {} + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in InstanceProfileClusterNetworkAttachmentCountDependent JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileClusterNetworkAttachmentCountDependent 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, 'type') and self.type is not None: + _dict['type'] = self.type + 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 InstanceProfileClusterNetworkAttachmentCountDependent object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileClusterNetworkAttachmentCountDependent') -> 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: 'InstanceProfileClusterNetworkAttachmentCountDependent') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + DEPENDENT = 'dependent' + + + +class InstanceProfileClusterNetworkAttachmentCountEnum(InstanceProfileClusterNetworkAttachmentCount): + """ + The permitted values for cluster network attachment count for an instance with this + profile. + + :param int default: (optional) + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. + """ + + def __init__( + self, + type: str, + values: List[int], + *, + default: Optional[int] = None, + ) -> None: + """ + Initialize a InstanceProfileClusterNetworkAttachmentCountEnum object. + + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. + :param int default: (optional) + """ + # pylint: disable=super-init-not-called + self.default = default + self.type = type + self.values = values + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileClusterNetworkAttachmentCountEnum': + """Initialize a InstanceProfileClusterNetworkAttachmentCountEnum object from a json dictionary.""" + args = {} + if (default := _dict.get('default')) is not None: + args['default'] = default + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in InstanceProfileClusterNetworkAttachmentCountEnum JSON') + if (values := _dict.get('values')) is not None: + args['values'] = values + else: + raise ValueError('Required property \'values\' not present in InstanceProfileClusterNetworkAttachmentCountEnum JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileClusterNetworkAttachmentCountEnum 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values + 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 InstanceProfileClusterNetworkAttachmentCountEnum object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileClusterNetworkAttachmentCountEnum') -> 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: 'InstanceProfileClusterNetworkAttachmentCountEnum') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + + + +class InstanceProfileClusterNetworkAttachmentCountRange(InstanceProfileClusterNetworkAttachmentCount): + """ + The number of network attachments supported on an instance with this profile. + + :param int max: (optional) The maximum value for this profile field. + :param int min: (optional) The minimum value for this profile field. + :param int step: (optional) + :param str type: The type for this profile field. + """ + + def __init__( + self, + type: str, + *, + max: Optional[int] = None, + min: Optional[int] = None, + step: Optional[int] = None, + ) -> None: + """ + Initialize a InstanceProfileClusterNetworkAttachmentCountRange object. + + :param str type: The type for this profile field. + :param int max: (optional) The maximum value for this profile field. + :param int min: (optional) The minimum value for this profile field. + :param int step: (optional) + """ + # pylint: disable=super-init-not-called + self.max = max + self.min = min + self.step = step + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileClusterNetworkAttachmentCountRange': + """Initialize a InstanceProfileClusterNetworkAttachmentCountRange object from a json dictionary.""" + args = {} + if (max := _dict.get('max')) is not None: + args['max'] = max + if (min := _dict.get('min')) is not None: + args['min'] = min + if (step := _dict.get('step')) is not None: + args['step'] = step + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in InstanceProfileClusterNetworkAttachmentCountRange JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileClusterNetworkAttachmentCountRange 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, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + 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 InstanceProfileClusterNetworkAttachmentCountRange object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileClusterNetworkAttachmentCountRange') -> 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: 'InstanceProfileClusterNetworkAttachmentCountRange') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + RANGE = 'range' + + + class InstanceProfileDiskQuantityDependent(InstanceProfileDiskQuantity): """ The number of disks of this configuration for an instance with this profile depends on @@ -119940,6 +119322,12 @@ class InstancePrototypeInstanceByCatalogOffering(InstancePrototype): :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -120015,6 +119403,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -120047,6 +119436,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -120136,6 +119532,12 @@ class InstancePrototypeInstanceByImage(InstancePrototype): :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -120205,6 +119607,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -120230,6 +119633,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -120318,6 +119728,12 @@ class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype): :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -120386,6 +119802,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -120411,6 +119828,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -120500,6 +119924,12 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -120588,6 +120018,7 @@ def __init__( source_template: 'InstanceTemplateIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -120618,6 +120049,13 @@ def __init__( this virtual server instance from. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -120709,6 +120147,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -120739,6 +120178,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -120802,6 +120243,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -120952,6 +120401,12 @@ class InstancePrototypeInstanceByVolume(InstancePrototype): :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -121019,6 +120474,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -121044,6 +120500,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -121309,6 +120772,12 @@ class InstanceTemplatePrototypeInstanceTemplateByCatalogOffering(InstanceTemplat :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -121383,6 +120852,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -121415,6 +120885,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -121503,6 +120980,12 @@ class InstanceTemplatePrototypeInstanceTemplateByImage(InstanceTemplatePrototype :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -121571,6 +121054,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -121596,6 +121080,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -121683,6 +121174,12 @@ class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(InstanceTemplate :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -121750,6 +121247,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -121775,6 +121273,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -121863,6 +121368,12 @@ class InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(InstanceTemplate :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -121950,6 +121461,7 @@ def __init__( source_template: 'InstanceTemplateIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -121980,6 +121492,13 @@ def __init__( this virtual server instance from. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -122070,6 +121589,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -122100,6 +121620,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByS args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -122163,6 +121685,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -122313,6 +121843,12 @@ class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(InstanceT :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -122398,6 +121934,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -122437,6 +121974,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -122520,6 +122064,12 @@ class InstanceTemplateInstanceByImageInstanceTemplateContext(InstanceTemplate): :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -122599,6 +122149,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -122631,6 +122182,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -122714,6 +122272,12 @@ class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(InstanceTe :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -122798,6 +122362,7 @@ def __init__( zone: 'ZoneIdentity', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -122833,6 +122398,13 @@ def __init__( in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -135388,7 +134960,6 @@ class ProtocolStateFilteringModeEnum(str, Enum): """ AUTO = 'auto' - DISABLED = 'disabled' ENABLED = 'enabled' @@ -135496,26 +135067,22 @@ class ShareProfileCapacityEnum(ShareProfileCapacity): """ The permitted total capacities (in gigabytes) of a share with this profile. - :param object default: The default value for this profile field. :param str type: The type for this profile field. :param List[int] values: The permitted values for this profile field. """ def __init__( self, - default: object, type: str, values: List[int], ) -> None: """ Initialize a ShareProfileCapacityEnum object. - :param object default: The default value for this profile field. :param str type: The type for this profile field. :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.default = default self.type = type self.values = values @@ -135523,10 +135090,6 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityEnum': """Initialize a ShareProfileCapacityEnum object from a json dictionary.""" args = {} - if (default := _dict.get('default')) is not None: - args['default'] = default - else: - raise ValueError('Required property \'default\' not present in ShareProfileCapacityEnum JSON') if (type := _dict.get('type')) is not None: args['type'] = type else: @@ -135545,8 +135108,6 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'values') and self.values is not None: @@ -136741,7 +136302,7 @@ class SharePrototypeShareBySourceShare(SharePrototype): size. :param str replication_cron_spec: The cron specification for the file share replication schedule. - Replication of a share can be scheduled to occur at most once per hour. + Replication of a share can be scheduled to occur at most once every 15 minutes. The scheduling frequency for this property may [increase](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -136785,7 +136346,8 @@ def __init__( and size. :param str replication_cron_spec: The cron specification for the file share replication schedule. - Replication of a share can be scheduled to occur at most once per hour. + Replication of a share can be scheduled to occur at most once every 15 + minutes. The scheduling frequency for this property may [increase](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -138253,9 +137815,9 @@ def __ne__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityById') -> return not self == other -class TrustedProfileIdentityTrustedProfileByCRN(TrustedProfileIdentity): +class TrustedProfileIdentityByCRN(TrustedProfileIdentity): """ - TrustedProfileIdentityTrustedProfileByCRN. + TrustedProfileIdentityByCRN. :param str crn: The CRN for this trusted profile. """ @@ -138265,7 +137827,7 @@ def __init__( crn: str, ) -> None: """ - Initialize a TrustedProfileIdentityTrustedProfileByCRN object. + Initialize a TrustedProfileIdentityByCRN object. :param str crn: The CRN for this trusted profile. """ @@ -138273,18 +137835,18 @@ def __init__( self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityTrustedProfileByCRN': - """Initialize a TrustedProfileIdentityTrustedProfileByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityByCRN': + """Initialize a TrustedProfileIdentityByCRN object from a json dictionary.""" args = {} if (crn := _dict.get('crn')) is not None: args['crn'] = crn else: - raise ValueError('Required property \'crn\' not present in TrustedProfileIdentityTrustedProfileByCRN JSON') + raise ValueError('Required property \'crn\' not present in TrustedProfileIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TrustedProfileIdentityTrustedProfileByCRN object from a json dictionary.""" + """Initialize a TrustedProfileIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -138299,23 +137861,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TrustedProfileIdentityTrustedProfileByCRN object.""" + """Return a `str` version of this TrustedProfileIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TrustedProfileIdentityTrustedProfileByCRN') -> bool: + def __eq__(self, other: 'TrustedProfileIdentityByCRN') -> 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: 'TrustedProfileIdentityTrustedProfileByCRN') -> bool: + def __ne__(self, other: 'TrustedProfileIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class TrustedProfileIdentityTrustedProfileById(TrustedProfileIdentity): +class TrustedProfileIdentityById(TrustedProfileIdentity): """ - TrustedProfileIdentityTrustedProfileById. + TrustedProfileIdentityById. :param str id: The unique identifier for this trusted profile. """ @@ -138325,7 +137887,7 @@ def __init__( id: str, ) -> None: """ - Initialize a TrustedProfileIdentityTrustedProfileById object. + Initialize a TrustedProfileIdentityById object. :param str id: The unique identifier for this trusted profile. """ @@ -138333,18 +137895,18 @@ def __init__( self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityTrustedProfileById': - """Initialize a TrustedProfileIdentityTrustedProfileById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityById': + """Initialize a TrustedProfileIdentityById object from a json dictionary.""" args = {} if (id := _dict.get('id')) is not None: args['id'] = id else: - raise ValueError('Required property \'id\' not present in TrustedProfileIdentityTrustedProfileById JSON') + raise ValueError('Required property \'id\' not present in TrustedProfileIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a TrustedProfileIdentityTrustedProfileById object from a json dictionary.""" + """Initialize a TrustedProfileIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -138359,16 +137921,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this TrustedProfileIdentityTrustedProfileById object.""" + """Return a `str` version of this TrustedProfileIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'TrustedProfileIdentityTrustedProfileById') -> bool: + def __eq__(self, other: 'TrustedProfileIdentityById') -> 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: 'TrustedProfileIdentityTrustedProfileById') -> bool: + def __ne__(self, other: 'TrustedProfileIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -146290,6 +145852,128 @@ def __ne__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetwork return not self == other +class ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref(ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext): + """ + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref. + + :param str href: The URL for this cluster network subnet reserved IP. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref object. + + :param str href: The URL for this cluster network subnet reserved IP. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref': + """Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref object from a json dictionary.""" + args = {} + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref 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 ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref') -> 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: 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById(ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContext): + """ + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById. + + :param str id: The unique identifier for this cluster network subnet reserved + IP. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById object. + + :param str id: The unique identifier for this cluster network subnet + reserved IP. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById': + """Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById 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 ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById') -> 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: 'ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class EndpointGatewayReservedIPReservedIPIdentityByHref(EndpointGatewayReservedIPReservedIPIdentity): """ EndpointGatewayReservedIPReservedIPIdentityByHref. @@ -148313,6 +147997,126 @@ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceI return not self == other +class InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref(InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity): + """ + InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref. + + :param str href: The URL for this cluster network interface. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref object. + + :param str href: The URL for this cluster network interface. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref': + """Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref object from a json dictionary.""" + args = {} + if (href := _dict.get('href')) is not None: + args['href'] = href + else: + raise ValueError('Required property \'href\' not present in InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref 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 InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref') -> 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: 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById(InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentity): + """ + InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById. + + :param str id: The unique identifier for this cluster network interface. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById object. + + :param str id: The unique identifier for this cluster network interface. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById': + """Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + else: + raise ValueError('Required property \'id\' not present in InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById 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 InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById') -> 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: 'InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(InstanceGroupManagerActionPrototypeScheduledActionPrototype): """ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec. @@ -150165,6 +149969,12 @@ class InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanc :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -150238,6 +150048,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -150265,6 +150076,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -150334,6 +150152,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -150360,6 +150179,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOfferingIn args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -150419,6 +150240,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -150546,6 +150375,12 @@ class InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanc :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -150619,6 +150454,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -150646,6 +150482,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -150714,6 +150557,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -150740,6 +150584,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOfferingIn args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -150799,6 +150645,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -150926,6 +150780,12 @@ class InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -151000,6 +150860,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -151028,6 +150889,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -151097,6 +150965,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -151123,6 +150992,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImageInstanceByIm args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -151182,6 +151053,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -151309,6 +151188,12 @@ class InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface( :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -151383,6 +151268,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -151411,6 +151297,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -151479,6 +151372,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -151505,6 +151399,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImageInstanceByIm args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -151564,6 +151460,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -151691,6 +151595,12 @@ class InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceB :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -151764,6 +151674,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -151792,6 +151703,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -151858,6 +151776,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -151883,6 +151802,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshotIns args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -151940,6 +151861,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -152062,6 +151991,12 @@ class InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceB :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -152135,6 +152070,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -152163,6 +152099,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -152228,6 +152171,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -152253,6 +152197,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshotIns args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -152310,6 +152256,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -152432,6 +152386,12 @@ class InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachme :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -152504,6 +152464,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -152532,6 +152493,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -152598,6 +152566,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -152623,6 +152592,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolumeInstanceByV args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -152680,6 +152651,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -152802,6 +152781,12 @@ class InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfac :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -152874,6 +152859,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -152902,6 +152888,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -152967,6 +152960,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -152992,6 +152986,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolumeInstanceByV args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -153049,6 +153045,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -153171,6 +153175,12 @@ class InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplate :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -153243,6 +153253,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -153270,6 +153281,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -153338,6 +153356,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -153364,6 +153383,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByC args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -153423,6 +153444,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -153550,6 +153579,12 @@ class InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplate :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -153622,6 +153657,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -153649,6 +153685,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -153716,6 +153759,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -153742,6 +153786,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByC args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -153801,6 +153847,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -153928,6 +153982,12 @@ class InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageIns :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -154001,6 +154061,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -154029,6 +154090,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -154097,6 +154165,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -154123,6 +154192,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByI args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -154182,6 +154253,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -154309,6 +154388,12 @@ class InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageIns :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -154382,6 +154467,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -154410,6 +154496,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -154477,6 +154570,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -154503,6 +154597,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByI args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -154562,6 +154658,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -154689,6 +154793,12 @@ class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateB :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -154761,6 +154871,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -154789,6 +154900,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -154854,6 +154972,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -154879,6 +154998,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByS args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -154936,6 +155057,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -155058,6 +155187,12 @@ class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateB :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -155130,6 +155265,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -155158,6 +155294,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -155222,6 +155365,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.default_trusted_profile = default_trusted_profile self.enable_secure_boot = enable_secure_boot @@ -155247,6 +155391,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByS args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None: @@ -155304,6 +155450,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: @@ -155426,6 +155580,12 @@ class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceBy :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -155509,6 +155669,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -155543,6 +155704,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -155607,6 +155775,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.created_at = created_at self.crn = crn @@ -155637,6 +155806,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOfferingIns args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (created_at := _dict.get('created_at')) is not None: @@ -155716,6 +155887,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'created_at') and self.created_at is not None: @@ -155851,6 +156030,12 @@ class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceBy :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -155934,6 +156119,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -155968,6 +156154,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -156031,6 +156224,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.created_at = created_at self.crn = crn @@ -156061,6 +156255,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOfferingIns args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (created_at := _dict.get('created_at')) is not None: @@ -156140,6 +156336,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'created_at') and self.created_at is not None: @@ -156275,6 +156479,12 @@ class InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInsta :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -156359,6 +156569,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -156394,6 +156605,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -156458,6 +156676,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.created_at = created_at self.crn = crn @@ -156488,6 +156707,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImageInstanceTempl args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (created_at := _dict.get('created_at')) is not None: @@ -156567,6 +156788,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'created_at') and self.created_at is not None: @@ -156702,6 +156931,12 @@ class InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInsta :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -156786,6 +157021,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -156821,6 +157057,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -156884,6 +157127,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.created_at = created_at self.crn = crn @@ -156914,6 +157158,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImageInstanceTempl args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (created_at := _dict.get('created_at')) is not None: @@ -156993,6 +157239,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'created_at') and self.created_at is not None: @@ -157128,6 +157382,12 @@ class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceByS :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -157213,6 +157473,7 @@ def __init__( primary_network_attachment: 'InstanceNetworkAttachmentPrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -157249,6 +157510,13 @@ def __init__( primary network attachment to create for the virtual server instance. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -157312,6 +157580,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.created_at = created_at self.crn = crn @@ -157342,6 +157611,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshotInst args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (created_at := _dict.get('created_at')) is not None: @@ -157421,6 +157692,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'created_at') and self.created_at is not None: @@ -157559,6 +157838,12 @@ class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceByS :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment represents + a device that is connected to a cluster network. The number of network + attachments must match one of the values from the instance profile's + `cluster_network_attachment_count` before the instance can be started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will be @@ -157646,6 +157931,7 @@ def __init__( primary_network_interface: 'NetworkInterfacePrototype', *, availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None, + cluster_network_attachments: Optional[List['InstanceClusterNetworkAttachmentPrototypeInstanceContext']] = None, confidential_compute_mode: Optional[str] = None, default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None, enable_secure_boot: Optional[bool] = None, @@ -157683,6 +157969,13 @@ def __init__( instance network interface to create. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :param List[InstanceClusterNetworkAttachmentPrototypeInstanceContext] + cluster_network_attachments: (optional) The cluster network attachments to + create for this virtual server instance. A cluster network attachment + represents a device that is connected to a cluster network. The number of + network attachments must match one of the values from the instance + profile's `cluster_network_attachment_count` before the instance can be + started. :param str confidential_compute_mode: (optional) The confidential compute mode to use for this virtual server instance. If unspecified, the default confidential compute mode from the profile will @@ -157749,6 +158042,7 @@ def __init__( """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.cluster_network_attachments = cluster_network_attachments self.confidential_compute_mode = confidential_compute_mode self.created_at = created_at self.crn = crn @@ -157780,6 +158074,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshotInst args = {} if (availability_policy := _dict.get('availability_policy')) is not None: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy) + if (cluster_network_attachments := _dict.get('cluster_network_attachments')) is not None: + args['cluster_network_attachments'] = [InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(v) for v in cluster_network_attachments] if (confidential_compute_mode := _dict.get('confidential_compute_mode')) is not None: args['confidential_compute_mode'] = confidential_compute_mode if (created_at := _dict.get('created_at')) is not None: @@ -157861,6 +158157,14 @@ def to_dict(self) -> Dict: _dict['availability_policy'] = self.availability_policy else: _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'cluster_network_attachments') and self.cluster_network_attachments is not None: + cluster_network_attachments_list = [] + for v in self.cluster_network_attachments: + if isinstance(v, dict): + cluster_network_attachments_list.append(v) + else: + cluster_network_attachments_list.append(v.to_dict()) + _dict['cluster_network_attachments'] = cluster_network_attachments_list if hasattr(self, 'confidential_compute_mode') and self.confidential_compute_mode is not None: _dict['confidential_compute_mode'] = self.confidential_compute_mode if hasattr(self, 'created_at') and self.created_at is not None: @@ -162208,7 +162512,7 @@ def has_next(self) -> bool: def get_next(self) -> List[dict]: """ Returns the next page of results. - :return: A List[dict], where each element is a dict that represents an instance of RouteCollectionVPCContextRoutesItem. + :return: A List[dict], where each element is a dict that represents an instance of Route. :rtype: List[dict] """ if not self.has_next(): @@ -162235,7 +162539,7 @@ def get_all(self) -> List[dict]: """ Returns all results by invoking get_next() repeatedly until all pages of results have been retrieved. - :return: A List[dict], where each element is a dict that represents an instance of RouteCollectionVPCContextRoutesItem. + :return: A List[dict], where each element is a dict that represents an instance of Route. :rtype: List[dict] """ results = [] @@ -162752,15 +163056,20 @@ def __init__( *, client: VpcV1, limit: int = None, + resource_group_id: str = None, ) -> None: """ Initialize a KeysPager object. :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. """ self._has_next = True self._client = client self._page_context = {'next': None} self._limit = limit + self._resource_group_id = resource_group_id def has_next(self) -> bool: """ @@ -162779,6 +163088,7 @@ def get_next(self) -> List[dict]: result = self._client.list_keys( limit=self._limit, + resource_group_id=self._resource_group_id, start=self._page_context.get('next'), ).get_result() @@ -162818,6 +163128,9 @@ def __init__( limit: int = None, resource_group_id: str = None, name: str = None, + cluster_network_id: str = None, + cluster_network_crn: str = None, + cluster_network_name: str = None, dedicated_host_id: str = None, dedicated_host_crn: str = None, dedicated_host_name: str = None, @@ -162839,6 +163152,14 @@ def __init__( identifier. :param str name: (optional) Filters the collection to resources with a `name` property matching the exact specified name. + :param str cluster_network_id: (optional) Filters the collection to + instances with a `cluster_network.id` property matching the specified + identifier. + :param str cluster_network_crn: (optional) Filters the collection to + instances with a `cluster_network.crn` property matching the specified CRN. + :param str cluster_network_name: (optional) Filters the collection to + resources with a `cluster_network.name` property matching the exact + specified name. :param str dedicated_host_id: (optional) Filters the collection to resources with a `dedicated_host.id` property matching the specified identifier. @@ -162875,6 +163196,9 @@ def __init__( self._limit = limit self._resource_group_id = resource_group_id self._name = name + self._cluster_network_id = cluster_network_id + self._cluster_network_crn = cluster_network_crn + self._cluster_network_name = cluster_network_name self._dedicated_host_id = dedicated_host_id self._dedicated_host_crn = dedicated_host_crn self._dedicated_host_name = dedicated_host_name @@ -162907,6 +163231,9 @@ def get_next(self) -> List[dict]: limit=self._limit, resource_group_id=self._resource_group_id, name=self._name, + cluster_network_id=self._cluster_network_id, + cluster_network_crn=self._cluster_network_crn, + cluster_network_name=self._cluster_network_name, dedicated_host_id=self._dedicated_host_id, dedicated_host_crn=self._dedicated_host_crn, dedicated_host_name=self._dedicated_host_name, @@ -162946,6 +163273,74 @@ def get_all(self) -> List[dict]: return results +class InstanceClusterNetworkAttachmentsPager: + """ + InstanceClusterNetworkAttachmentsPager can be used to simplify the use of the "list_instance_cluster_network_attachments" method. + """ + + def __init__( + self, + *, + client: VpcV1, + instance_id: str, + limit: int = None, + ) -> None: + """ + Initialize a InstanceClusterNetworkAttachmentsPager object. + :param str instance_id: The virtual server instance identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._instance_id = instance_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of InstanceClusterNetworkAttachment. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_instance_cluster_network_attachments( + instance_id=self._instance_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('cluster_network_attachments') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of InstanceClusterNetworkAttachment. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + class InstanceNetworkInterfaceIpsPager: """ InstanceNetworkInterfaceIpsPager can be used to simplify the use of the "list_instance_network_interface_ips" method. @@ -165183,6 +165578,416 @@ def get_all(self) -> List[dict]: return results +class ClusterNetworkProfilesPager: + """ + ClusterNetworkProfilesPager can be used to simplify the use of the "list_cluster_network_profiles" method. + """ + + def __init__( + self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a ClusterNetworkProfilesPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetworkProfile. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_cluster_network_profiles( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('profiles') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetworkProfile. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + +class ClusterNetworksPager: + """ + ClusterNetworksPager can be used to simplify the use of the "list_cluster_networks" method. + """ + + def __init__( + self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + name: str = None, + sort: str = None, + vpc_id: str = None, + vpc_crn: str = None, + vpc_name: str = None, + ) -> None: + """ + Initialize a ClusterNetworksPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str vpc_id: (optional) Filters the collection to cluster networks + with a `vpc.id` property matching the specified id. + :param str vpc_crn: (optional) Filters the collection to cluster networks + with a `vpc.crn` property matching the specified CRN. + :param str vpc_name: (optional) Filters the collection to cluster networks + with a `vpc.name` property matching the specified name. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._limit = limit + self._resource_group_id = resource_group_id + self._name = name + self._sort = sort + self._vpc_id = vpc_id + self._vpc_crn = vpc_crn + self._vpc_name = vpc_name + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetwork. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_cluster_networks( + limit=self._limit, + resource_group_id=self._resource_group_id, + name=self._name, + sort=self._sort, + vpc_id=self._vpc_id, + vpc_crn=self._vpc_crn, + vpc_name=self._vpc_name, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('cluster_networks') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetwork. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + +class ClusterNetworkInterfacesPager: + """ + ClusterNetworkInterfacesPager can be used to simplify the use of the "list_cluster_network_interfaces" method. + """ + + def __init__( + self, + *, + client: VpcV1, + cluster_network_id: str, + limit: int = None, + name: str = None, + sort: str = None, + ) -> None: + """ + Initialize a ClusterNetworkInterfacesPager object. + :param str cluster_network_id: The cluster network identifier. + :param int limit: (optional) The number of resources to return on a page. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._cluster_network_id = cluster_network_id + self._limit = limit + self._name = name + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetworkInterface. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_cluster_network_interfaces( + cluster_network_id=self._cluster_network_id, + limit=self._limit, + name=self._name, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('interfaces') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetworkInterface. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + +class ClusterNetworkSubnetsPager: + """ + ClusterNetworkSubnetsPager can be used to simplify the use of the "list_cluster_network_subnets" method. + """ + + def __init__( + self, + *, + client: VpcV1, + cluster_network_id: str, + limit: int = None, + name: str = None, + sort: str = None, + ) -> None: + """ + Initialize a ClusterNetworkSubnetsPager object. + :param str cluster_network_id: The cluster network identifier. + :param int limit: (optional) The number of resources to return on a page. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._cluster_network_id = cluster_network_id + self._limit = limit + self._name = name + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetworkSubnet. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_cluster_network_subnets( + cluster_network_id=self._cluster_network_id, + limit=self._limit, + name=self._name, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('subnets') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetworkSubnet. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + +class ClusterNetworkSubnetReservedIpsPager: + """ + ClusterNetworkSubnetReservedIpsPager can be used to simplify the use of the "list_cluster_network_subnet_reserved_ips" method. + """ + + def __init__( + self, + *, + client: VpcV1, + cluster_network_id: str, + cluster_network_subnet_id: str, + limit: int = None, + name: str = None, + sort: str = None, + ) -> None: + """ + Initialize a ClusterNetworkSubnetReservedIpsPager object. + :param str cluster_network_id: The cluster network identifier. + :param str cluster_network_subnet_id: The cluster network subnet + identifier. + :param int limit: (optional) The number of resources to return on a page. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._cluster_network_id = cluster_network_id + self._cluster_network_subnet_id = cluster_network_subnet_id + self._limit = limit + self._name = name + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetworkSubnetReservedIP. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_cluster_network_subnet_reserved_ips( + cluster_network_id=self._cluster_network_id, + cluster_network_subnet_id=self._cluster_network_subnet_id, + limit=self._limit, + name=self._name, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('reserved_ips') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ClusterNetworkSubnetReservedIP. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + class PublicGatewaysPager: """ PublicGatewaysPager can be used to simplify the use of the "list_public_gateways" method. diff --git a/requirements-dev.txt b/requirements-dev.txt index b9a5528..ee9c4c5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,8 @@ # test dependencies -coverage>=4.5.4 -pylint>=2.6.0,<3.0.0 -pytest>=7.0.1,<8.0.0 -pytest-cov>=2.2.1,<3.0.0 -pytest-rerunfailures>=3.1 -responses>=0.12.1,<1.0.0 -tox>=3.2.0,<4.0.0 +coverage>=7.3.2 +pylint>=3.0.0,<4.0.0 +pytest>=7.4.2,<8.0.0 +pytest-cov>=4.1.0,<5.0.0 +pytest-rerunfailures>=12.0 +responses>=0.23.3,<1.0.0 +tox>=4.12.0,<4.23.2 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f9ce78f..77864b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ python_dateutil>=2.5.3,<3.0.0 -ibm_cloud_sdk_core>=3.20.3 \ No newline at end of file +ibm_cloud_sdk_core>=3.22.0 \ No newline at end of file diff --git a/test/integration/test_gen2.py b/test/integration/test_gen2.py index debd54f..26501ff 100644 --- a/test/integration/test_gen2.py +++ b/test/integration/test_gen2.py @@ -662,6 +662,102 @@ def test_create_instance_action(self, createGen2Service): assert instance.status_code == 201 assert instance.get_result()['id'] is not None + + def test_list_instance_cluster_network_attachments(self, createGen2Service): + response = createGen2Service.list_instance_cluster_network_attachments( + instance_id=store['created_instance_id'], + limit=50, + ) + + assert response.get_status_code() == 200 + instance_cluster_network_attachment_collection = response.get_result() + assert instance_cluster_network_attachment_collection is not None + + def test_list_instance_cluster_network_attachments_with_pager(self, createGen2Service): + all_results = [] + + # Test get_next(). + pager = InstanceClusterNetworkAttachmentsPager( + client=createGen2Service, + instance_id=store['created_instance_id'], + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + # Test get_all(). + pager = InstanceClusterNetworkAttachmentsPager( + client=createGen2Service, + instance_id=store['created_instance_id'], + limit=10, + ) + all_items = pager.get_all() + assert all_items is not None + + assert len(all_results) == len(all_items) + print(f'\nlist_instance_cluster_network_attachments() returned a total of {len(all_results)} items(s) using InstanceClusterNetworkAttachmentsPager.') + + def test_create_cluster_network_attachment(self, createGen2Service): + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = { + 'address': '10.0.0.5', + 'auto_delete': False, + 'name': 'my-cluster-network-subnet-reserved-ip', + } + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = { + 'id': store['created_cluster_network_subnet_id'], + } + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + instance_cluster_network_attachment_prototype_cluster_network_interface_model = { + 'auto_delete': False, + 'name': 'my-cluster-network-interface', + 'primary_ip': cluster_network_interface_primary_ip_prototype_model, + 'subnet': cluster_network_subnet_identity_model, + } + # Construct a dict representation of a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById model + + + response = createGen2Service.create_cluster_network_attachment( + instance_id=store['created_instance_id'], + cluster_network_interface=instance_cluster_network_attachment_prototype_cluster_network_interface_model, + name='my-instance-network-attachment', + ) + + assert response.get_status_code() == 201 + instance_cluster_network_attachment = response.get_result() + assert instance_cluster_network_attachment is not None + store['created_instance_cluster_network_attachment_id'] = instance_cluster_network_attachment['id'] + + def test_get_instance_cluster_network_attachment(self, createGen2Service): + response = createGen2Service.get_instance_cluster_network_attachment( + instance_id=store['created_instance_id'], + id=store['created_instance_cluster_network_attachment_id'], + ) + + assert response.get_status_code() == 200 + instance_cluster_network_attachment = response.get_result() + assert instance_cluster_network_attachment is not None + + def test_update_instance_cluster_network_attachment(self, createGen2Service): + # Construct a dict representation of a InstanceClusterNetworkAttachmentPatch model + instance_cluster_network_attachment_patch_model = { + 'name': 'my-instance-network-attachment-updated', + } + + response = createGen2Service.update_instance_cluster_network_attachment( + instance_id=store['created_instance_id'], + id=store['created_instance_cluster_network_attachment_id'], + instance_cluster_network_attachment_patch=instance_cluster_network_attachment_patch_model, + ) + + assert response.get_status_code() == 200 + instance_cluster_network_attachment = response.get_result() + assert instance_cluster_network_attachment is not None + + def test_get_instance_initialization(self, createGen2Service): instance = get_instance_initialization( createGen2Service, store['created_instance_id']) @@ -714,6 +810,16 @@ def test_delete_instance_nic_fip(self, createGen2Service): createGen2Service, store['created_instance_id'], store['nic_id'], store['created_fip_id']) assertDeleteResponse(fips) + def test_delete_instance_cluster_network_attachment(self, createGen2Service): + response = createGen2Service.delete_instance_cluster_network_attachment( + instance_id=store['created_instance_id'], + id='testString', + ) + + assert response.get_status_code() == 202 + instance_cluster_network_attachment = response.get_result() + assert instance_cluster_network_attachment is not None + def test_list_instance_network_interface_ips(self, createGen2Service): ips = list_instance_network_interface_ips( createGen2Service, store['created_instance_id'], store['nic_id']) @@ -806,6 +912,476 @@ def test_delete_snapshots(self, createGen2Service): response = delete_snapshots(createGen2Service, store['created_vol']) assertDeleteResponse(response) +class TestClusterNetworks(): + + + def test_list_cluster_network_profiles(self, createGen2Service): + response = createGen2Service.list_cluster_network_profiles( + limit=50, + ) + + assert response.get_status_code() == 200 + cluster_network_profile_collection = response.get_result() + assert cluster_network_profile_collection is not None + + + def test_list_cluster_network_profiles_with_pager(self, createGen2Service): + all_results = [] + + # Test get_next(). + pager = ClusterNetworkProfilesPager( + client=createGen2Service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + # Test get_all(). + pager = ClusterNetworkProfilesPager( + client=createGen2Service, + limit=10, + ) + all_items = pager.get_all() + assert all_items is not None + + assert len(all_results) == len(all_items) + print(f'\nlist_cluster_network_profiles() returned a total of {len(all_results)} items(s) using ClusterNetworkProfilesPager.') + store['cluster_network_profile'] = all_items[0]['name'] + + def test_get_cluster_network_profile(self, createGen2Service): + response = createGen2Service.get_cluster_network_profile( + name=store['cluster_network_profile'], + ) + + assert response.get_status_code() == 200 + cluster_network_profile = response.get_result() + assert cluster_network_profile is not None + + + def test_list_cluster_networks(self, createGen2Service): + response = createGen2Service.list_cluster_networks( + limit=50, + sort='name', + vpc_id=store['created_vpc'], + ) + + assert response.get_status_code() == 200 + cluster_network_collection = response.get_result() + assert cluster_network_collection is not None + + + def test_list_cluster_networks_with_pager(self, createGen2Service): + all_results = [] + + # Test get_next(). + pager = ClusterNetworksPager( + client=createGen2Service, + limit=10, + sort='name', + vpc_id=store['created_vpc'], + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + # Test get_all(). + pager = ClusterNetworksPager( + client=createGen2Service, + limit=10, + sort='name', + vpc_id=store['created_vpc'], + ) + all_items = pager.get_all() + assert all_items is not None + + assert len(all_results) == len(all_items) + print(f'\nlist_cluster_networks() returned a total of {len(all_results)} items(s) using ClusterNetworksPager.') + + + def test_create_cluster_network(self, createGen2Service): + # Construct a dict representation of a ClusterNetworkProfileIdentityByName model + cluster_network_profile_identity_model = { + 'name': store['cluster_network_profile'], + } + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = { + 'id': store['created_vpc'], + } + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = { + 'name': store['zone'], + } + # Construct a dict representation of a ClusterNetworkSubnetPrefixPrototype model + cluster_network_subnet_prefix_prototype_model = { + 'cidr': '10.0.0.0/24', + } + + response = createGen2Service.create_cluster_network( + profile=cluster_network_profile_identity_model, + vpc=vpc_identity_model, + zone=zone_identity_model, + name='my-cluster-network', + subnet_prefixes=[cluster_network_subnet_prefix_prototype_model], + ) + + assert response.get_status_code() == 201 + cluster_network = response.get_result() + assert cluster_network is not None + store['created_cluster_network_id'] = cluster_network['id'] + + + def test_list_cluster_network_interfaces(self, createGen2Service): + response = createGen2Service.list_cluster_network_interfaces( + cluster_network_id=store['created_cluster_network_id'], + limit=50, + sort='name', + ) + + assert response.get_status_code() == 200 + cluster_network_interface_collection = response.get_result() + assert cluster_network_interface_collection is not None + + + def test_list_cluster_network_interfaces_with_pager(self, createGen2Service): + all_results = [] + + # Test get_next(). + pager = ClusterNetworkInterfacesPager( + client=createGen2Service, + cluster_network_id=store['created_cluster_network_id'], + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + # Test get_all(). + pager = ClusterNetworkInterfacesPager( + client=createGen2Service, + cluster_network_id=store['created_cluster_network_id'], + limit=10, + sort='name', + ) + all_items = pager.get_all() + assert all_items is not None + + assert len(all_results) == len(all_items) + print(f'\nlist_cluster_network_interfaces() returned a total of {len(all_results)} items(s) using ClusterNetworkInterfacesPager.') + + + def test_create_cluster_network_interface(self, createGen2Service): + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = { + 'address': '10.0.0.5', + 'auto_delete': False, + 'name': 'my-cluster-network-subnet-reserved-ip', + } + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = { + 'id': '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930', + } + + response = createGen2Service.create_cluster_network_interface( + cluster_network_id=store['created_cluster_network_id'], + name='my-cluster-network-interface', + primary_ip=cluster_network_interface_primary_ip_prototype_model, + subnet=cluster_network_subnet_identity_model, + ) + + assert response.get_status_code() == 201 + cluster_network_interface = response.get_result() + assert cluster_network_interface is not None + store['created_cluster_network_interface_id'] = cluster_network_interface['id'] + + + def test_get_cluster_network_interface(self, createGen2Service): + response = createGen2Service.get_cluster_network_interface( + cluster_network_id=store['created_cluster_network_id'], + id='testString', + ) + + assert response.get_status_code() == 200 + cluster_network_interface = response.get_result() + assert cluster_network_interface is not None + + + def test_update_cluster_network_interface(self, createGen2Service): + # Construct a dict representation of a ClusterNetworkInterfacePatch model + cluster_network_interface_patch_model = { + 'auto_delete': False, + 'name': 'my-cluster-network-interface', + } + + response = createGen2Service.update_cluster_network_interface( + cluster_network_id=store['created_cluster_network_id'], + id='testString', + cluster_network_interface_patch=cluster_network_interface_patch_model, + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + + assert response.get_status_code() == 200 + cluster_network_interface = response.get_result() + assert cluster_network_interface is not None + + + def test_list_cluster_network_subnets(self, createGen2Service): + response = createGen2Service.list_cluster_network_subnets( + cluster_network_id=store['created_cluster_network_id'], + limit=50, + sort='name', + ) + + assert response.get_status_code() == 200 + cluster_network_subnet_collection = response.get_result() + assert cluster_network_subnet_collection is not None + + + def test_list_cluster_network_subnets_with_pager(self, createGen2Service): + all_results = [] + + # Test get_next(). + pager = ClusterNetworkSubnetsPager( + client=createGen2Service, + cluster_network_id=store['created_cluster_network_id'], + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + # Test get_all(). + pager = ClusterNetworkSubnetsPager( + client=createGen2Service, + cluster_network_id=store['created_cluster_network_id'], + limit=10, + sort='name', + ) + all_items = pager.get_all() + assert all_items is not None + + assert len(all_results) == len(all_items) + print(f'\nlist_cluster_network_subnets() returned a total of {len(all_results)} items(s) using ClusterNetworkSubnetsPager.') + + + def test_create_cluster_network_subnet(self, createGen2Service): + # Construct a dict representation of a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model + cluster_network_subnet_prototype_model = { + 'ip_version': 'ipv4', + 'name': 'my-cluster-network-subnet', + 'total_ipv4_address_count': 256, + } + + response = createGen2Service.create_cluster_network_subnet( + cluster_network_id=store['created_cluster_network_id'], + cluster_network_subnet_prototype=cluster_network_subnet_prototype_model, + ) + + assert response.get_status_code() == 201 + cluster_network_subnet = response.get_result() + assert cluster_network_subnet is not None + store['created_cluster_network_subnet_id'] = cluster_network_subnet['id'] + + def test_list_cluster_network_subnet_reserved_ips(self, createGen2Service): + response = createGen2Service.list_cluster_network_subnet_reserved_ips( + cluster_network_id=store['created_cluster_network_id'], + cluster_network_subnet_id=store['created_cluster_network_subnet_id'], + limit=50, + sort='name', + ) + + assert response.get_status_code() == 200 + cluster_network_subnet_reserved_ip_collection = response.get_result() + assert cluster_network_subnet_reserved_ip_collection is not None + + + def test_list_cluster_network_subnet_reserved_ips_with_pager(self, createGen2Service): + all_results = [] + + # Test get_next(). + pager = ClusterNetworkSubnetReservedIpsPager( + client=createGen2Service, + cluster_network_id=store['created_cluster_network_id'], + cluster_network_subnet_id=store['created_cluster_network_subnet_id'], + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + # Test get_all(). + pager = ClusterNetworkSubnetReservedIpsPager( + client=createGen2Service, + cluster_network_id=store['created_cluster_network_id'], + cluster_network_subnet_id=store['created_cluster_network_subnet_id'], + limit=10, + sort='name', + ) + all_items = pager.get_all() + assert all_items is not None + + assert len(all_results) == len(all_items) + print(f'\nlist_cluster_network_subnet_reserved_ips() returned a total of {len(all_results)} items(s) using ClusterNetworkSubnetReservedIpsPager.') + + + def test_create_cluster_network_subnet_reserved_ip(self, createGen2Service): + response = createGen2Service.create_cluster_network_subnet_reserved_ip( + cluster_network_id=store['created_cluster_network_id'], + cluster_network_subnet_id=store['created_cluster_network_subnet_id'], + address='192.168.3.4', + name='my-cluster-network-subnet-reserved-ip', + ) + + assert response.get_status_code() == 201 + cluster_network_subnet_reserved_ip = response.get_result() + assert cluster_network_subnet_reserved_ip is not None + store['created_cluster_network_subnet_reserved_ip_id'] = cluster_network_subnet_reserved_ip['id'] + + + def test_get_cluster_network_subnet_reserved_ip(self, createGen2Service): + response = createGen2Service.get_cluster_network_subnet_reserved_ip( + cluster_network_id=store['created_cluster_network_id'], + cluster_network_subnet_id=store['created_cluster_network_subnet_id'], + id=store['created_cluster_network_subnet_reserved_ip_id'], + ) + + assert response.get_status_code() == 200 + cluster_network_subnet_reserved_ip = response.get_result() + assert cluster_network_subnet_reserved_ip is not None + + + def test_update_cluster_network_subnet_reserved_ip(self, createGen2Service): + # Construct a dict representation of a ClusterNetworkSubnetReservedIPPatch model + cluster_network_subnet_reserved_ip_patch_model = { + 'auto_delete': False, + 'name': 'my-cluster-network-subnet-reserved-ip-updated', + } + + response = createGen2Service.update_cluster_network_subnet_reserved_ip( + cluster_network_id=store['created_cluster_network_id'], + cluster_network_subnet_id=store['created_cluster_network_subnet_id'], + id=store['created_cluster_network_subnet_reserved_ip_id'], + cluster_network_subnet_reserved_ip_patch=cluster_network_subnet_reserved_ip_patch_model, + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + + assert response.get_status_code() == 200 + cluster_network_subnet_reserved_ip = response.get_result() + assert cluster_network_subnet_reserved_ip is not None + + + def test_get_cluster_network_subnet(self, createGen2Service): + response = createGen2Service.get_cluster_network_subnet( + cluster_network_id=store['created_cluster_network_id'], + id=store['created_cluster_network_subnet_id'], + ) + + assert response.get_status_code() == 200 + cluster_network_subnet = response.get_result() + assert cluster_network_subnet is not None + + + def test_update_cluster_network_subnet(self, createGen2Service): + # Construct a dict representation of a ClusterNetworkSubnetPatch model + cluster_network_subnet_patch_model = { + 'name': 'my-cluster-network-subnet-updated', + } + + response = createGen2Service.update_cluster_network_subnet( + cluster_network_id=store['created_cluster_network_id'], + id=store['created_cluster_network_subnet_id'], + cluster_network_subnet_patch=cluster_network_subnet_patch_model, + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + + assert response.get_status_code() == 200 + cluster_network_subnet = response.get_result() + assert cluster_network_subnet is not None + + + def test_get_cluster_network(self, createGen2Service): + response = createGen2Service.get_cluster_network( + id=store['created_cluster_network_id'], + ) + + assert response.get_status_code() == 200 + cluster_network = response.get_result() + assert cluster_network is not None + + + def test_update_cluster_network(self, createGen2Service): + # Construct a dict representation of a ClusterNetworkPatch model + cluster_network_patch_model = { + 'name': 'my-cluster-network-updated', + } + + response = createGen2Service.update_cluster_network( + id=store['created_cluster_network_id'], + cluster_network_patch=cluster_network_patch_model, + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + + assert response.get_status_code() == 200 + cluster_network = response.get_result() + assert cluster_network is not None + + + + def test_delete_cluster_network_interface(self, createGen2Service): + response = createGen2Service.delete_cluster_network_interface( + cluster_network_id=store['created_cluster_network_id'], + id=store['created_cluster_network_interface_id'], + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + + assert response.get_status_code() == 202 + cluster_network_interface = response.get_result() + assert cluster_network_interface is not None + + + def test_delete_cluster_network_subnet_reserved_ip(self, createGen2Service): + response = createGen2Service.delete_cluster_network_subnet_reserved_ip( + cluster_network_id=store['created_cluster_network_id'], + cluster_network_subnet_id=store['created_cluster_network_subnet_id'], + id=store['created_cluster_network_subnet_reserved_ip_id'], + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + + assert response.get_status_code() == 202 + cluster_network_subnet_reserved_ip = response.get_result() + assert cluster_network_subnet_reserved_ip is not None + + + def test_delete_cluster_network_subnet(self, createGen2Service): + response = createGen2Service.delete_cluster_network_subnet( + cluster_network_id=store['created_cluster_network_id'], + id=store['created_cluster_network_subnet_id'], + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + + assert response.get_status_code() == 202 + cluster_network_subnet = response.get_result() + assert cluster_network_subnet is not None + + + def test_delete_cluster_network(self, createGen2Service): + response = createGen2Service.delete_cluster_network( + id=store['created_cluster_network_id'], + if_match='W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"', + ) + + assert response.get_status_code() == 202 + cluster_network = response.get_result() + assert cluster_network is not None + class TestShares(): def test_list_share_profiles(self, createGen2Service): diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py index d34e3eb..e01f108 100644 --- a/test/unit/test_vpc_v1.py +++ b/test/unit/test_vpc_v1.py @@ -125,7 +125,7 @@ def test_list_vpcs_all_params(self): """ # Set up mock url = preprocess_url('/vpcs') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}' responses.add( responses.GET, url, @@ -176,7 +176,7 @@ def test_list_vpcs_required_params(self): """ # Set up mock url = preprocess_url('/vpcs') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}' responses.add( responses.GET, url, @@ -208,7 +208,7 @@ def test_list_vpcs_value_error(self): """ # Set up mock url = preprocess_url('/vpcs') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}' responses.add( responses.GET, url, @@ -1042,7 +1042,7 @@ def test_get_vpc_default_security_group_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/default_security_group') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -1080,7 +1080,7 @@ def test_get_vpc_default_security_group_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/default_security_group') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -1123,7 +1123,7 @@ def test_list_vpc_address_prefixes_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes') - mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -1170,7 +1170,7 @@ def test_list_vpc_address_prefixes_required_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes') - mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -1208,7 +1208,7 @@ def test_list_vpc_address_prefixes_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes') - mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -1697,7 +1697,7 @@ def test_list_vpc_dns_resolution_bindings_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/dns_resolution_bindings') - mock_response = '{"dns_resolution_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"dns_resolution_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -1759,7 +1759,7 @@ def test_list_vpc_dns_resolution_bindings_required_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/dns_resolution_bindings') - mock_response = '{"dns_resolution_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"dns_resolution_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -1797,7 +1797,7 @@ def test_list_vpc_dns_resolution_bindings_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/dns_resolution_bindings') - mock_response = '{"dns_resolution_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"dns_resolution_bindings": [{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "health_reasons": [{"code": "disconnected_from_bound_vpc", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -2291,7 +2291,7 @@ def test_list_vpc_routes_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -2341,7 +2341,7 @@ def test_list_vpc_routes_required_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -2379,7 +2379,7 @@ def test_list_vpc_routes_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -2416,8 +2416,8 @@ def test_list_vpc_routes_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/vpcs/testString/routes') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -2454,8 +2454,8 @@ def test_list_vpc_routes_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/vpcs/testString/routes') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -2902,7 +2902,7 @@ def test_list_vpc_routing_tables_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -2952,7 +2952,7 @@ def test_list_vpc_routing_tables_required_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -2990,7 +2990,7 @@ def test_list_vpc_routing_tables_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_server"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -3649,7 +3649,7 @@ def test_list_vpc_routing_table_routes_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -3698,7 +3698,7 @@ def test_list_vpc_routing_table_routes_required_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -3738,7 +3738,7 @@ def test_list_vpc_routing_table_routes_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -4336,7 +4336,7 @@ def test_list_subnets_all_params(self): """ # Set up mock url = preprocess_url('/subnets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -4402,7 +4402,7 @@ def test_list_subnets_required_params(self): """ # Set up mock url = preprocess_url('/subnets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -4434,7 +4434,7 @@ def test_list_subnets_value_error(self): """ # Set up mock url = preprocess_url('/subnets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "subnet", "routing_table": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "r006-6885e83f-03b2-4603-8a86-db2a0f55c840", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -5246,7 +5246,7 @@ def test_get_subnet_public_gateway_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/public_gateway') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -5284,7 +5284,7 @@ def test_get_subnet_public_gateway_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/public_gateway') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -5327,7 +5327,7 @@ def test_set_subnet_public_gateway_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/public_gateway') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -5374,7 +5374,7 @@ def test_set_subnet_public_gateway_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/public_gateway') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -5600,7 +5600,7 @@ def test_list_subnet_reserved_ips_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -5662,7 +5662,7 @@ def test_list_subnet_reserved_ips_required_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -5700,7 +5700,7 @@ def test_list_subnet_reserved_ips_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -6107,7 +6107,7 @@ def test_update_subnet_reserved_ip_all_params(self): # Construct a dict representation of a ReservedIPPatch model reserved_ip_patch_model = {} reserved_ip_patch_model['auto_delete'] = False - reserved_ip_patch_model['name'] = 'my-reserved-ip' + reserved_ip_patch_model['name'] = 'my-reserved-ip-updated' # Set up parameter values subnet_id = 'testString' @@ -6157,7 +6157,7 @@ def test_update_subnet_reserved_ip_value_error(self): # Construct a dict representation of a ReservedIPPatch model reserved_ip_patch_model = {} reserved_ip_patch_model['auto_delete'] = False - reserved_ip_patch_model['name'] = 'my-reserved-ip' + reserved_ip_patch_model['name'] = 'my-reserved-ip-updated' # Set up parameter values subnet_id = 'testString' @@ -6254,7 +6254,7 @@ def test_list_images_all_params(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -6314,7 +6314,7 @@ def test_list_images_required_params(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -6346,7 +6346,7 @@ def test_list_images_value_error(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_data_format": "cloud_init", "visibility": "private"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -7501,7 +7501,7 @@ def test_list_operating_systems_all_params(self): """ # Set up mock url = preprocess_url('/operating_systems') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "operating_systems": [{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}], "total_count": 132}' responses.add( responses.GET, url, @@ -7546,7 +7546,7 @@ def test_list_operating_systems_required_params(self): """ # Set up mock url = preprocess_url('/operating_systems') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "operating_systems": [{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}], "total_count": 132}' responses.add( responses.GET, url, @@ -7578,7 +7578,7 @@ def test_list_operating_systems_value_error(self): """ # Set up mock url = preprocess_url('/operating_systems') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "operating_systems": [{"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}], "total_count": 132}' responses.add( responses.GET, url, @@ -7824,7 +7824,7 @@ def test_list_keys_all_params(self): """ # Set up mock url = preprocess_url('/keys') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -7836,11 +7836,13 @@ def test_list_keys_all_params(self): # Set up parameter values start = 'testString' limit = 50 + resource_group_id = 'testString' # Invoke method response = _service.list_keys( start=start, limit=limit, + resource_group_id=resource_group_id, headers={}, ) @@ -7852,6 +7854,7 @@ def test_list_keys_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string def test_list_keys_all_params_with_retries(self): # Enable retries and run test_list_keys_all_params. @@ -7869,7 +7872,7 @@ def test_list_keys_required_params(self): """ # Set up mock url = preprocess_url('/keys') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -7901,7 +7904,7 @@ def test_list_keys_value_error(self): """ # Set up mock url = preprocess_url('/keys') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -7934,8 +7937,8 @@ def test_list_keys_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/keys') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45","id":"82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}' - mock_response2 = '{"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45","id":"82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45","id":"r006-82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}' + mock_response2 = '{"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45","id":"r006-82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}' responses.add( responses.GET, url, @@ -7956,6 +7959,7 @@ def test_list_keys_with_pager_get_next(self): pager = KeysPager( client=_service, limit=10, + resource_group_id='testString', ) while pager.has_next(): next_page = pager.get_next() @@ -7970,8 +7974,8 @@ def test_list_keys_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/keys') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45","id":"82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}' - mock_response2 = '{"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45","id":"82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45","id":"r006-82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}' + mock_response2 = '{"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45","fingerprint":"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY","href":"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45","id":"r006-82679077-ac3b-4c10-be16-63e9c21f0f45","length":2048,"name":"my-key-1","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"ed25519"}],"limit":1}' responses.add( responses.GET, url, @@ -7991,6 +7995,7 @@ def test_list_keys_with_pager_get_all(self): pager = KeysPager( client=_service, limit=10, + resource_group_id='testString', ) all_results = pager.get_all() assert all_results is not None @@ -8009,7 +8014,7 @@ def test_create_key_all_params(self): """ # Set up mock url = preprocess_url('/keys') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' responses.add( responses.POST, url, @@ -8063,7 +8068,7 @@ def test_create_key_value_error(self): """ # Set up mock url = preprocess_url('/keys') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' responses.add( responses.POST, url, @@ -8188,7 +8193,7 @@ def test_get_key_all_params(self): """ # Set up mock url = preprocess_url('/keys/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' responses.add( responses.GET, url, @@ -8226,7 +8231,7 @@ def test_get_key_value_error(self): """ # Set up mock url = preprocess_url('/keys/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' responses.add( responses.GET, url, @@ -8269,7 +8274,7 @@ def test_update_key_all_params(self): """ # Set up mock url = preprocess_url('/keys/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' responses.add( responses.PATCH, url, @@ -8316,7 +8321,7 @@ def test_update_key_value_error(self): """ # Set up mock url = preprocess_url('/keys/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "length": 2048, "name": "my-key-1", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "ed25519"}' responses.add( responses.PATCH, url, @@ -8422,7 +8427,7 @@ def test_list_instance_profiles_all_params(self): """ # Set up mock url = preprocess_url('/instance/profiles') - mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "intel", "type": "fixed", "value": "intel"}}]}' + mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cluster_network_attachment_count": {"type": "dependent"}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "supported_cluster_network_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}], "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "intel", "type": "fixed", "value": "intel"}}]}' responses.add( responses.GET, url, @@ -8454,7 +8459,7 @@ def test_list_instance_profiles_value_error(self): """ # Set up mock url = preprocess_url('/instance/profiles') - mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "intel", "type": "fixed", "value": "intel"}}]}' + mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cluster_network_attachment_count": {"type": "dependent"}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "supported_cluster_network_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}], "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "intel", "type": "fixed", "value": "intel"}}]}' responses.add( responses.GET, url, @@ -8493,7 +8498,7 @@ def test_get_instance_profile_all_params(self): """ # Set up mock url = preprocess_url('/instance/profiles/mx2-host-152x1216') - mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "intel", "type": "fixed", "value": "intel"}}' + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "cluster_network_attachment_count": {"type": "dependent"}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "supported_cluster_network_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}], "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "intel", "type": "fixed", "value": "intel"}}' responses.add( responses.GET, url, @@ -8531,7 +8536,7 @@ def test_get_instance_profile_value_error(self): """ # Set up mock url = preprocess_url('/instance/profiles/mx2-host-152x1216') - mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "intel", "type": "fixed", "value": "intel"}}' + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "cluster_network_attachment_count": {"type": "dependent"}, "confidential_compute_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "secure_boot_modes": {"default": false, "type": "enum", "values": [true]}, "status": "current", "supported_cluster_network_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}], "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "intel", "type": "fixed", "value": "intel"}}' responses.add( responses.GET, url, @@ -8574,7 +8579,7 @@ def test_list_instance_templates_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}], "total_count": 132}' responses.add( responses.GET, url, @@ -8606,7 +8611,7 @@ def test_list_instance_templates_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}], "total_count": 132}' responses.add( responses.GET, url, @@ -8645,7 +8650,7 @@ def test_create_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' responses.add( responses.POST, url, @@ -8658,7 +8663,29 @@ def test_create_instance_template_all_params(self): instance_availability_policy_prototype_model = {} instance_availability_policy_prototype_model['host_failure'] = 'restart' - # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = {} + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = {} + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeInstanceContext model + instance_cluster_network_attachment_prototype_instance_context_model = {} + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + # Construct a dict representation of a TrustedProfileIdentityById model trusted_profile_identity_model = {} trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' @@ -8687,7 +8714,7 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a ReservationIdentityById model reservation_identity_model = {} - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a dict representation of a InstanceReservationAffinityPrototype model instance_reservation_affinity_prototype_model = {} @@ -8767,7 +8794,7 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -8816,6 +8843,7 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate model instance_template_prototype_model = {} instance_template_prototype_model['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_model['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_model['confidential_compute_mode'] = 'disabled' instance_template_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_model['enable_secure_boot'] = True @@ -8872,7 +8900,7 @@ def test_create_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' responses.add( responses.POST, url, @@ -8885,7 +8913,29 @@ def test_create_instance_template_value_error(self): instance_availability_policy_prototype_model = {} instance_availability_policy_prototype_model['host_failure'] = 'restart' - # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = {} + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = {} + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeInstanceContext model + instance_cluster_network_attachment_prototype_instance_context_model = {} + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + # Construct a dict representation of a TrustedProfileIdentityById model trusted_profile_identity_model = {} trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' @@ -8914,7 +8964,7 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a ReservationIdentityById model reservation_identity_model = {} - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a dict representation of a InstanceReservationAffinityPrototype model instance_reservation_affinity_prototype_model = {} @@ -8994,7 +9044,7 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -9043,6 +9093,7 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate model instance_template_prototype_model = {} instance_template_prototype_model['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_model['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_model['confidential_compute_mode'] = 'disabled' instance_template_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_model['enable_secure_boot'] = True @@ -9176,7 +9227,7 @@ def test_get_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' responses.add( responses.GET, url, @@ -9214,7 +9265,7 @@ def test_get_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' responses.add( responses.GET, url, @@ -9257,7 +9308,7 @@ def test_update_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' responses.add( responses.PATCH, url, @@ -9304,7 +9355,7 @@ def test_update_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "cluster_network_attachments": [{"cluster_network_interface": {"auto_delete": false, "name": "my-cluster-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "subnet": {"id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930"}}, "name": "my-instance-network-attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "enable_secure_boot": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "protocol_state_filtering_mode": "auto", "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}' responses.add( responses.PATCH, url, @@ -9353,7 +9404,7 @@ def test_list_instances_all_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -9367,6 +9418,9 @@ def test_list_instances_all_params(self): limit = 50 resource_group_id = 'testString' name = 'my-name' + cluster_network_id = 'testString' + cluster_network_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:r010-82b8c783-15d6-4a51-95bf-0b4649d3ef94' + cluster_network_name = 'my-cluster-network' dedicated_host_id = 'testString' dedicated_host_crn = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_name = 'my-dedicated-host' @@ -9386,6 +9440,9 @@ def test_list_instances_all_params(self): limit=limit, resource_group_id=resource_group_id, name=name, + cluster_network_id=cluster_network_id, + cluster_network_crn=cluster_network_crn, + cluster_network_name=cluster_network_name, dedicated_host_id=dedicated_host_id, dedicated_host_crn=dedicated_host_crn, dedicated_host_name=dedicated_host_name, @@ -9411,6 +9468,9 @@ def test_list_instances_all_params(self): assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string assert 'name={}'.format(name) in query_string + assert 'cluster_network.id={}'.format(cluster_network_id) in query_string + assert 'cluster_network.crn={}'.format(cluster_network_crn) in query_string + assert 'cluster_network.name={}'.format(cluster_network_name) in query_string assert 'dedicated_host.id={}'.format(dedicated_host_id) in query_string assert 'dedicated_host.crn={}'.format(dedicated_host_crn) in query_string assert 'dedicated_host.name={}'.format(dedicated_host_name) in query_string @@ -9440,7 +9500,7 @@ def test_list_instances_required_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -9472,7 +9532,7 @@ def test_list_instances_value_error(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -9505,8 +9565,8 @@ def test_list_instances_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/instances') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"cluster_network":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","name":"my-cluster-network","resource_type":"cluster_network"},"cluster_network_attachments":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"cluster_network":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","name":"my-cluster-network","resource_type":"cluster_network"},"cluster_network_attachments":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -9529,6 +9589,9 @@ def test_list_instances_with_pager_get_next(self): limit=10, resource_group_id='testString', name='my-name', + cluster_network_id='testString', + cluster_network_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:r010-82b8c783-15d6-4a51-95bf-0b4649d3ef94', + cluster_network_name='my-cluster-network', dedicated_host_id='testString', dedicated_host_crn='crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a', dedicated_host_name='my-dedicated-host', @@ -9555,8 +9618,8 @@ def test_list_instances_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/instances') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"cluster_network":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","name":"my-cluster-network","resource_type":"cluster_network"},"cluster_network_attachments":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"cluster_network":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","name":"my-cluster-network","resource_type":"cluster_network"},"cluster_network_attachments":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"confidential_compute_mode":"disabled","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"enable_secure_boot":true,"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":64,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -9578,6 +9641,9 @@ def test_list_instances_with_pager_get_all(self): limit=10, resource_group_id='testString', name='my-name', + cluster_network_id='testString', + cluster_network_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:r010-82b8c783-15d6-4a51-95bf-0b4649d3ef94', + cluster_network_name='my-cluster-network', dedicated_host_id='testString', dedicated_host_crn='crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a', dedicated_host_name='my-dedicated-host', @@ -9608,7 +9674,7 @@ def test_create_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -9621,7 +9687,29 @@ def test_create_instance_all_params(self): instance_availability_policy_prototype_model = {} instance_availability_policy_prototype_model['host_failure'] = 'restart' - # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = {} + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = {} + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeInstanceContext model + instance_cluster_network_attachment_prototype_instance_context_model = {} + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + # Construct a dict representation of a TrustedProfileIdentityById model trusted_profile_identity_model = {} trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' @@ -9650,7 +9738,7 @@ def test_create_instance_all_params(self): # Construct a dict representation of a ReservationIdentityById model reservation_identity_model = {} - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a dict representation of a InstanceReservationAffinityPrototype model instance_reservation_affinity_prototype_model = {} @@ -9736,7 +9824,7 @@ def test_create_instance_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -9785,6 +9873,7 @@ def test_create_instance_all_params(self): # Construct a dict representation of a InstancePrototypeInstanceBySourceTemplate model instance_prototype_model = {} instance_prototype_model['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_model['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_model['confidential_compute_mode'] = 'disabled' instance_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_model['enable_secure_boot'] = True @@ -9841,7 +9930,7 @@ def test_create_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -9854,7 +9943,29 @@ def test_create_instance_value_error(self): instance_availability_policy_prototype_model = {} instance_availability_policy_prototype_model['host_failure'] = 'restart' - # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = {} + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = {} + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeInstanceContext model + instance_cluster_network_attachment_prototype_instance_context_model = {} + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + # Construct a dict representation of a TrustedProfileIdentityById model trusted_profile_identity_model = {} trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' @@ -9883,7 +9994,7 @@ def test_create_instance_value_error(self): # Construct a dict representation of a ReservationIdentityById model reservation_identity_model = {} - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a dict representation of a InstanceReservationAffinityPrototype model instance_reservation_affinity_prototype_model = {} @@ -9969,7 +10080,7 @@ def test_create_instance_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -10018,6 +10129,7 @@ def test_create_instance_value_error(self): # Construct a dict representation of a InstancePrototypeInstanceBySourceTemplate model instance_prototype_model = {} instance_prototype_model['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_model['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_model['confidential_compute_mode'] = 'disabled' instance_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_model['enable_secure_boot'] = True @@ -10188,7 +10300,7 @@ def test_get_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -10226,7 +10338,7 @@ def test_get_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -10269,7 +10381,7 @@ def test_update_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -10298,7 +10410,7 @@ def test_update_instance_all_params(self): # Construct a dict representation of a ReservationIdentityById model reservation_identity_model = {} - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a dict representation of a InstanceReservationAffinityPatch model instance_reservation_affinity_patch_model = {} @@ -10353,7 +10465,7 @@ def test_update_instance_required_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -10382,7 +10494,7 @@ def test_update_instance_required_params(self): # Construct a dict representation of a ReservationIdentityById model reservation_identity_model = {} - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a dict representation of a InstanceReservationAffinityPatch model instance_reservation_affinity_patch_model = {} @@ -10435,7 +10547,7 @@ def test_update_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "cluster_network": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "name": "my-cluster-network", "resource_type": "cluster_network"}, "cluster_network_attachments": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "confidential_compute_mode": "disabled", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "enable_secure_boot": true, "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 64, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -10464,7 +10576,7 @@ def test_update_instance_value_error(self): # Construct a dict representation of a ReservationIdentityById model reservation_identity_model = {} - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a dict representation of a InstanceReservationAffinityPatch model instance_reservation_affinity_patch_model = {} @@ -10519,7 +10631,7 @@ def test_get_instance_initialization_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/initialization') - mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "password": {"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' + mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "password": {"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' responses.add( responses.GET, url, @@ -10557,7 +10669,7 @@ def test_get_instance_initialization_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/initialization') - mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "password": {"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' + mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "password": {"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' responses.add( responses.GET, url, @@ -10600,7 +10712,7 @@ def test_create_instance_action_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/actions') - mock_response = '{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}' + mock_response = '{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}' responses.add( responses.POST, url, @@ -10646,7 +10758,7 @@ def test_create_instance_action_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/actions') - mock_response = '{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}' + mock_response = '{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}' responses.add( responses.POST, url, @@ -10680,6 +10792,613 @@ def test_create_instance_action_value_error_with_retries(self): self.test_create_instance_action_value_error() +class TestListInstanceClusterNetworkAttachments: + """ + Test Class for list_instance_cluster_network_attachments + """ + + @responses.activate + def test_list_instance_cluster_network_attachments_all_params(self): + """ + list_instance_cluster_network_attachments() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments') + mock_response = '{"cluster_network_attachments": [{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + instance_id = 'testString' + start = 'testString' + limit = 50 + + # Invoke method + response = _service.list_instance_cluster_network_attachments( + instance_id, + start=start, + limit=limit, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + + def test_list_instance_cluster_network_attachments_all_params_with_retries(self): + # Enable retries and run test_list_instance_cluster_network_attachments_all_params. + _service.enable_retries() + self.test_list_instance_cluster_network_attachments_all_params() + + # Disable retries and run test_list_instance_cluster_network_attachments_all_params. + _service.disable_retries() + self.test_list_instance_cluster_network_attachments_all_params() + + @responses.activate + def test_list_instance_cluster_network_attachments_required_params(self): + """ + test_list_instance_cluster_network_attachments_required_params() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments') + mock_response = '{"cluster_network_attachments": [{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + instance_id = 'testString' + + # Invoke method + response = _service.list_instance_cluster_network_attachments( + instance_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_instance_cluster_network_attachments_required_params_with_retries(self): + # Enable retries and run test_list_instance_cluster_network_attachments_required_params. + _service.enable_retries() + self.test_list_instance_cluster_network_attachments_required_params() + + # Disable retries and run test_list_instance_cluster_network_attachments_required_params. + _service.disable_retries() + self.test_list_instance_cluster_network_attachments_required_params() + + @responses.activate + def test_list_instance_cluster_network_attachments_value_error(self): + """ + test_list_instance_cluster_network_attachments_value_error() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments') + mock_response = '{"cluster_network_attachments": [{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + instance_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_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.list_instance_cluster_network_attachments(**req_copy) + + def test_list_instance_cluster_network_attachments_value_error_with_retries(self): + # Enable retries and run test_list_instance_cluster_network_attachments_value_error. + _service.enable_retries() + self.test_list_instance_cluster_network_attachments_value_error() + + # Disable retries and run test_list_instance_cluster_network_attachments_value_error. + _service.disable_retries() + self.test_list_instance_cluster_network_attachments_value_error() + + @responses.activate + def test_list_instance_cluster_network_attachments_with_pager_get_next(self): + """ + test_list_instance_cluster_network_attachments_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/instances/testString/cluster_network_attachments') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"cluster_network_attachments":[{"before":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"cluster_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"}},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"limit":1}' + mock_response2 = '{"total_count":2,"cluster_network_attachments":[{"before":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"cluster_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"}},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + all_results = [] + pager = InstanceClusterNetworkAttachmentsPager( + client=_service, + instance_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_instance_cluster_network_attachments_with_pager_get_all(self): + """ + test_list_instance_cluster_network_attachments_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/instances/testString/cluster_network_attachments') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"cluster_network_attachments":[{"before":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"cluster_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"}},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"limit":1}' + mock_response2 = '{"total_count":2,"cluster_network_attachments":[{"before":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"cluster_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"}},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"}],"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = InstanceClusterNetworkAttachmentsPager( + client=_service, + instance_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateClusterNetworkAttachment: + """ + Test Class for create_cluster_network_attachment + """ + + @responses.activate + def test_create_cluster_network_attachment_all_params(self): + """ + create_cluster_network_attachment() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments') + mock_response = '{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = {} + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = {} + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + # Construct a dict representation of a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById model + instance_cluster_network_attachment_before_prototype_model = {} + instance_cluster_network_attachment_before_prototype_model['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + + # Set up parameter values + instance_id = 'testString' + cluster_network_interface = instance_cluster_network_attachment_prototype_cluster_network_interface_model + before = instance_cluster_network_attachment_before_prototype_model + name = 'my-instance-network-attachment' + + # Invoke method + response = _service.create_cluster_network_attachment( + instance_id, + cluster_network_interface, + before=before, + name=name, + 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['cluster_network_interface'] == instance_cluster_network_attachment_prototype_cluster_network_interface_model + assert req_body['before'] == instance_cluster_network_attachment_before_prototype_model + assert req_body['name'] == 'my-instance-network-attachment' + + def test_create_cluster_network_attachment_all_params_with_retries(self): + # Enable retries and run test_create_cluster_network_attachment_all_params. + _service.enable_retries() + self.test_create_cluster_network_attachment_all_params() + + # Disable retries and run test_create_cluster_network_attachment_all_params. + _service.disable_retries() + self.test_create_cluster_network_attachment_all_params() + + @responses.activate + def test_create_cluster_network_attachment_value_error(self): + """ + test_create_cluster_network_attachment_value_error() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments') + mock_response = '{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = {} + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = {} + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + # Construct a dict representation of a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById model + instance_cluster_network_attachment_before_prototype_model = {} + instance_cluster_network_attachment_before_prototype_model['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + + # Set up parameter values + instance_id = 'testString' + cluster_network_interface = instance_cluster_network_attachment_prototype_cluster_network_interface_model + before = instance_cluster_network_attachment_before_prototype_model + name = 'my-instance-network-attachment' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_id, + "cluster_network_interface": cluster_network_interface, + } + 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_cluster_network_attachment(**req_copy) + + def test_create_cluster_network_attachment_value_error_with_retries(self): + # Enable retries and run test_create_cluster_network_attachment_value_error. + _service.enable_retries() + self.test_create_cluster_network_attachment_value_error() + + # Disable retries and run test_create_cluster_network_attachment_value_error. + _service.disable_retries() + self.test_create_cluster_network_attachment_value_error() + + +class TestDeleteInstanceClusterNetworkAttachment: + """ + Test Class for delete_instance_cluster_network_attachment + """ + + @responses.activate + def test_delete_instance_cluster_network_attachment_all_params(self): + """ + delete_instance_cluster_network_attachment() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments/testString') + mock_response = '{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.delete_instance_cluster_network_attachment( + instance_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_instance_cluster_network_attachment_all_params_with_retries(self): + # Enable retries and run test_delete_instance_cluster_network_attachment_all_params. + _service.enable_retries() + self.test_delete_instance_cluster_network_attachment_all_params() + + # Disable retries and run test_delete_instance_cluster_network_attachment_all_params. + _service.disable_retries() + self.test_delete_instance_cluster_network_attachment_all_params() + + @responses.activate + def test_delete_instance_cluster_network_attachment_value_error(self): + """ + test_delete_instance_cluster_network_attachment_value_error() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments/testString') + mock_response = '{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_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.delete_instance_cluster_network_attachment(**req_copy) + + def test_delete_instance_cluster_network_attachment_value_error_with_retries(self): + # Enable retries and run test_delete_instance_cluster_network_attachment_value_error. + _service.enable_retries() + self.test_delete_instance_cluster_network_attachment_value_error() + + # Disable retries and run test_delete_instance_cluster_network_attachment_value_error. + _service.disable_retries() + self.test_delete_instance_cluster_network_attachment_value_error() + + +class TestGetInstanceClusterNetworkAttachment: + """ + Test Class for get_instance_cluster_network_attachment + """ + + @responses.activate + def test_get_instance_cluster_network_attachment_all_params(self): + """ + get_instance_cluster_network_attachment() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments/testString') + mock_response = '{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_instance_cluster_network_attachment( + instance_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_instance_cluster_network_attachment_all_params_with_retries(self): + # Enable retries and run test_get_instance_cluster_network_attachment_all_params. + _service.enable_retries() + self.test_get_instance_cluster_network_attachment_all_params() + + # Disable retries and run test_get_instance_cluster_network_attachment_all_params. + _service.disable_retries() + self.test_get_instance_cluster_network_attachment_all_params() + + @responses.activate + def test_get_instance_cluster_network_attachment_value_error(self): + """ + test_get_instance_cluster_network_attachment_value_error() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments/testString') + mock_response = '{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_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_instance_cluster_network_attachment(**req_copy) + + def test_get_instance_cluster_network_attachment_value_error_with_retries(self): + # Enable retries and run test_get_instance_cluster_network_attachment_value_error. + _service.enable_retries() + self.test_get_instance_cluster_network_attachment_value_error() + + # Disable retries and run test_get_instance_cluster_network_attachment_value_error. + _service.disable_retries() + self.test_get_instance_cluster_network_attachment_value_error() + + +class TestUpdateInstanceClusterNetworkAttachment: + """ + Test Class for update_instance_cluster_network_attachment + """ + + @responses.activate + def test_update_instance_cluster_network_attachment_all_params(self): + """ + update_instance_cluster_network_attachment() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments/testString') + mock_response = '{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPatch model + instance_cluster_network_attachment_patch_model = {} + instance_cluster_network_attachment_patch_model['name'] = 'my-instance-network-attachment-updated' + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + instance_cluster_network_attachment_patch = instance_cluster_network_attachment_patch_model + + # Invoke method + response = _service.update_instance_cluster_network_attachment( + instance_id, + id, + instance_cluster_network_attachment_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == instance_cluster_network_attachment_patch + + def test_update_instance_cluster_network_attachment_all_params_with_retries(self): + # Enable retries and run test_update_instance_cluster_network_attachment_all_params. + _service.enable_retries() + self.test_update_instance_cluster_network_attachment_all_params() + + # Disable retries and run test_update_instance_cluster_network_attachment_all_params. + _service.disable_retries() + self.test_update_instance_cluster_network_attachment_all_params() + + @responses.activate + def test_update_instance_cluster_network_attachment_value_error(self): + """ + test_update_instance_cluster_network_attachment_value_error() + """ + # Set up mock + url = preprocess_url('/instances/testString/cluster_network_attachments/testString') + mock_response = '{"before": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "cluster_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a InstanceClusterNetworkAttachmentPatch model + instance_cluster_network_attachment_patch_model = {} + instance_cluster_network_attachment_patch_model['name'] = 'my-instance-network-attachment-updated' + + # Set up parameter values + instance_id = 'testString' + id = 'testString' + instance_cluster_network_attachment_patch = instance_cluster_network_attachment_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_id, + "id": id, + "instance_cluster_network_attachment_patch": instance_cluster_network_attachment_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_instance_cluster_network_attachment(**req_copy) + + def test_update_instance_cluster_network_attachment_value_error_with_retries(self): + # Enable retries and run test_update_instance_cluster_network_attachment_value_error. + _service.enable_retries() + self.test_update_instance_cluster_network_attachment_value_error() + + # Disable retries and run test_update_instance_cluster_network_attachment_value_error. + _service.disable_retries() + self.test_update_instance_cluster_network_attachment_value_error() + + class TestCreateInstanceConsoleAccessToken: """ Test Class for create_instance_console_access_token @@ -10692,7 +11411,7 @@ def test_create_instance_console_access_token_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/console_access_token') - mock_response = '{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}' + mock_response = '{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}' responses.add( responses.POST, url, @@ -10738,7 +11457,7 @@ def test_create_instance_console_access_token_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/console_access_token') - mock_response = '{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}' + mock_response = '{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}' responses.add( responses.POST, url, @@ -10784,7 +11503,7 @@ def test_list_instance_disks_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/disks') - mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}' + mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}' responses.add( responses.GET, url, @@ -10822,7 +11541,7 @@ def test_list_instance_disks_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/disks') - mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}' + mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}' responses.add( responses.GET, url, @@ -10865,7 +11584,7 @@ def test_get_instance_disk_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' responses.add( responses.GET, url, @@ -10905,7 +11624,7 @@ def test_get_instance_disk_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' responses.add( responses.GET, url, @@ -10950,7 +11669,7 @@ def test_update_instance_disk_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' responses.add( responses.PATCH, url, @@ -10999,7 +11718,7 @@ def test_update_instance_disk_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}' responses.add( responses.PATCH, url, @@ -11050,7 +11769,7 @@ def test_list_instance_network_attachments_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_attachments') - mock_response = '{"network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}]}' + mock_response = '{"network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}]}' responses.add( responses.GET, url, @@ -11088,7 +11807,7 @@ def test_list_instance_network_attachments_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_attachments') - mock_response = '{"network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}]}' + mock_response = '{"network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}]}' responses.add( responses.GET, url, @@ -11131,7 +11850,7 @@ def test_create_instance_network_attachment_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_attachments') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' responses.add( responses.POST, url, @@ -11158,7 +11877,7 @@ def test_create_instance_network_attachment_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -11214,7 +11933,7 @@ def test_create_instance_network_attachment_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_attachments') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' responses.add( responses.POST, url, @@ -11241,7 +11960,7 @@ def test_create_instance_network_attachment_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -11376,7 +12095,7 @@ def test_get_instance_network_attachment_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' responses.add( responses.GET, url, @@ -11416,7 +12135,7 @@ def test_get_instance_network_attachment_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' responses.add( responses.GET, url, @@ -11461,7 +12180,7 @@ def test_update_instance_network_attachment_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' responses.add( responses.PATCH, url, @@ -11510,7 +12229,7 @@ def test_update_instance_network_attachment_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}' responses.add( responses.PATCH, url, @@ -11561,7 +12280,7 @@ def test_list_instance_network_interfaces_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces') - mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}' + mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}' responses.add( responses.GET, url, @@ -11599,7 +12318,7 @@ def test_list_instance_network_interfaces_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces') - mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}' + mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}' responses.add( responses.GET, url, @@ -11642,7 +12361,7 @@ def test_create_instance_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.POST, url, @@ -11663,7 +12382,7 @@ def test_create_instance_network_interface_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Set up parameter values instance_id = 'testString' @@ -11711,7 +12430,7 @@ def test_create_instance_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.POST, url, @@ -11732,7 +12451,7 @@ def test_create_instance_network_interface_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Set up parameter values instance_id = 'testString' @@ -11853,7 +12572,7 @@ def test_get_instance_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.GET, url, @@ -11893,7 +12612,7 @@ def test_get_instance_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.GET, url, @@ -11938,7 +12657,7 @@ def test_update_instance_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.PATCH, url, @@ -11950,7 +12669,7 @@ def test_update_instance_network_interface_all_params(self): # Construct a dict representation of a NetworkInterfacePatch model network_interface_patch_model = {} network_interface_patch_model['allow_ip_spoofing'] = True - network_interface_patch_model['name'] = 'my-network-interface-1' + network_interface_patch_model['name'] = 'my-network-interface-updated' # Set up parameter values instance_id = 'testString' @@ -11988,7 +12707,7 @@ def test_update_instance_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.PATCH, url, @@ -12000,7 +12719,7 @@ def test_update_instance_network_interface_value_error(self): # Construct a dict representation of a NetworkInterfacePatch model network_interface_patch_model = {} network_interface_patch_model['allow_ip_spoofing'] = True - network_interface_patch_model['name'] = 'my-network-interface-1' + network_interface_patch_model['name'] = 'my-network-interface-updated' # Set up parameter values instance_id = 'testString' @@ -12040,7 +12759,7 @@ def test_list_instance_network_interface_floating_ips_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips') - mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -12080,7 +12799,7 @@ def test_list_instance_network_interface_floating_ips_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips') - mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -12208,7 +12927,7 @@ def test_get_instance_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -12250,7 +12969,7 @@ def test_get_instance_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -12297,7 +13016,7 @@ def test_add_instance_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -12339,7 +13058,7 @@ def test_add_instance_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -12386,7 +13105,7 @@ def test_list_instance_network_interface_ips_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -12435,7 +13154,7 @@ def test_list_instance_network_interface_ips_required_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -12475,7 +13194,7 @@ def test_list_instance_network_interface_ips_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -12682,7 +13401,7 @@ def test_list_instance_volume_attachments_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/volume_attachments') - mock_response = '{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}]}' + mock_response = '{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}]}' responses.add( responses.GET, url, @@ -12720,7 +13439,7 @@ def test_list_instance_volume_attachments_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/volume_attachments') - mock_response = '{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}]}' + mock_response = '{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}]}' responses.add( responses.GET, url, @@ -12763,7 +13482,7 @@ def test_create_instance_volume_attachment_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/volume_attachments') - mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' responses.add( responses.POST, url, @@ -12816,7 +13535,7 @@ def test_create_instance_volume_attachment_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/volume_attachments') - mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' responses.add( responses.POST, url, @@ -12946,7 +13665,7 @@ def test_get_instance_volume_attachment_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/volume_attachments/testString') - mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' responses.add( responses.GET, url, @@ -12986,7 +13705,7 @@ def test_get_instance_volume_attachment_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/volume_attachments/testString') - mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' responses.add( responses.GET, url, @@ -13031,7 +13750,7 @@ def test_update_instance_volume_attachment_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/volume_attachments/testString') - mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' responses.add( responses.PATCH, url, @@ -13081,7 +13800,7 @@ def test_update_instance_volume_attachment_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/volume_attachments/testString') - mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' + mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}' responses.add( responses.PATCH, url, @@ -13190,7 +13909,7 @@ def test_list_instance_groups_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -13235,7 +13954,7 @@ def test_list_instance_groups_required_params(self): """ # Set up mock url = preprocess_url('/instance_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -13267,7 +13986,7 @@ def test_list_instance_groups_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -13899,7 +14618,7 @@ def test_list_instance_group_managers_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -13946,7 +14665,7 @@ def test_list_instance_group_managers_required_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -13984,7 +14703,7 @@ def test_list_instance_group_managers_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -14480,7 +15199,7 @@ def test_list_instance_group_manager_actions_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions') - mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -14529,7 +15248,7 @@ def test_list_instance_group_manager_actions_required_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions') - mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -14569,7 +15288,7 @@ def test_list_instance_group_manager_actions_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions') - mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -15105,7 +15824,7 @@ def test_list_instance_group_manager_policies_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' responses.add( responses.GET, url, @@ -15154,7 +15873,7 @@ def test_list_instance_group_manager_policies_required_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' responses.add( responses.GET, url, @@ -15194,7 +15913,7 @@ def test_list_instance_group_manager_policies_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}' responses.add( responses.GET, url, @@ -15773,7 +16492,7 @@ def test_list_instance_group_memberships_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/memberships') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -15820,7 +16539,7 @@ def test_list_instance_group_memberships_required_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/memberships') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -15858,7 +16577,7 @@ def test_list_instance_group_memberships_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/memberships') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -15895,8 +16614,8 @@ def test_list_instance_group_memberships_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/instance_groups/testString/memberships') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' - mock_response2 = '{"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' + mock_response2 = '{"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' responses.add( responses.GET, url, @@ -15932,8 +16651,8 @@ def test_list_instance_group_memberships_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/instance_groups/testString/memberships') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' - mock_response2 = '{"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' + mock_response2 = '{"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' responses.add( responses.GET, url, @@ -16051,7 +16770,7 @@ def test_get_instance_group_membership_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/memberships/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.GET, url, @@ -16091,7 +16810,7 @@ def test_get_instance_group_membership_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/memberships/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.GET, url, @@ -16136,7 +16855,7 @@ def test_update_instance_group_membership_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/memberships/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.PATCH, url, @@ -16186,7 +16905,7 @@ def test_update_instance_group_membership_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/memberships/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}' responses.add( responses.PATCH, url, @@ -16295,7 +17014,7 @@ def test_list_reservations_all_params(self): """ # Set up mock url = preprocess_url('/reservations') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -16349,7 +17068,7 @@ def test_list_reservations_required_params(self): """ # Set up mock url = preprocess_url('/reservations') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -16381,7 +17100,7 @@ def test_list_reservations_value_error(self): """ # Set up mock url = preprocess_url('/reservations') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -16414,8 +17133,8 @@ def test_list_reservations_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/reservations') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -16453,8 +17172,8 @@ def test_list_reservations_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/reservations') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":8,"status":"allocated","total":10,"used":2},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"0717-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -16495,7 +17214,7 @@ def test_create_reservation_all_params(self): """ # Set up mock url = preprocess_url('/reservations') - mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -16576,7 +17295,7 @@ def test_create_reservation_value_error(self): """ # Set up mock url = preprocess_url('/reservations') - mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -16650,7 +17369,7 @@ def test_delete_reservation_all_params(self): """ # Set up mock url = preprocess_url('/reservations/testString') - mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, @@ -16688,7 +17407,7 @@ def test_delete_reservation_value_error(self): """ # Set up mock url = preprocess_url('/reservations/testString') - mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, @@ -16731,7 +17450,7 @@ def test_get_reservation_all_params(self): """ # Set up mock url = preprocess_url('/reservations/testString') - mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -16769,7 +17488,7 @@ def test_get_reservation_value_error(self): """ # Set up mock url = preprocess_url('/reservations/testString') - mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -16812,7 +17531,7 @@ def test_update_reservation_all_params(self): """ # Set up mock url = preprocess_url('/reservations/testString') - mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -16876,7 +17595,7 @@ def test_update_reservation_value_error(self): """ # Set up mock url = preprocess_url('/reservations/testString') - mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 8, "status": "allocated", "total": 10, "used": 2}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "0717-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -17074,7 +17793,7 @@ def test_list_dedicated_host_groups_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "groups": [{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -17128,7 +17847,7 @@ def test_list_dedicated_host_groups_required_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "groups": [{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -17160,7 +17879,7 @@ def test_list_dedicated_host_groups_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "groups": [{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -17193,8 +17912,8 @@ def test_list_dedicated_host_groups_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/dedicated_host/groups') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -17232,8 +17951,8 @@ def test_list_dedicated_host_groups_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/dedicated_host/groups') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"groups":[{"class":"bx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -17274,7 +17993,7 @@ def test_create_dedicated_host_group_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups') - mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -17335,7 +18054,7 @@ def test_create_dedicated_host_group_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups') - mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -17467,7 +18186,7 @@ def test_get_dedicated_host_group_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups/testString') - mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -17505,7 +18224,7 @@ def test_get_dedicated_host_group_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups/testString') - mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -17548,7 +18267,7 @@ def test_update_dedicated_host_group_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups/testString') - mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -17559,7 +18278,7 @@ def test_update_dedicated_host_group_all_params(self): # Construct a dict representation of a DedicatedHostGroupPatch model dedicated_host_group_patch_model = {} - dedicated_host_group_patch_model['name'] = 'my-host-group-updated' + dedicated_host_group_patch_model['name'] = 'my-dedicated-host-group-updated' # Set up parameter values id = 'testString' @@ -17595,7 +18314,7 @@ def test_update_dedicated_host_group_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups/testString') - mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "bx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -17606,7 +18325,7 @@ def test_update_dedicated_host_group_value_error(self): # Construct a dict representation of a DedicatedHostGroupPatch model dedicated_host_group_patch_model = {} - dedicated_host_group_patch_model['name'] = 'my-host-group-updated' + dedicated_host_group_patch_model['name'] = 'my-dedicated-host-group-updated' # Set up parameter values id = 'testString' @@ -17644,7 +18363,7 @@ def test_list_dedicated_host_profiles_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -17689,7 +18408,7 @@ def test_list_dedicated_host_profiles_required_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -17721,7 +18440,7 @@ def test_list_dedicated_host_profiles_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"class": "bx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -17910,7 +18629,7 @@ def test_list_dedicated_hosts_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_hosts') - mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -17967,7 +18686,7 @@ def test_list_dedicated_hosts_required_params(self): """ # Set up mock url = preprocess_url('/dedicated_hosts') - mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -17999,7 +18718,7 @@ def test_list_dedicated_hosts_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_hosts') - mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -18032,8 +18751,8 @@ def test_list_dedicated_hosts_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/dedicated_hosts') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e","id":"0717-bd091a9e-b036-4c65-a79b-56d164911f6e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e","id":"0717-bd091a9e-b036-4c65-a79b-56d164911f6e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -18072,8 +18791,8 @@ def test_list_dedicated_hosts_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/dedicated_hosts') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e","id":"0717-bd091a9e-b036-4c65-a79b-56d164911f6e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"available":9,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e","id":"0717-bd091a9e-b036-4c65-a79b-56d164911f6e","instance_disks":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-disk","resource_type":"instance_disk"}],"interface_type":"nvme","lifecycle_state":"stable","name":"my-dedicated-host-disk","provisionable":false,"resource_type":"dedicated_host_disk","size":4,"supported_instance_interface_types":["nvme"]}],"group":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-dedicated-host-group","resource_type":"dedicated_host_group"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","id":"0717-1e09281b-f177-46fb-baf1-bc152b2e391a","instance_placement_enabled":true,"instances":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"}],"lifecycle_state":"stable","memory":128,"name":"my-host","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -18115,7 +18834,7 @@ def test_create_dedicated_host_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_hosts') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -18176,7 +18895,7 @@ def test_create_dedicated_host_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_hosts') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -18239,7 +18958,7 @@ def test_list_dedicated_host_disks_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString/disks') - mock_response = '{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}]}' + mock_response = '{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}]}' responses.add( responses.GET, url, @@ -18277,7 +18996,7 @@ def test_list_dedicated_host_disks_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString/disks') - mock_response = '{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}]}' + mock_response = '{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}]}' responses.add( responses.GET, url, @@ -18320,7 +19039,7 @@ def test_get_dedicated_host_disk_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString/disks/testString') - mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}' + mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}' responses.add( responses.GET, url, @@ -18360,7 +19079,7 @@ def test_get_dedicated_host_disk_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString/disks/testString') - mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}' + mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}' responses.add( responses.GET, url, @@ -18405,7 +19124,7 @@ def test_update_dedicated_host_disk_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString/disks/testString') - mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}' + mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}' responses.add( responses.PATCH, url, @@ -18416,7 +19135,7 @@ def test_update_dedicated_host_disk_all_params(self): # Construct a dict representation of a DedicatedHostDiskPatch model dedicated_host_disk_patch_model = {} - dedicated_host_disk_patch_model['name'] = 'my-disk-updated' + dedicated_host_disk_patch_model['name'] = 'my-dedicated-host-disk-updated' # Set up parameter values dedicated_host_id = 'testString' @@ -18454,7 +19173,7 @@ def test_update_dedicated_host_disk_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString/disks/testString') - mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}' + mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}' responses.add( responses.PATCH, url, @@ -18465,7 +19184,7 @@ def test_update_dedicated_host_disk_value_error(self): # Construct a dict representation of a DedicatedHostDiskPatch model dedicated_host_disk_patch_model = {} - dedicated_host_disk_patch_model['name'] = 'my-disk-updated' + dedicated_host_disk_patch_model['name'] = 'my-dedicated-host-disk-updated' # Set up parameter values dedicated_host_id = 'testString' @@ -18580,7 +19299,7 @@ def test_get_dedicated_host_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -18618,7 +19337,7 @@ def test_get_dedicated_host_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -18661,7 +19380,7 @@ def test_update_dedicated_host_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -18672,7 +19391,7 @@ def test_update_dedicated_host_all_params(self): # Construct a dict representation of a DedicatedHostPatch model dedicated_host_patch_model = {} - dedicated_host_patch_model['instance_placement_enabled'] = True + dedicated_host_patch_model['instance_placement_enabled'] = False dedicated_host_patch_model['name'] = 'my-host' # Set up parameter values @@ -18709,7 +19428,7 @@ def test_update_dedicated_host_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_hosts/testString') - mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "id": "0717-bd091a9e-b036-4c65-a79b-56d164911f6e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-dedicated-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -18720,7 +19439,7 @@ def test_update_dedicated_host_value_error(self): # Construct a dict representation of a DedicatedHostPatch model dedicated_host_patch_model = {} - dedicated_host_patch_model['instance_placement_enabled'] = True + dedicated_host_patch_model['instance_placement_enabled'] = False dedicated_host_patch_model['name'] = 'my-host' # Set up parameter values @@ -18816,7 +19535,7 @@ def test_list_placement_groups_all_params(self): """ # Set up mock url = preprocess_url('/placement_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}' responses.add( responses.GET, url, @@ -18861,7 +19580,7 @@ def test_list_placement_groups_required_params(self): """ # Set up mock url = preprocess_url('/placement_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}' responses.add( responses.GET, url, @@ -18893,7 +19612,7 @@ def test_list_placement_groups_value_error(self): """ # Set up mock url = preprocess_url('/placement_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}' responses.add( responses.GET, url, @@ -18926,8 +19645,8 @@ def test_list_placement_groups_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/placement_groups') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' - mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r006-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' + mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r006-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' responses.add( responses.GET, url, @@ -18962,8 +19681,8 @@ def test_list_placement_groups_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/placement_groups') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' - mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r006-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' + mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r006-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' responses.add( responses.GET, url, @@ -19001,7 +19720,7 @@ def test_create_placement_group_all_params(self): """ # Set up mock url = preprocess_url('/placement_groups') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' responses.add( responses.POST, url, @@ -19052,7 +19771,7 @@ def test_create_placement_group_value_error(self): """ # Set up mock url = preprocess_url('/placement_groups') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' responses.add( responses.POST, url, @@ -19176,7 +19895,7 @@ def test_get_placement_group_all_params(self): """ # Set up mock url = preprocess_url('/placement_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' responses.add( responses.GET, url, @@ -19214,7 +19933,7 @@ def test_get_placement_group_value_error(self): """ # Set up mock url = preprocess_url('/placement_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' responses.add( responses.GET, url, @@ -19257,7 +19976,7 @@ def test_update_placement_group_all_params(self): """ # Set up mock url = preprocess_url('/placement_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' responses.add( responses.PATCH, url, @@ -19304,7 +20023,7 @@ def test_update_placement_group_value_error(self): """ # Set up mock url = preprocess_url('/placement_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r006-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}' responses.add( responses.PATCH, url, @@ -19410,7 +20129,7 @@ def test_list_bare_metal_server_profiles_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_server/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}' responses.add( responses.GET, url, @@ -19455,7 +20174,7 @@ def test_list_bare_metal_server_profiles_required_params(self): """ # Set up mock url = preprocess_url('/bare_metal_server/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}' responses.add( responses.GET, url, @@ -19487,7 +20206,7 @@ def test_list_bare_metal_server_profiles_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_server/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"default": "disabled", "type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}' responses.add( responses.GET, url, @@ -19676,7 +20395,7 @@ def test_list_bare_metal_servers_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -19736,7 +20455,7 @@ def test_list_bare_metal_servers_required_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -19768,7 +20487,7 @@ def test_list_bare_metal_servers_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -19801,8 +20520,8 @@ def test_list_bare_metal_servers_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","id":"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","id":"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -19842,8 +20561,8 @@ def test_list_bare_metal_servers_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","id":"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"firmware":{"update":"none"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","id":"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -19886,7 +20605,7 @@ def test_create_bare_metal_server_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -19943,7 +20662,7 @@ def test_create_bare_metal_server_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -20022,7 +20741,7 @@ def test_create_bare_metal_server_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -20079,7 +20798,7 @@ def test_create_bare_metal_server_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -20160,7 +20879,7 @@ def test_create_bare_metal_server_console_access_token_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/console_access_token') - mock_response = '{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}' + mock_response = '{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}' responses.add( responses.POST, url, @@ -20206,7 +20925,7 @@ def test_create_bare_metal_server_console_access_token_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/console_access_token') - mock_response = '{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}' + mock_response = '{"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI"}' responses.add( responses.POST, url, @@ -20252,7 +20971,7 @@ def test_list_bare_metal_server_disks_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks') - mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' + mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' responses.add( responses.GET, url, @@ -20290,7 +21009,7 @@ def test_list_bare_metal_server_disks_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks') - mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' + mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' responses.add( responses.GET, url, @@ -20333,7 +21052,7 @@ def test_get_bare_metal_server_disk_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add( responses.GET, url, @@ -20373,7 +21092,7 @@ def test_get_bare_metal_server_disk_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add( responses.GET, url, @@ -20418,7 +21137,7 @@ def test_update_bare_metal_server_disk_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add( responses.PATCH, url, @@ -20467,7 +21186,7 @@ def test_update_bare_metal_server_disk_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add( responses.PATCH, url, @@ -20518,7 +21237,7 @@ def test_list_bare_metal_server_network_attachments_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -20565,7 +21284,7 @@ def test_list_bare_metal_server_network_attachments_required_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -20603,7 +21322,7 @@ def test_list_bare_metal_server_network_attachments_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -20640,8 +21359,8 @@ def test_list_bare_metal_server_network_attachments_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers/testString/network_attachments') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}' - mock_response2 = '{"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}' + mock_response2 = '{"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}' responses.add( responses.GET, url, @@ -20677,8 +21396,8 @@ def test_list_bare_metal_server_network_attachments_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers/testString/network_attachments') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}' - mock_response2 = '{"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}' + mock_response2 = '{"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}' responses.add( responses.GET, url, @@ -20717,7 +21436,7 @@ def test_create_bare_metal_server_network_attachment_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' responses.add( responses.POST, url, @@ -20744,7 +21463,7 @@ def test_create_bare_metal_server_network_attachment_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -20804,7 +21523,7 @@ def test_create_bare_metal_server_network_attachment_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' responses.add( responses.POST, url, @@ -20831,7 +21550,7 @@ def test_create_bare_metal_server_network_attachment_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -20972,7 +21691,7 @@ def test_get_bare_metal_server_network_attachment_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' responses.add( responses.GET, url, @@ -21012,7 +21731,7 @@ def test_get_bare_metal_server_network_attachment_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' responses.add( responses.GET, url, @@ -21057,7 +21776,7 @@ def test_update_bare_metal_server_network_attachment_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' responses.add( responses.PATCH, url, @@ -21107,7 +21826,7 @@ def test_update_bare_metal_server_network_attachment_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}' responses.add( responses.PATCH, url, @@ -21159,7 +21878,7 @@ def test_list_bare_metal_server_network_interfaces_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -21206,7 +21925,7 @@ def test_list_bare_metal_server_network_interfaces_required_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -21244,7 +21963,7 @@ def test_list_bare_metal_server_network_interfaces_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -21281,8 +22000,8 @@ def test_list_bare_metal_server_network_interfaces_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' - mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' responses.add( responses.GET, url, @@ -21318,8 +22037,8 @@ def test_list_bare_metal_server_network_interfaces_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' - mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' responses.add( responses.GET, url, @@ -21358,7 +22077,7 @@ def test_create_bare_metal_server_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.POST, url, @@ -21375,7 +22094,7 @@ def test_create_bare_metal_server_network_interface_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -21425,7 +22144,7 @@ def test_create_bare_metal_server_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.POST, url, @@ -21442,7 +22161,7 @@ def test_create_bare_metal_server_network_interface_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -21573,7 +22292,7 @@ def test_get_bare_metal_server_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.GET, url, @@ -21613,7 +22332,7 @@ def test_get_bare_metal_server_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.GET, url, @@ -21658,7 +22377,7 @@ def test_update_bare_metal_server_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.PATCH, url, @@ -21710,7 +22429,7 @@ def test_update_bare_metal_server_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.PATCH, url, @@ -21764,7 +22483,7 @@ def test_list_bare_metal_server_network_interface_floating_ips_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips') - mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -21804,7 +22523,7 @@ def test_list_bare_metal_server_network_interface_floating_ips_value_error(self) """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips') - mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -21932,7 +22651,7 @@ def test_get_bare_metal_server_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -21974,7 +22693,7 @@ def test_get_bare_metal_server_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -22021,7 +22740,7 @@ def test_add_bare_metal_server_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -22063,7 +22782,7 @@ def test_add_bare_metal_server_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -22110,7 +22829,7 @@ def test_list_bare_metal_server_network_interface_ips_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -22150,7 +22869,7 @@ def test_list_bare_metal_server_network_interface_ips_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -22359,7 +23078,7 @@ def test_get_bare_metal_server_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -22397,7 +23116,7 @@ def test_get_bare_metal_server_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -22440,7 +23159,7 @@ def test_update_bare_metal_server_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -22494,7 +23213,7 @@ def test_update_bare_metal_server_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "firmware": {"update": "none"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "id": "0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -22665,7 +23384,7 @@ def test_get_bare_metal_server_initialization_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/initialization') - mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}' + mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}' responses.add( responses.GET, url, @@ -22703,7 +23422,7 @@ def test_get_bare_metal_server_initialization_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/initialization') - mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}' + mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}' responses.add( responses.GET, url, @@ -22746,7 +23465,7 @@ def test_replace_bare_metal_server_initialization_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/initialization') - mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}' + mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}' responses.add( responses.PUT, url, @@ -22803,7 +23522,7 @@ def test_replace_bare_metal_server_initialization_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/initialization') - mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}' + mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "id": "r006-82679077-ac3b-4c10-be16-63e9c21f0f45", "name": "my-key-1"}, "resource_type": "host_user_account", "username": "Administrator"}]}' responses.add( responses.PUT, url, @@ -23148,7 +23867,7 @@ def test_list_volume_profiles_all_params(self): """ # Set up mock url = preprocess_url('/volume/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose"}], "total_count": 132}' responses.add( responses.GET, url, @@ -23193,7 +23912,7 @@ def test_list_volume_profiles_required_params(self): """ # Set up mock url = preprocess_url('/volume/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose"}], "total_count": 132}' responses.add( responses.GET, url, @@ -23225,7 +23944,7 @@ def test_list_volume_profiles_value_error(self): """ # Set up mock url = preprocess_url('/volume/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"adjustable_capacity_states": {"type": "enum", "values": ["attached"]}, "adjustable_iops_states": {"type": "enum", "values": ["attached"]}, "boot_capacity": {"type": "fixed", "value": 4800}, "capacity": {"type": "fixed", "value": 4800}, "family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "iops": {"type": "fixed", "value": 4000}, "name": "general-purpose"}], "total_count": 132}' responses.add( responses.GET, url, @@ -23414,7 +24133,7 @@ def test_list_volumes_all_params(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "volumes": [{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "volumes": [{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -23480,7 +24199,7 @@ def test_list_volumes_required_params(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "volumes": [{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "volumes": [{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -23512,7 +24231,7 @@ def test_list_volumes_value_error(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "volumes": [{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "volumes": [{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -23545,8 +24264,8 @@ def test_list_volumes_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/volumes') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"attachment_state":"attached","bandwidth":1000,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"attachment_state":"attached","bandwidth":1000,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"attachment_state":"attached","bandwidth":1000,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"attachment_state":"attached","bandwidth":1000,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -23588,8 +24307,8 @@ def test_list_volumes_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/volumes') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"attachment_state":"attached","bandwidth":1000,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"attachment_state":"attached","bandwidth":1000,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a","id":"0717_1e09281b-f177-46f2-b1f1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"attachment_state":"attached","bandwidth":1000,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"volumes":[{"active":true,"adjustable_capacity_states":["attached"],"adjustable_iops_states":["attached"],"attachment_state":"attached","bandwidth":1000,"busy":true,"capacity":1000,"catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"volume","source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"id"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","id":"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -23634,7 +24353,7 @@ def test_create_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -23702,7 +24421,7 @@ def test_create_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -23884,7 +24603,7 @@ def test_get_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -23922,7 +24641,7 @@ def test_get_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -23965,7 +24684,7 @@ def test_update_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -24022,7 +24741,7 @@ def test_update_volume_required_params(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -24077,7 +24796,7 @@ def test_update_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"active": true, "adjustable_capacity_states": ["attached"], "adjustable_iops_states": ["attached"], "attachment_state": "attached", "bandwidth": 1000, "busy": true, "capacity": 1000, "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "volume", "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "id"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -24191,7 +24910,7 @@ def test_list_snapshot_consistency_groups_all_params(self): """ # Set up mock url = preprocess_url('/snapshot_consistency_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -24248,7 +24967,7 @@ def test_list_snapshot_consistency_groups_required_params(self): """ # Set up mock url = preprocess_url('/snapshot_consistency_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -24280,7 +24999,7 @@ def test_list_snapshot_consistency_groups_value_error(self): """ # Set up mock url = preprocess_url('/snapshot_consistency_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -24911,7 +25630,7 @@ def test_list_snapshots_all_params(self): """ # Set up mock url = preprocess_url('/snapshots') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "snapshots": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' responses.add( responses.GET, url, @@ -25016,7 +25735,7 @@ def test_list_snapshots_required_params(self): """ # Set up mock url = preprocess_url('/snapshots') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "snapshots": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' responses.add( responses.GET, url, @@ -25048,7 +25767,7 @@ def test_list_snapshots_value_error(self): """ # Set up mock url = preprocess_url('/snapshots') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "snapshots": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' responses.add( responses.GET, url, @@ -25081,8 +25800,8 @@ def test_list_snapshots_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/snapshots') - mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' - mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"total_count":2,"limit":1}' + mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"progress":55,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"progress":55,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -25137,8 +25856,8 @@ def test_list_snapshots_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/snapshots') - mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' - mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"total_count":2,"limit":1}' + mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"progress":55,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","catalog_offering":{"plan":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"}},"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deletable":false,"encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"allow_user_image_creation":true,"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64","name":"ubuntu-24-04-amd64","user_data_format":"cloud_init","vendor":"Canonical","version":"16.04 LTS"},"progress":55,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_group"},"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"source_snapshot":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -25196,7 +25915,7 @@ def test_create_snapshot_all_params(self): """ # Set up mock url = preprocess_url('/snapshots') - mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' + mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' responses.add( responses.POST, url, @@ -25261,7 +25980,7 @@ def test_create_snapshot_value_error(self): """ # Set up mock url = preprocess_url('/snapshots') - mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' + mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' responses.add( responses.POST, url, @@ -25440,7 +26159,7 @@ def test_get_snapshot_all_params(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' + mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' responses.add( responses.GET, url, @@ -25478,7 +26197,7 @@ def test_get_snapshot_value_error(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' + mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' responses.add( responses.GET, url, @@ -25521,7 +26240,7 @@ def test_update_snapshot_all_params(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' + mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' responses.add( responses.PATCH, url, @@ -25571,7 +26290,7 @@ def test_update_snapshot_required_params(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' + mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' responses.add( responses.PATCH, url, @@ -25619,7 +26338,7 @@ def test_update_snapshot_value_error(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' + mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "catalog_offering": {"plan": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}}, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"allow_user_image_creation": true, "architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64", "name": "ubuntu-24-04-amd64", "user_data_format": "cloud_init", "vendor": "Canonical", "version": "16.04 LTS"}, "progress": 55, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}' responses.add( responses.PATCH, url, @@ -26056,7 +26775,7 @@ def test_list_share_profiles_all_params(self): """ # Set up mock url = preprocess_url('/share/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' responses.add( responses.GET, url, @@ -26104,7 +26823,7 @@ def test_list_share_profiles_required_params(self): """ # Set up mock url = preprocess_url('/share/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' responses.add( responses.GET, url, @@ -26136,7 +26855,7 @@ def test_list_share_profiles_value_error(self): """ # Set up mock url = preprocess_url('/share/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' responses.add( responses.GET, url, @@ -26327,7 +27046,7 @@ def test_list_shares_all_params(self): """ # Set up mock url = preprocess_url('/shares') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "shares": [{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -26384,7 +27103,7 @@ def test_list_shares_required_params(self): """ # Set up mock url = preprocess_url('/shares') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "shares": [{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -26416,7 +27135,7 @@ def test_list_shares_value_error(self): """ # Set up mock url = preprocess_url('/shares') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "shares": [{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -26449,8 +27168,8 @@ def test_list_shares_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/shares') - mock_response1 = '{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_transit_encryption_modes":["none"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"origin_share_access_revoked","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' - mock_response2 = '{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_transit_encryption_modes":["none"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"origin_share_access_revoked","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_transit_encryption_modes":["none"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"origin_share_access_revoked","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_transit_encryption_modes":["none"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"origin_share_access_revoked","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -26489,8 +27208,8 @@ def test_list_shares_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/shares') - mock_response1 = '{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_transit_encryption_modes":["none"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"origin_share_access_revoked","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' - mock_response2 = '{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_transit_encryption_modes":["none"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"origin_share_access_revoked","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_transit_encryption_modes":["none"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"origin_share_access_revoked","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"shares":[{"access_control_mode":"security_group","accessor_binding_role":"accessor","accessor_bindings":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","resource_type":"share_accessor_binding"}],"allowed_transit_encryption_modes":["none"],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_reasons":[{"code":"origin_share_access_revoked","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","origin_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -26532,7 +27251,7 @@ def test_create_share_all_params(self): """ # Set up mock url = preprocess_url('/shares') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -26559,7 +27278,7 @@ def test_create_share_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -26661,7 +27380,7 @@ def test_create_share_value_error(self): """ # Set up mock url = preprocess_url('/shares') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -26688,7 +27407,7 @@ def test_create_share_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -26792,7 +27511,7 @@ def test_delete_share_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, @@ -26832,7 +27551,7 @@ def test_delete_share_required_params(self): """ # Set up mock url = preprocess_url('/shares/testString') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, @@ -26870,7 +27589,7 @@ def test_delete_share_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, @@ -26913,7 +27632,7 @@ def test_get_share_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -26951,7 +27670,7 @@ def test_get_share_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -26994,7 +27713,7 @@ def test_update_share_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -27054,7 +27773,7 @@ def test_update_share_required_params(self): """ # Set up mock url = preprocess_url('/shares/testString') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -27112,7 +27831,7 @@ def test_update_share_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString') - mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"access_control_mode": "security_group", "accessor_binding_role": "accessor", "accessor_bindings": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "resource_type": "share_accessor_binding"}], "allowed_transit_encryption_modes": ["none"], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_reasons": [{"code": "origin_share_access_revoked", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "origin_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -27172,7 +27891,7 @@ def test_list_share_accessor_bindings_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString/accessor_bindings') - mock_response = '{"accessor_bindings": [{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"accessor_bindings": [{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -27219,7 +27938,7 @@ def test_list_share_accessor_bindings_required_params(self): """ # Set up mock url = preprocess_url('/shares/testString/accessor_bindings') - mock_response = '{"accessor_bindings": [{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"accessor_bindings": [{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -27257,7 +27976,7 @@ def test_list_share_accessor_bindings_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString/accessor_bindings') - mock_response = '{"accessor_bindings": [{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"accessor_bindings": [{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -27294,8 +28013,8 @@ def test_list_share_accessor_bindings_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/shares/testString/accessor_bindings') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}' - mock_response2 = '{"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}' + mock_response2 = '{"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -27331,8 +28050,8 @@ def test_list_share_accessor_bindings_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/shares/testString/accessor_bindings') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}' - mock_response2 = '{"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}' + mock_response2 = '{"accessor_bindings":[{"accessor":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"share_accessor_binding"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -27450,7 +28169,7 @@ def test_get_share_accessor_binding_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString/accessor_bindings/testString') - mock_response = '{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}' + mock_response = '{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}' responses.add( responses.GET, url, @@ -27490,7 +28209,7 @@ def test_get_share_accessor_binding_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString/accessor_bindings/testString') - mock_response = '{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}' + mock_response = '{"accessor": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "share_accessor_binding"}' responses.add( responses.GET, url, @@ -27653,7 +28372,7 @@ def test_list_share_mount_targets_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -27703,7 +28422,7 @@ def test_list_share_mount_targets_required_params(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -27741,7 +28460,7 @@ def test_list_share_mount_targets_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -27778,8 +28497,8 @@ def test_list_share_mount_targets_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/shares/testString/mount_targets') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' responses.add( responses.GET, url, @@ -27816,8 +28535,8 @@ def test_list_share_mount_targets_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/shares/testString/mount_targets') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' responses.add( responses.GET, url, @@ -27857,7 +28576,7 @@ def test_create_share_mount_target_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets') - mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -27884,7 +28603,7 @@ def test_create_share_mount_target_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -27943,7 +28662,7 @@ def test_create_share_mount_target_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets') - mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -27970,7 +28689,7 @@ def test_create_share_mount_target_value_error(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} @@ -28031,7 +28750,7 @@ def test_delete_share_mount_target_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets/testString') - mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.DELETE, url, @@ -28071,7 +28790,7 @@ def test_delete_share_mount_target_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets/testString') - mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.DELETE, url, @@ -28116,7 +28835,7 @@ def test_get_share_mount_target_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets/testString') - mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -28156,7 +28875,7 @@ def test_get_share_mount_target_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets/testString') - mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -28201,7 +28920,7 @@ def test_update_share_mount_target_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets/testString') - mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -28250,7 +28969,7 @@ def test_update_share_mount_target_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString/mount_targets/testString') - mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -28376,7 +29095,7 @@ def test_get_share_source_all_params(self): """ # Set up mock url = preprocess_url('/shares/testString/source') - mock_response = '{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}' + mock_response = '{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}' responses.add( responses.GET, url, @@ -28414,7 +29133,7 @@ def test_get_share_source_value_error(self): """ # Set up mock url = preprocess_url('/shares/testString/source') - mock_response = '{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}' + mock_response = '{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}' responses.add( responses.GET, url, @@ -28514,7 +29233,7 @@ def test_list_backup_policies_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies') - mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -28568,7 +29287,7 @@ def test_list_backup_policies_required_params(self): """ # Set up mock url = preprocess_url('/backup_policies') - mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -28600,7 +29319,7 @@ def test_list_backup_policies_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies') - mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -28633,8 +29352,8 @@ def test_list_backup_policies_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/backup_policies') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}' - mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"ebc2b430240943458b9e91e1432cfcce","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}' + mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"ebc2b430240943458b9e91e1432cfcce","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -28672,8 +29391,8 @@ def test_list_backup_policies_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/backup_policies') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}' - mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"ebc2b430240943458b9e91e1432cfcce","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}' + mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"ebc2b430240943458b9e91e1432cfcce","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -28714,7 +29433,7 @@ def test_create_backup_policy_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.POST, url, @@ -28811,7 +29530,7 @@ def test_create_backup_policy_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.POST, url, @@ -28910,7 +29629,7 @@ def test_list_backup_policy_jobs_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/jobs') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -28975,7 +29694,7 @@ def test_list_backup_policy_jobs_required_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/jobs') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -29013,7 +29732,7 @@ def test_list_backup_policy_jobs_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/jobs') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -29224,7 +29943,7 @@ def test_list_backup_policy_plans_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}], "total_count": 132}' responses.add( responses.GET, url, @@ -29268,7 +29987,7 @@ def test_list_backup_policy_plans_required_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}], "total_count": 132}' responses.add( responses.GET, url, @@ -29306,7 +30025,7 @@ def test_list_backup_policy_plans_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}], "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}], "total_count": 132}' responses.add( responses.GET, url, @@ -29989,7 +30708,7 @@ def test_delete_backup_policy_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.DELETE, url, @@ -30029,7 +30748,7 @@ def test_delete_backup_policy_required_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.DELETE, url, @@ -30067,7 +30786,7 @@ def test_delete_backup_policy_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.DELETE, url, @@ -30110,7 +30829,7 @@ def test_get_backup_policy_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.GET, url, @@ -30148,7 +30867,7 @@ def test_get_backup_policy_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.GET, url, @@ -30191,7 +30910,7 @@ def test_update_backup_policy_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.PATCH, url, @@ -30242,7 +30961,7 @@ def test_update_backup_policy_required_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.PATCH, url, @@ -30291,7 +31010,7 @@ def test_update_backup_policy_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "ebc2b430240943458b9e91e1432cfcce", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}' responses.add( responses.PATCH, url, @@ -30774,7 +31493,7 @@ def test_list_virtual_network_interfaces_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -30822,7 +31541,7 @@ def test_list_virtual_network_interfaces_required_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -30854,7 +31573,7 @@ def test_list_virtual_network_interfaces_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -30887,8 +31606,8 @@ def test_list_virtual_network_interfaces_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/virtual_network_interfaces') - mock_response1 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' - mock_response2 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -30924,8 +31643,8 @@ def test_list_virtual_network_interfaces_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/virtual_network_interfaces') - mock_response1 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' - mock_response2 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","id":"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"protocol_state_filtering_mode":"auto","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -30964,7 +31683,7 @@ def test_create_virtual_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -31052,7 +31771,7 @@ def test_create_virtual_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -31123,7 +31842,7 @@ def test_delete_virtual_network_interfaces_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, @@ -31161,7 +31880,7 @@ def test_delete_virtual_network_interfaces_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, @@ -31204,7 +31923,7 @@ def test_get_virtual_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -31242,7 +31961,7 @@ def test_get_virtual_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -31285,7 +32004,7 @@ def test_update_virtual_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -31336,7 +32055,7 @@ def test_update_virtual_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "id": "0717-54eb57ee-86f2-4796-90bb-d7874e0831ef", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "protocol_state_filtering_mode": "auto", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -31389,7 +32108,7 @@ def test_list_network_interface_floating_ips_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -31439,7 +32158,7 @@ def test_list_network_interface_floating_ips_required_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -31477,7 +32196,7 @@ def test_list_network_interface_floating_ips_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -31514,8 +32233,8 @@ def test_list_network_interface_floating_ips_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/virtual_network_interfaces/testString/floating_ips') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}]}' - mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}]}' + mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}]}' responses.add( responses.GET, url, @@ -31552,8 +32271,8 @@ def test_list_network_interface_floating_ips_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/virtual_network_interfaces/testString/floating_ips') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}]}' - mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}]}' + mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"}]}' responses.add( responses.GET, url, @@ -31672,7 +32391,7 @@ def test_get_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}' + mock_response = '{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}' responses.add( responses.GET, url, @@ -31712,7 +32431,7 @@ def test_get_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}' + mock_response = '{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}' responses.add( responses.GET, url, @@ -31757,7 +32476,7 @@ def test_add_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}' + mock_response = '{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}' responses.add( responses.PUT, url, @@ -31797,7 +32516,7 @@ def test_add_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}' + mock_response = '{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}' responses.add( responses.PUT, url, @@ -31842,7 +32561,7 @@ def test_list_virtual_network_interface_ips_all_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -31892,7 +32611,7 @@ def test_list_virtual_network_interface_ips_required_params(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -31930,7 +32649,7 @@ def test_list_virtual_network_interface_ips_value_error(self): """ # Set up mock url = preprocess_url('/virtual_network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -32289,7 +33008,7 @@ def test_add_virtual_network_interface_ip_value_error_with_retries(self): ############################################################################## ############################################################################## -# Start of Service: PublicGateways +# Start of Service: ClusterNetworks ############################################################################## # region @@ -32340,19 +33059,19 @@ def test_new_instance_required_param_none(self): ) -class TestListPublicGateways: +class TestListClusterNetworkProfiles: """ - Test Class for list_public_gateways + Test Class for list_cluster_network_profiles """ @responses.activate - def test_list_public_gateways_all_params(self): + def test_list_cluster_network_profiles_all_params(self): """ - list_public_gateways() + list_cluster_network_profiles() """ # Set up mock - url = preprocess_url('/public_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + url = preprocess_url('/cluster_network/profiles') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -32364,13 +33083,11 @@ def test_list_public_gateways_all_params(self): # Set up parameter values start = 'testString' limit = 50 - resource_group_id = 'testString' # Invoke method - response = _service.list_public_gateways( + response = _service.list_cluster_network_profiles( start=start, limit=limit, - resource_group_id=resource_group_id, headers={}, ) @@ -32382,25 +33099,24 @@ def test_list_public_gateways_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string - assert 'resource_group.id={}'.format(resource_group_id) in query_string - def test_list_public_gateways_all_params_with_retries(self): - # Enable retries and run test_list_public_gateways_all_params. + def test_list_cluster_network_profiles_all_params_with_retries(self): + # Enable retries and run test_list_cluster_network_profiles_all_params. _service.enable_retries() - self.test_list_public_gateways_all_params() + self.test_list_cluster_network_profiles_all_params() - # Disable retries and run test_list_public_gateways_all_params. + # Disable retries and run test_list_cluster_network_profiles_all_params. _service.disable_retries() - self.test_list_public_gateways_all_params() + self.test_list_cluster_network_profiles_all_params() @responses.activate - def test_list_public_gateways_required_params(self): + def test_list_cluster_network_profiles_required_params(self): """ - test_list_public_gateways_required_params() + test_list_cluster_network_profiles_required_params() """ # Set up mock - url = preprocess_url('/public_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + url = preprocess_url('/cluster_network/profiles') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -32410,29 +33126,29 @@ def test_list_public_gateways_required_params(self): ) # Invoke method - response = _service.list_public_gateways() + response = _service.list_cluster_network_profiles() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_public_gateways_required_params_with_retries(self): - # Enable retries and run test_list_public_gateways_required_params. + def test_list_cluster_network_profiles_required_params_with_retries(self): + # Enable retries and run test_list_cluster_network_profiles_required_params. _service.enable_retries() - self.test_list_public_gateways_required_params() + self.test_list_cluster_network_profiles_required_params() - # Disable retries and run test_list_public_gateways_required_params. + # Disable retries and run test_list_cluster_network_profiles_required_params. _service.disable_retries() - self.test_list_public_gateways_required_params() + self.test_list_cluster_network_profiles_required_params() @responses.activate - def test_list_public_gateways_value_error(self): + def test_list_cluster_network_profiles_value_error(self): """ - test_list_public_gateways_value_error() + test_list_cluster_network_profiles_value_error() """ # Set up mock - url = preprocess_url('/public_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + url = preprocess_url('/cluster_network/profiles') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}], "total_count": 132}' responses.add( responses.GET, url, @@ -32447,26 +33163,26 @@ def test_list_public_gateways_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_public_gateways(**req_copy) + _service.list_cluster_network_profiles(**req_copy) - def test_list_public_gateways_value_error_with_retries(self): - # Enable retries and run test_list_public_gateways_value_error. + def test_list_cluster_network_profiles_value_error_with_retries(self): + # Enable retries and run test_list_cluster_network_profiles_value_error. _service.enable_retries() - self.test_list_public_gateways_value_error() + self.test_list_cluster_network_profiles_value_error() - # Disable retries and run test_list_public_gateways_value_error. + # Disable retries and run test_list_cluster_network_profiles_value_error. _service.disable_retries() - self.test_list_public_gateways_value_error() + self.test_list_cluster_network_profiles_value_error() @responses.activate - def test_list_public_gateways_with_pager_get_next(self): + def test_list_cluster_network_profiles_with_pager_get_next(self): """ - test_list_public_gateways_with_pager_get_next() + test_list_cluster_network_profiles_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/public_gateways') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + url = preprocess_url('/cluster_network/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"vela","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zones":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"vela","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zones":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}]}]}' responses.add( responses.GET, url, @@ -32484,10 +33200,9 @@ def test_list_public_gateways_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = PublicGatewaysPager( + pager = ClusterNetworkProfilesPager( client=_service, limit=10, - resource_group_id='testString', ) while pager.has_next(): next_page = pager.get_next() @@ -32496,14 +33211,14 @@ def test_list_public_gateways_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_public_gateways_with_pager_get_all(self): + def test_list_cluster_network_profiles_with_pager_get_all(self): """ - test_list_public_gateways_with_pager_get_all() + test_list_cluster_network_profiles_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/public_gateways') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + url = preprocess_url('/cluster_network/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"vela","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zones":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"vela","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zones":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}]}]}' responses.add( responses.GET, url, @@ -32520,237 +33235,172 @@ def test_list_public_gateways_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = PublicGatewaysPager( + pager = ClusterNetworkProfilesPager( client=_service, limit=10, - resource_group_id='testString', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreatePublicGateway: +class TestGetClusterNetworkProfile: """ - Test Class for create_public_gateway + Test Class for get_cluster_network_profile """ @responses.activate - def test_create_public_gateway_all_params(self): + def test_get_cluster_network_profile_all_params(self): """ - create_public_gateway() + get_cluster_network_profile() """ # Set up mock - url = preprocess_url('/public_gateways') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_network/profiles/h100') + mock_response = '{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a VPCIdentityById model - vpc_identity_model = {} - vpc_identity_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' - - # Construct a dict representation of a ZoneIdentityByName model - zone_identity_model = {} - zone_identity_model['name'] = 'us-south-1' - - # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model - public_gateway_floating_ip_prototype_model = {} - public_gateway_floating_ip_prototype_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' - - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Set up parameter values - vpc = vpc_identity_model - zone = zone_identity_model - floating_ip = public_gateway_floating_ip_prototype_model - name = 'my-public-gateway' - resource_group = resource_group_identity_model + name = 'h100' # Invoke method - response = _service.create_public_gateway( - vpc, - zone, - floating_ip=floating_ip, - name=name, - resource_group=resource_group, + response = _service.get_cluster_network_profile( + name, 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['vpc'] == vpc_identity_model - assert req_body['zone'] == zone_identity_model - assert req_body['floating_ip'] == public_gateway_floating_ip_prototype_model - assert req_body['name'] == 'my-public-gateway' - assert req_body['resource_group'] == resource_group_identity_model + assert response.status_code == 200 - def test_create_public_gateway_all_params_with_retries(self): - # Enable retries and run test_create_public_gateway_all_params. + def test_get_cluster_network_profile_all_params_with_retries(self): + # Enable retries and run test_get_cluster_network_profile_all_params. _service.enable_retries() - self.test_create_public_gateway_all_params() + self.test_get_cluster_network_profile_all_params() - # Disable retries and run test_create_public_gateway_all_params. + # Disable retries and run test_get_cluster_network_profile_all_params. _service.disable_retries() - self.test_create_public_gateway_all_params() + self.test_get_cluster_network_profile_all_params() @responses.activate - def test_create_public_gateway_value_error(self): + def test_get_cluster_network_profile_value_error(self): """ - test_create_public_gateway_value_error() + test_get_cluster_network_profile_value_error() """ # Set up mock - url = preprocess_url('/public_gateways') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_network/profiles/h100') + mock_response = '{"family": "vela", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a VPCIdentityById model - vpc_identity_model = {} - vpc_identity_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' - - # Construct a dict representation of a ZoneIdentityByName model - zone_identity_model = {} - zone_identity_model['name'] = 'us-south-1' - - # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model - public_gateway_floating_ip_prototype_model = {} - public_gateway_floating_ip_prototype_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' - - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Set up parameter values - vpc = vpc_identity_model - zone = zone_identity_model - floating_ip = public_gateway_floating_ip_prototype_model - name = 'my-public-gateway' - resource_group = resource_group_identity_model + name = 'h100' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpc": vpc, - "zone": zone, + "name": name, } 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_public_gateway(**req_copy) + _service.get_cluster_network_profile(**req_copy) - def test_create_public_gateway_value_error_with_retries(self): - # Enable retries and run test_create_public_gateway_value_error. + def test_get_cluster_network_profile_value_error_with_retries(self): + # Enable retries and run test_get_cluster_network_profile_value_error. _service.enable_retries() - self.test_create_public_gateway_value_error() + self.test_get_cluster_network_profile_value_error() - # Disable retries and run test_create_public_gateway_value_error. + # Disable retries and run test_get_cluster_network_profile_value_error. _service.disable_retries() - self.test_create_public_gateway_value_error() + self.test_get_cluster_network_profile_value_error() -class TestDeletePublicGateway: +class TestListClusterNetworks: """ - Test Class for delete_public_gateway + Test Class for list_cluster_networks """ @responses.activate - def test_delete_public_gateway_all_params(self): + def test_list_cluster_networks_all_params(self): """ - delete_public_gateway() + list_cluster_networks() """ # Set up mock - url = preprocess_url('/public_gateways/testString') + url = preprocess_url('/cluster_networks') + mock_response = '{"cluster_networks": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( - responses.DELETE, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - id = 'testString' + start = 'testString' + limit = 50 + resource_group_id = 'testString' + name = 'my-name' + sort = 'name' + vpc_id = 'testString' + vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_name = 'my-vpc' # Invoke method - response = _service.delete_public_gateway( - id, + response = _service.list_cluster_networks( + start=start, + limit=limit, + resource_group_id=resource_group_id, + name=name, + sort=sort, + vpc_id=vpc_id, + vpc_crn=vpc_crn, + vpc_name=vpc_name, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 - - def test_delete_public_gateway_all_params_with_retries(self): - # Enable retries and run test_delete_public_gateway_all_params. - _service.enable_retries() - self.test_delete_public_gateway_all_params() - - # Disable retries and run test_delete_public_gateway_all_params. - _service.disable_retries() - self.test_delete_public_gateway_all_params() - - @responses.activate - def test_delete_public_gateway_value_error(self): - """ - test_delete_public_gateway_value_error() - """ - # Set up mock - url = preprocess_url('/public_gateways/testString') - responses.add( - responses.DELETE, - url, - status=204, - ) - - # Set up parameter values - id = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "id": id, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.delete_public_gateway(**req_copy) + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'name={}'.format(name) in query_string + assert 'sort={}'.format(sort) in query_string + assert 'vpc.id={}'.format(vpc_id) in query_string + assert 'vpc.crn={}'.format(vpc_crn) in query_string + assert 'vpc.name={}'.format(vpc_name) in query_string - def test_delete_public_gateway_value_error_with_retries(self): - # Enable retries and run test_delete_public_gateway_value_error. + def test_list_cluster_networks_all_params_with_retries(self): + # Enable retries and run test_list_cluster_networks_all_params. _service.enable_retries() - self.test_delete_public_gateway_value_error() + self.test_list_cluster_networks_all_params() - # Disable retries and run test_delete_public_gateway_value_error. + # Disable retries and run test_list_cluster_networks_all_params. _service.disable_retries() - self.test_delete_public_gateway_value_error() - - -class TestGetPublicGateway: - """ - Test Class for get_public_gateway - """ + self.test_list_cluster_networks_all_params() @responses.activate - def test_get_public_gateway_all_params(self): + def test_list_cluster_networks_required_params(self): """ - get_public_gateway() + test_list_cluster_networks_required_params() """ # Set up mock - url = preprocess_url('/public_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks') + mock_response = '{"cluster_networks": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -32759,36 +33409,30 @@ def test_get_public_gateway_all_params(self): status=200, ) - # Set up parameter values - id = 'testString' - # Invoke method - response = _service.get_public_gateway( - id, - headers={}, - ) + response = _service.list_cluster_networks() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_public_gateway_all_params_with_retries(self): - # Enable retries and run test_get_public_gateway_all_params. + def test_list_cluster_networks_required_params_with_retries(self): + # Enable retries and run test_list_cluster_networks_required_params. _service.enable_retries() - self.test_get_public_gateway_all_params() + self.test_list_cluster_networks_required_params() - # Disable retries and run test_get_public_gateway_all_params. + # Disable retries and run test_list_cluster_networks_required_params. _service.disable_retries() - self.test_get_public_gateway_all_params() + self.test_list_cluster_networks_required_params() @responses.activate - def test_get_public_gateway_value_error(self): + def test_list_cluster_networks_value_error(self): """ - test_get_public_gateway_value_error() + test_list_cluster_networks_value_error() """ # Set up mock - url = preprocess_url('/public_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks') + mock_response = '{"cluster_networks": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -32797,194 +33441,264 @@ def test_get_public_gateway_value_error(self): status=200, ) - # Set up parameter values - id = 'testString' - # Pass in all but one required param and check for a ValueError req_param_dict = { - "id": id, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_public_gateway(**req_copy) + _service.list_cluster_networks(**req_copy) - def test_get_public_gateway_value_error_with_retries(self): - # Enable retries and run test_get_public_gateway_value_error. + def test_list_cluster_networks_value_error_with_retries(self): + # Enable retries and run test_list_cluster_networks_value_error. _service.enable_retries() - self.test_get_public_gateway_value_error() + self.test_list_cluster_networks_value_error() - # Disable retries and run test_get_public_gateway_value_error. + # Disable retries and run test_list_cluster_networks_value_error. _service.disable_retries() - self.test_get_public_gateway_value_error() + self.test_list_cluster_networks_value_error() + @responses.activate + def test_list_cluster_networks_with_pager_get_next(self): + """ + test_list_cluster_networks_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/cluster_networks') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"cluster_networks":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"cluster_network","subnet_prefixes":[{"allocation_policy":"auto","cidr":"10.0.0.0/24"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"cluster_networks":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"cluster_network","subnet_prefixes":[{"allocation_policy":"auto","cidr":"10.0.0.0/24"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) -class TestUpdatePublicGateway: + # Exercise the pager class for this operation + all_results = [] + pager = ClusterNetworksPager( + client=_service, + limit=10, + resource_group_id='testString', + name='my-name', + sort='name', + vpc_id='testString', + vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', + vpc_name='my-vpc', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_cluster_networks_with_pager_get_all(self): + """ + test_list_cluster_networks_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/cluster_networks') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"cluster_networks":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"cluster_network","subnet_prefixes":[{"allocation_policy":"auto","cidr":"10.0.0.0/24"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"cluster_networks":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573","id":"0717-da0df18c-7598-4633-a648-fdaac28a5573","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100","name":"h100","resource_type":"cluster_network_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"cluster_network","subnet_prefixes":[{"allocation_policy":"auto","cidr":"10.0.0.0/24"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = ClusterNetworksPager( + client=_service, + limit=10, + resource_group_id='testString', + name='my-name', + sort='name', + vpc_id='testString', + vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', + vpc_name='my-vpc', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateClusterNetwork: """ - Test Class for update_public_gateway + Test Class for create_cluster_network """ @responses.activate - def test_update_public_gateway_all_params(self): + def test_create_cluster_network_all_params(self): """ - update_public_gateway() + create_cluster_network() """ # Set up mock - url = preprocess_url('/public_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( - responses.PATCH, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Construct a dict representation of a PublicGatewayPatch model - public_gateway_patch_model = {} - public_gateway_patch_model['name'] = 'my-public-gateway' + # Construct a dict representation of a ClusterNetworkProfileIdentityByName model + cluster_network_profile_identity_model = {} + cluster_network_profile_identity_model['name'] = 'h100' + + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a ClusterNetworkSubnetPrefixPrototype model + cluster_network_subnet_prefix_prototype_model = {} + cluster_network_subnet_prefix_prototype_model['cidr'] = '10.0.0.0/24' # Set up parameter values - id = 'testString' - public_gateway_patch = public_gateway_patch_model + profile = cluster_network_profile_identity_model + vpc = vpc_identity_model + zone = zone_identity_model + name = 'my-cluster-network' + resource_group = resource_group_identity_model + subnet_prefixes = [cluster_network_subnet_prefix_prototype_model] # Invoke method - response = _service.update_public_gateway( - id, - public_gateway_patch, + response = _service.create_cluster_network( + profile, + vpc, + zone, + name=name, + resource_group=resource_group, + subnet_prefixes=subnet_prefixes, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == public_gateway_patch + assert req_body['profile'] == cluster_network_profile_identity_model + assert req_body['vpc'] == vpc_identity_model + assert req_body['zone'] == zone_identity_model + assert req_body['name'] == 'my-cluster-network' + assert req_body['resource_group'] == resource_group_identity_model + assert req_body['subnet_prefixes'] == [cluster_network_subnet_prefix_prototype_model] - def test_update_public_gateway_all_params_with_retries(self): - # Enable retries and run test_update_public_gateway_all_params. + def test_create_cluster_network_all_params_with_retries(self): + # Enable retries and run test_create_cluster_network_all_params. _service.enable_retries() - self.test_update_public_gateway_all_params() + self.test_create_cluster_network_all_params() - # Disable retries and run test_update_public_gateway_all_params. + # Disable retries and run test_create_cluster_network_all_params. _service.disable_retries() - self.test_update_public_gateway_all_params() + self.test_create_cluster_network_all_params() @responses.activate - def test_update_public_gateway_value_error(self): + def test_create_cluster_network_value_error(self): """ - test_update_public_gateway_value_error() + test_create_cluster_network_value_error() """ # Set up mock - url = preprocess_url('/public_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( - responses.PATCH, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Construct a dict representation of a PublicGatewayPatch model - public_gateway_patch_model = {} - public_gateway_patch_model['name'] = 'my-public-gateway' + # Construct a dict representation of a ClusterNetworkProfileIdentityByName model + cluster_network_profile_identity_model = {} + cluster_network_profile_identity_model['name'] = 'h100' + + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a ClusterNetworkSubnetPrefixPrototype model + cluster_network_subnet_prefix_prototype_model = {} + cluster_network_subnet_prefix_prototype_model['cidr'] = '10.0.0.0/24' # Set up parameter values - id = 'testString' - public_gateway_patch = public_gateway_patch_model + profile = cluster_network_profile_identity_model + vpc = vpc_identity_model + zone = zone_identity_model + name = 'my-cluster-network' + resource_group = resource_group_identity_model + subnet_prefixes = [cluster_network_subnet_prefix_prototype_model] # Pass in all but one required param and check for a ValueError req_param_dict = { - "id": id, - "public_gateway_patch": public_gateway_patch, + "profile": profile, + "vpc": vpc, + "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.update_public_gateway(**req_copy) + _service.create_cluster_network(**req_copy) - def test_update_public_gateway_value_error_with_retries(self): - # Enable retries and run test_update_public_gateway_value_error. + def test_create_cluster_network_value_error_with_retries(self): + # Enable retries and run test_create_cluster_network_value_error. _service.enable_retries() - self.test_update_public_gateway_value_error() + self.test_create_cluster_network_value_error() - # Disable retries and run test_update_public_gateway_value_error. + # Disable retries and run test_create_cluster_network_value_error. _service.disable_retries() - self.test_update_public_gateway_value_error() - - -# endregion -############################################################################## -# End of Service: PublicGateways -############################################################################## - -############################################################################## -# Start of Service: FloatingIPs -############################################################################## -# region - - -class TestNewInstance: - """ - Test Class for new_instance - """ - - def test_new_instance(self): - """ - new_instance() - """ - os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE', - ) - - assert service is not None - assert isinstance(service, VpcV1) - - def test_new_instance_without_authenticator(self): - """ - new_instance_without_authenticator() - """ - with pytest.raises(ValueError, match='authenticator must be provided'): - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE_NOT_FOUND', - ) - - def test_new_instance_without_required_params(self): - """ - new_instance_without_required_params() - """ - with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): - service = VpcV1.new_instance() + self.test_create_cluster_network_value_error() - def test_new_instance_required_param_none(self): - """ - new_instance_required_param_none() - """ - with pytest.raises(ValueError, match='version must be provided'): - service = VpcV1.new_instance( - version=None, - ) - -class TestListFloatingIps: +class TestListClusterNetworkInterfaces: """ - Test Class for list_floating_ips + Test Class for list_cluster_network_interfaces """ @responses.activate - def test_list_floating_ips_all_params(self): + def test_list_cluster_network_interfaces_all_params(self): """ - list_floating_ips() + list_cluster_network_interfaces() """ # Set up mock - url = preprocess_url('/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/interfaces') + mock_response = '{"first": {"href": "href"}, "interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -32994,25 +33708,19 @@ def test_list_floating_ips_all_params(self): ) # Set up parameter values + cluster_network_id = 'testString' start = 'testString' limit = 50 - resource_group_id = 'testString' + name = 'my-name' sort = 'name' - target_id = 'testString' - target_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - target_name = 'my-resource' - target_resource_type = 'testString' # Invoke method - response = _service.list_floating_ips( + response = _service.list_cluster_network_interfaces( + cluster_network_id, start=start, limit=limit, - resource_group_id=resource_group_id, + name=name, sort=sort, - target_id=target_id, - target_crn=target_crn, - target_name=target_name, - target_resource_type=target_resource_type, headers={}, ) @@ -33024,30 +33732,26 @@ def test_list_floating_ips_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string - assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'name={}'.format(name) in query_string assert 'sort={}'.format(sort) in query_string - assert 'target.id={}'.format(target_id) in query_string - assert 'target.crn={}'.format(target_crn) in query_string - assert 'target.name={}'.format(target_name) in query_string - assert 'target.resource_type={}'.format(target_resource_type) in query_string - def test_list_floating_ips_all_params_with_retries(self): - # Enable retries and run test_list_floating_ips_all_params. + def test_list_cluster_network_interfaces_all_params_with_retries(self): + # Enable retries and run test_list_cluster_network_interfaces_all_params. _service.enable_retries() - self.test_list_floating_ips_all_params() + self.test_list_cluster_network_interfaces_all_params() - # Disable retries and run test_list_floating_ips_all_params. + # Disable retries and run test_list_cluster_network_interfaces_all_params. _service.disable_retries() - self.test_list_floating_ips_all_params() + self.test_list_cluster_network_interfaces_all_params() @responses.activate - def test_list_floating_ips_required_params(self): + def test_list_cluster_network_interfaces_required_params(self): """ - test_list_floating_ips_required_params() + test_list_cluster_network_interfaces_required_params() """ # Set up mock - url = preprocess_url('/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/interfaces') + mock_response = '{"first": {"href": "href"}, "interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -33056,30 +33760,36 @@ def test_list_floating_ips_required_params(self): status=200, ) + # Set up parameter values + cluster_network_id = 'testString' + # Invoke method - response = _service.list_floating_ips() + response = _service.list_cluster_network_interfaces( + cluster_network_id, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_floating_ips_required_params_with_retries(self): - # Enable retries and run test_list_floating_ips_required_params. + def test_list_cluster_network_interfaces_required_params_with_retries(self): + # Enable retries and run test_list_cluster_network_interfaces_required_params. _service.enable_retries() - self.test_list_floating_ips_required_params() + self.test_list_cluster_network_interfaces_required_params() - # Disable retries and run test_list_floating_ips_required_params. + # Disable retries and run test_list_cluster_network_interfaces_required_params. _service.disable_retries() - self.test_list_floating_ips_required_params() + self.test_list_cluster_network_interfaces_required_params() @responses.activate - def test_list_floating_ips_value_error(self): + def test_list_cluster_network_interfaces_value_error(self): """ - test_list_floating_ips_value_error() + test_list_cluster_network_interfaces_value_error() """ # Set up mock - url = preprocess_url('/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/interfaces') + mock_response = '{"first": {"href": "href"}, "interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -33088,32 +33798,36 @@ def test_list_floating_ips_value_error(self): status=200, ) + # Set up parameter values + cluster_network_id = 'testString' + # Pass in all but one required param and check for a ValueError req_param_dict = { + "cluster_network_id": cluster_network_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.list_floating_ips(**req_copy) + _service.list_cluster_network_interfaces(**req_copy) - def test_list_floating_ips_value_error_with_retries(self): - # Enable retries and run test_list_floating_ips_value_error. + def test_list_cluster_network_interfaces_value_error_with_retries(self): + # Enable retries and run test_list_cluster_network_interfaces_value_error. _service.enable_retries() - self.test_list_floating_ips_value_error() + self.test_list_cluster_network_interfaces_value_error() - # Disable retries and run test_list_floating_ips_value_error. + # Disable retries and run test_list_cluster_network_interfaces_value_error. _service.disable_retries() - self.test_list_floating_ips_value_error() + self.test_list_cluster_network_interfaces_value_error() @responses.activate - def test_list_floating_ips_with_pager_get_next(self): + def test_list_cluster_network_interfaces_with_pager_get_next(self): """ - test_list_floating_ips_with_pager_get_next() + test_list_cluster_network_interfaces_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/floating_ips') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + url = preprocess_url('/cluster_networks/testString/interfaces') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"},"target":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"},"target":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -33131,15 +33845,12 @@ def test_list_floating_ips_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = FloatingIpsPager( + pager = ClusterNetworkInterfacesPager( client=_service, + cluster_network_id='testString', limit=10, - resource_group_id='testString', + name='my-name', sort='name', - target_id='testString', - target_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727', - target_name='my-resource', - target_resource_type='testString', ) while pager.has_next(): next_page = pager.get_next() @@ -33148,14 +33859,14 @@ def test_list_floating_ips_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_floating_ips_with_pager_get_all(self): + def test_list_cluster_network_interfaces_with_pager_get_all(self): """ - test_list_floating_ips_with_pager_get_all() + test_list_cluster_network_interfaces_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/floating_ips') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + url = preprocess_url('/cluster_networks/testString/interfaces') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"},"target":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","mac_address":"02:00:4D:45:45:4D","name":"my-cluster-network-interface","primary_ip":{"address":"10.1.0.6","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-cluster-network-subnet-reserved-ip","resource_type":"cluster_network_subnet_reserved_ip"},"resource_type":"cluster_network_interface","subnet":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet"},"target":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213","id":"0717-fb880975-db45-4459-8548-64e3995ac213","name":"my-instance-network-attachment","resource_type":"instance_cluster_network_attachment"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -33172,34 +33883,31 @@ def test_list_floating_ips_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = FloatingIpsPager( + pager = ClusterNetworkInterfacesPager( client=_service, + cluster_network_id='testString', limit=10, - resource_group_id='testString', + name='my-name', sort='name', - target_id='testString', - target_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727', - target_name='my-resource', - target_resource_type='testString', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateFloatingIp: +class TestCreateClusterNetworkInterface: """ - Test Class for create_floating_ip + Test Class for create_cluster_network_interface """ @responses.activate - def test_create_floating_ip_all_params(self): + def test_create_cluster_network_interface_all_params(self): """ - create_floating_ip() + create_cluster_network_interface() """ # Set up mock - url = preprocess_url('/floating_ips') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks/testString/interfaces') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -33208,26 +33916,28 @@ def test_create_floating_ip_all_params(self): status=201, ) - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a ZoneIdentityByName model - zone_identity_model = {} - zone_identity_model['name'] = 'us-south-1' + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = {} + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' - # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model - floating_ip_prototype_model = {} - floating_ip_prototype_model['name'] = 'my-floating-ip' - floating_ip_prototype_model['resource_group'] = resource_group_identity_model - floating_ip_prototype_model['zone'] = zone_identity_model + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = {} + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' # Set up parameter values - floating_ip_prototype = floating_ip_prototype_model + cluster_network_id = 'testString' + name = 'my-cluster-network-interface' + primary_ip = cluster_network_interface_primary_ip_prototype_model + subnet = cluster_network_subnet_identity_model # Invoke method - response = _service.create_floating_ip( - floating_ip_prototype, + response = _service.create_cluster_network_interface( + cluster_network_id, + name=name, + primary_ip=primary_ip, + subnet=subnet, headers={}, ) @@ -33236,25 +33946,27 @@ def test_create_floating_ip_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == floating_ip_prototype + assert req_body['name'] == 'my-cluster-network-interface' + assert req_body['primary_ip'] == cluster_network_interface_primary_ip_prototype_model + assert req_body['subnet'] == cluster_network_subnet_identity_model - def test_create_floating_ip_all_params_with_retries(self): - # Enable retries and run test_create_floating_ip_all_params. + def test_create_cluster_network_interface_all_params_with_retries(self): + # Enable retries and run test_create_cluster_network_interface_all_params. _service.enable_retries() - self.test_create_floating_ip_all_params() + self.test_create_cluster_network_interface_all_params() - # Disable retries and run test_create_floating_ip_all_params. + # Disable retries and run test_create_cluster_network_interface_all_params. _service.disable_retries() - self.test_create_floating_ip_all_params() + self.test_create_cluster_network_interface_all_params() @responses.activate - def test_create_floating_ip_value_error(self): + def test_create_cluster_network_interface_value_error(self): """ - test_create_floating_ip_value_error() + test_create_cluster_network_interface_value_error() """ # Set up mock - url = preprocess_url('/floating_ips') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks/testString/interfaces') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -33263,130 +33975,181 @@ def test_create_floating_ip_value_error(self): status=201, ) - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a ZoneIdentityByName model - zone_identity_model = {} - zone_identity_model['name'] = 'us-south-1' + # Construct a dict representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_model = {} + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' - # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model - floating_ip_prototype_model = {} - floating_ip_prototype_model['name'] = 'my-floating-ip' - floating_ip_prototype_model['resource_group'] = resource_group_identity_model - floating_ip_prototype_model['zone'] = zone_identity_model + # Construct a dict representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_model = {} + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' # Set up parameter values - floating_ip_prototype = floating_ip_prototype_model + cluster_network_id = 'testString' + name = 'my-cluster-network-interface' + primary_ip = cluster_network_interface_primary_ip_prototype_model + subnet = cluster_network_subnet_identity_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "floating_ip_prototype": floating_ip_prototype, + "cluster_network_id": cluster_network_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.create_floating_ip(**req_copy) + _service.create_cluster_network_interface(**req_copy) - def test_create_floating_ip_value_error_with_retries(self): - # Enable retries and run test_create_floating_ip_value_error. + def test_create_cluster_network_interface_value_error_with_retries(self): + # Enable retries and run test_create_cluster_network_interface_value_error. _service.enable_retries() - self.test_create_floating_ip_value_error() + self.test_create_cluster_network_interface_value_error() - # Disable retries and run test_create_floating_ip_value_error. + # Disable retries and run test_create_cluster_network_interface_value_error. _service.disable_retries() - self.test_create_floating_ip_value_error() + self.test_create_cluster_network_interface_value_error() -class TestDeleteFloatingIp: +class TestDeleteClusterNetworkInterface: """ - Test Class for delete_floating_ip + Test Class for delete_cluster_network_interface """ @responses.activate - def test_delete_floating_ip_all_params(self): + def test_delete_cluster_network_interface_all_params(self): """ - delete_floating_ip() + delete_cluster_network_interface() """ # Set up mock - url = preprocess_url('/floating_ips/testString') + url = preprocess_url('/cluster_networks/testString/interfaces/testString') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, - status=204, + body=mock_response, + content_type='application/json', + status=202, ) # Set up parameter values + cluster_network_id = 'testString' id = 'testString' + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method - response = _service.delete_floating_ip( + response = _service.delete_cluster_network_interface( + cluster_network_id, id, + if_match=if_match, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 202 - def test_delete_floating_ip_all_params_with_retries(self): - # Enable retries and run test_delete_floating_ip_all_params. + def test_delete_cluster_network_interface_all_params_with_retries(self): + # Enable retries and run test_delete_cluster_network_interface_all_params. _service.enable_retries() - self.test_delete_floating_ip_all_params() + self.test_delete_cluster_network_interface_all_params() - # Disable retries and run test_delete_floating_ip_all_params. + # Disable retries and run test_delete_cluster_network_interface_all_params. _service.disable_retries() - self.test_delete_floating_ip_all_params() + self.test_delete_cluster_network_interface_all_params() @responses.activate - def test_delete_floating_ip_value_error(self): + def test_delete_cluster_network_interface_required_params(self): """ - test_delete_floating_ip_value_error() + test_delete_cluster_network_interface_required_params() """ # Set up mock - url = preprocess_url('/floating_ips/testString') + url = preprocess_url('/cluster_networks/testString/interfaces/testString') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.DELETE, url, - status=204, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + cluster_network_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.delete_cluster_network_interface( + cluster_network_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_cluster_network_interface_required_params_with_retries(self): + # Enable retries and run test_delete_cluster_network_interface_required_params. + _service.enable_retries() + self.test_delete_cluster_network_interface_required_params() + + # Disable retries and run test_delete_cluster_network_interface_required_params. + _service.disable_retries() + self.test_delete_cluster_network_interface_required_params() + + @responses.activate + def test_delete_cluster_network_interface_value_error(self): + """ + test_delete_cluster_network_interface_value_error() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString/interfaces/testString') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, ) # Set up parameter values + cluster_network_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "cluster_network_id": cluster_network_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.delete_floating_ip(**req_copy) + _service.delete_cluster_network_interface(**req_copy) - def test_delete_floating_ip_value_error_with_retries(self): - # Enable retries and run test_delete_floating_ip_value_error. + def test_delete_cluster_network_interface_value_error_with_retries(self): + # Enable retries and run test_delete_cluster_network_interface_value_error. _service.enable_retries() - self.test_delete_floating_ip_value_error() + self.test_delete_cluster_network_interface_value_error() - # Disable retries and run test_delete_floating_ip_value_error. + # Disable retries and run test_delete_cluster_network_interface_value_error. _service.disable_retries() - self.test_delete_floating_ip_value_error() + self.test_delete_cluster_network_interface_value_error() -class TestGetFloatingIp: +class TestGetClusterNetworkInterface: """ - Test Class for get_floating_ip + Test Class for get_cluster_network_interface """ @responses.activate - def test_get_floating_ip_all_params(self): + def test_get_cluster_network_interface_all_params(self): """ - get_floating_ip() + get_cluster_network_interface() """ # Set up mock - url = preprocess_url('/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks/testString/interfaces/testString') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -33396,10 +34159,12 @@ def test_get_floating_ip_all_params(self): ) # Set up parameter values + cluster_network_id = 'testString' id = 'testString' # Invoke method - response = _service.get_floating_ip( + response = _service.get_cluster_network_interface( + cluster_network_id, id, headers={}, ) @@ -33408,23 +34173,23 @@ def test_get_floating_ip_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_floating_ip_all_params_with_retries(self): - # Enable retries and run test_get_floating_ip_all_params. + def test_get_cluster_network_interface_all_params_with_retries(self): + # Enable retries and run test_get_cluster_network_interface_all_params. _service.enable_retries() - self.test_get_floating_ip_all_params() + self.test_get_cluster_network_interface_all_params() - # Disable retries and run test_get_floating_ip_all_params. + # Disable retries and run test_get_cluster_network_interface_all_params. _service.disable_retries() - self.test_get_floating_ip_all_params() + self.test_get_cluster_network_interface_all_params() @responses.activate - def test_get_floating_ip_value_error(self): + def test_get_cluster_network_interface_value_error(self): """ - test_get_floating_ip_value_error() + test_get_cluster_network_interface_value_error() """ # Set up mock - url = preprocess_url('/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks/testString/interfaces/testString') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -33434,40 +34199,42 @@ def test_get_floating_ip_value_error(self): ) # Set up parameter values + cluster_network_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "cluster_network_id": cluster_network_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_floating_ip(**req_copy) + _service.get_cluster_network_interface(**req_copy) - def test_get_floating_ip_value_error_with_retries(self): - # Enable retries and run test_get_floating_ip_value_error. + def test_get_cluster_network_interface_value_error_with_retries(self): + # Enable retries and run test_get_cluster_network_interface_value_error. _service.enable_retries() - self.test_get_floating_ip_value_error() + self.test_get_cluster_network_interface_value_error() - # Disable retries and run test_get_floating_ip_value_error. + # Disable retries and run test_get_cluster_network_interface_value_error. _service.disable_retries() - self.test_get_floating_ip_value_error() + self.test_get_cluster_network_interface_value_error() -class TestUpdateFloatingIp: +class TestUpdateClusterNetworkInterface: """ - Test Class for update_floating_ip + Test Class for update_cluster_network_interface """ @responses.activate - def test_update_floating_ip_all_params(self): + def test_update_cluster_network_interface_all_params(self): """ - update_floating_ip() + update_cluster_network_interface() """ # Set up mock - url = preprocess_url('/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks/testString/interfaces/testString') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -33476,23 +34243,23 @@ def test_update_floating_ip_all_params(self): status=200, ) - # Construct a dict representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model - floating_ip_target_patch_model = {} - floating_ip_target_patch_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - - # Construct a dict representation of a FloatingIPPatch model - floating_ip_patch_model = {} - floating_ip_patch_model['name'] = 'my-floating-ip' - floating_ip_patch_model['target'] = floating_ip_target_patch_model + # Construct a dict representation of a ClusterNetworkInterfacePatch model + cluster_network_interface_patch_model = {} + cluster_network_interface_patch_model['auto_delete'] = False + cluster_network_interface_patch_model['name'] = 'my-cluster-network-interface' # Set up parameter values + cluster_network_id = 'testString' id = 'testString' - floating_ip_patch = floating_ip_patch_model + cluster_network_interface_patch = cluster_network_interface_patch_model + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method - response = _service.update_floating_ip( + response = _service.update_cluster_network_interface( + cluster_network_id, id, - floating_ip_patch, + cluster_network_interface_patch, + if_match=if_match, headers={}, ) @@ -33501,25 +34268,25 @@ def test_update_floating_ip_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == floating_ip_patch + assert req_body == cluster_network_interface_patch - def test_update_floating_ip_all_params_with_retries(self): - # Enable retries and run test_update_floating_ip_all_params. + def test_update_cluster_network_interface_all_params_with_retries(self): + # Enable retries and run test_update_cluster_network_interface_all_params. _service.enable_retries() - self.test_update_floating_ip_all_params() + self.test_update_cluster_network_interface_all_params() - # Disable retries and run test_update_floating_ip_all_params. + # Disable retries and run test_update_cluster_network_interface_all_params. _service.disable_retries() - self.test_update_floating_ip_all_params() + self.test_update_cluster_network_interface_all_params() @responses.activate - def test_update_floating_ip_value_error(self): + def test_update_cluster_network_interface_required_params(self): """ - test_update_floating_ip_value_error() + test_update_cluster_network_interface_required_params() """ # Set up mock - url = preprocess_url('/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + url = preprocess_url('/cluster_networks/testString/interfaces/testString') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -33528,109 +34295,100 @@ def test_update_floating_ip_value_error(self): status=200, ) - # Construct a dict representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model - floating_ip_target_patch_model = {} - floating_ip_target_patch_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - - # Construct a dict representation of a FloatingIPPatch model - floating_ip_patch_model = {} - floating_ip_patch_model['name'] = 'my-floating-ip' - floating_ip_patch_model['target'] = floating_ip_target_patch_model + # Construct a dict representation of a ClusterNetworkInterfacePatch model + cluster_network_interface_patch_model = {} + cluster_network_interface_patch_model['auto_delete'] = False + cluster_network_interface_patch_model['name'] = 'my-cluster-network-interface' # Set up parameter values + cluster_network_id = 'testString' id = 'testString' - floating_ip_patch = floating_ip_patch_model + cluster_network_interface_patch = cluster_network_interface_patch_model - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "id": id, - "floating_ip_patch": floating_ip_patch, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.update_floating_ip(**req_copy) + # Invoke method + response = _service.update_cluster_network_interface( + cluster_network_id, + id, + cluster_network_interface_patch, + headers={}, + ) - def test_update_floating_ip_value_error_with_retries(self): - # Enable retries and run test_update_floating_ip_value_error. + # 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 == cluster_network_interface_patch + + def test_update_cluster_network_interface_required_params_with_retries(self): + # Enable retries and run test_update_cluster_network_interface_required_params. _service.enable_retries() - self.test_update_floating_ip_value_error() + self.test_update_cluster_network_interface_required_params() - # Disable retries and run test_update_floating_ip_value_error. + # Disable retries and run test_update_cluster_network_interface_required_params. _service.disable_retries() - self.test_update_floating_ip_value_error() + self.test_update_cluster_network_interface_required_params() - -# endregion -############################################################################## -# End of Service: FloatingIPs -############################################################################## - -############################################################################## -# Start of Service: NetworkACLs -############################################################################## -# region - - -class TestNewInstance: - """ - Test Class for new_instance - """ - - def test_new_instance(self): + @responses.activate + def test_update_cluster_network_interface_value_error(self): """ - new_instance() + test_update_cluster_network_interface_value_error() """ - os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE', + # Set up mock + url = preprocess_url('/cluster_networks/testString/interfaces/testString') + mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "mac_address": "02:00:4D:45:45:4D", "name": "my-cluster-network-interface", "primary_ip": {"address": "10.1.0.6", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-cluster-network-subnet-reserved-ip", "resource_type": "cluster_network_subnet_reserved_ip"}, "resource_type": "cluster_network_interface", "subnet": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet"}, "target": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213", "id": "0717-fb880975-db45-4459-8548-64e3995ac213", "name": "my-instance-network-attachment", "resource_type": "instance_cluster_network_attachment"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, ) - assert service is not None - assert isinstance(service, VpcV1) + # Construct a dict representation of a ClusterNetworkInterfacePatch model + cluster_network_interface_patch_model = {} + cluster_network_interface_patch_model['auto_delete'] = False + cluster_network_interface_patch_model['name'] = 'my-cluster-network-interface' - def test_new_instance_without_authenticator(self): - """ - new_instance_without_authenticator() - """ - with pytest.raises(ValueError, match='authenticator must be provided'): - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE_NOT_FOUND', - ) + # Set up parameter values + cluster_network_id = 'testString' + id = 'testString' + cluster_network_interface_patch = cluster_network_interface_patch_model - def test_new_instance_without_required_params(self): - """ - new_instance_without_required_params() - """ - with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): - service = VpcV1.new_instance() + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "cluster_network_id": cluster_network_id, + "id": id, + "cluster_network_interface_patch": cluster_network_interface_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_cluster_network_interface(**req_copy) - def test_new_instance_required_param_none(self): - """ - new_instance_required_param_none() - """ - with pytest.raises(ValueError, match='version must be provided'): - service = VpcV1.new_instance( - version=None, - ) + def test_update_cluster_network_interface_value_error_with_retries(self): + # Enable retries and run test_update_cluster_network_interface_value_error. + _service.enable_retries() + self.test_update_cluster_network_interface_value_error() + + # Disable retries and run test_update_cluster_network_interface_value_error. + _service.disable_retries() + self.test_update_cluster_network_interface_value_error() -class TestListNetworkAcls: +class TestListClusterNetworkSubnets: """ - Test Class for list_network_acls + Test Class for list_cluster_network_subnets """ @responses.activate - def test_list_network_acls_all_params(self): + def test_list_cluster_network_subnets_all_params(self): """ - list_network_acls() + list_cluster_network_subnets() """ # Set up mock - url = preprocess_url('/network_acls') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/subnets') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}], "total_count": 132}' responses.add( responses.GET, url, @@ -33640,15 +34398,19 @@ def test_list_network_acls_all_params(self): ) # Set up parameter values + cluster_network_id = 'testString' start = 'testString' limit = 50 - resource_group_id = 'testString' + name = 'my-name' + sort = 'name' # Invoke method - response = _service.list_network_acls( + response = _service.list_cluster_network_subnets( + cluster_network_id, start=start, limit=limit, - resource_group_id=resource_group_id, + name=name, + sort=sort, headers={}, ) @@ -33660,25 +34422,26 @@ def test_list_network_acls_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string - assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'name={}'.format(name) in query_string + assert 'sort={}'.format(sort) in query_string - def test_list_network_acls_all_params_with_retries(self): - # Enable retries and run test_list_network_acls_all_params. + def test_list_cluster_network_subnets_all_params_with_retries(self): + # Enable retries and run test_list_cluster_network_subnets_all_params. _service.enable_retries() - self.test_list_network_acls_all_params() + self.test_list_cluster_network_subnets_all_params() - # Disable retries and run test_list_network_acls_all_params. + # Disable retries and run test_list_cluster_network_subnets_all_params. _service.disable_retries() - self.test_list_network_acls_all_params() + self.test_list_cluster_network_subnets_all_params() @responses.activate - def test_list_network_acls_required_params(self): + def test_list_cluster_network_subnets_required_params(self): """ - test_list_network_acls_required_params() + test_list_cluster_network_subnets_required_params() """ # Set up mock - url = preprocess_url('/network_acls') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/subnets') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}], "total_count": 132}' responses.add( responses.GET, url, @@ -33687,30 +34450,36 @@ def test_list_network_acls_required_params(self): status=200, ) + # Set up parameter values + cluster_network_id = 'testString' + # Invoke method - response = _service.list_network_acls() + response = _service.list_cluster_network_subnets( + cluster_network_id, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_network_acls_required_params_with_retries(self): - # Enable retries and run test_list_network_acls_required_params. + def test_list_cluster_network_subnets_required_params_with_retries(self): + # Enable retries and run test_list_cluster_network_subnets_required_params. _service.enable_retries() - self.test_list_network_acls_required_params() + self.test_list_cluster_network_subnets_required_params() - # Disable retries and run test_list_network_acls_required_params. + # Disable retries and run test_list_cluster_network_subnets_required_params. _service.disable_retries() - self.test_list_network_acls_required_params() + self.test_list_cluster_network_subnets_required_params() @responses.activate - def test_list_network_acls_value_error(self): + def test_list_cluster_network_subnets_value_error(self): """ - test_list_network_acls_value_error() + test_list_cluster_network_subnets_value_error() """ # Set up mock - url = preprocess_url('/network_acls') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/subnets') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}], "total_count": 132}' responses.add( responses.GET, url, @@ -33719,32 +34488,36 @@ def test_list_network_acls_value_error(self): status=200, ) + # Set up parameter values + cluster_network_id = 'testString' + # Pass in all but one required param and check for a ValueError req_param_dict = { + "cluster_network_id": cluster_network_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.list_network_acls(**req_copy) + _service.list_cluster_network_subnets(**req_copy) - def test_list_network_acls_value_error_with_retries(self): - # Enable retries and run test_list_network_acls_value_error. + def test_list_cluster_network_subnets_value_error_with_retries(self): + # Enable retries and run test_list_cluster_network_subnets_value_error. _service.enable_retries() - self.test_list_network_acls_value_error() + self.test_list_cluster_network_subnets_value_error() - # Disable retries and run test_list_network_acls_value_error. + # Disable retries and run test_list_cluster_network_subnets_value_error. _service.disable_retries() - self.test_list_network_acls_value_error() + self.test_list_cluster_network_subnets_value_error() @responses.activate - def test_list_network_acls_with_pager_get_next(self): + def test_list_cluster_network_subnets_with_pager_get_next(self): """ - test_list_network_acls_with_pager_get_next() + test_list_cluster_network_subnets_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/network_acls') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + url = preprocess_url('/cluster_networks/testString/subnets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet","total_ipv4_address_count":256}]}' + mock_response2 = '{"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet","total_ipv4_address_count":256}]}' responses.add( responses.GET, url, @@ -33762,10 +34535,12 @@ def test_list_network_acls_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = NetworkAclsPager( + pager = ClusterNetworkSubnetsPager( client=_service, + cluster_network_id='testString', limit=10, - resource_group_id='testString', + name='my-name', + sort='name', ) while pager.has_next(): next_page = pager.get_next() @@ -33774,14 +34549,14 @@ def test_list_network_acls_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_network_acls_with_pager_get_all(self): + def test_list_cluster_network_subnets_with_pager_get_all(self): """ - test_list_network_acls_with_pager_get_all() + test_list_cluster_network_subnets_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/network_acls') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + url = preprocess_url('/cluster_networks/testString/subnets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet","total_ipv4_address_count":256}]}' + mock_response2 = '{"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","id":"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet","resource_type":"cluster_network_subnet","total_ipv4_address_count":256}]}' responses.add( responses.GET, url, @@ -33798,29 +34573,31 @@ def test_list_network_acls_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = NetworkAclsPager( + pager = ClusterNetworkSubnetsPager( client=_service, + cluster_network_id='testString', limit=10, - resource_group_id='testString', + name='my-name', + sort='name', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateNetworkAcl: +class TestCreateClusterNetworkSubnet: """ - Test Class for create_network_acl + Test Class for create_cluster_network_subnet """ @responses.activate - def test_create_network_acl_all_params(self): + def test_create_cluster_network_subnet_all_params(self): """ - create_network_acl() + create_cluster_network_subnet() """ # Set up mock - url = preprocess_url('/network_acls') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/cluster_networks/testString/subnets') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' responses.add( responses.POST, url, @@ -33829,41 +34606,20 @@ def test_create_network_acl_all_params(self): status=201, ) - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a VPCIdentityById model - vpc_identity_model = {} - vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f' - - # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model - network_acl_rule_prototype_network_acl_context_model = {} - network_acl_rule_prototype_network_acl_context_model['action'] = 'allow' - network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_model['ip_version'] = 'ipv4' - network_acl_rule_prototype_network_acl_context_model['name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_model['source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_model['destination_port_max'] = 22 - network_acl_rule_prototype_network_acl_context_model['destination_port_min'] = 22 - network_acl_rule_prototype_network_acl_context_model['protocol'] = 'udp' - network_acl_rule_prototype_network_acl_context_model['source_port_max'] = 65535 - network_acl_rule_prototype_network_acl_context_model['source_port_min'] = 49152 - - # Construct a dict representation of a NetworkACLPrototypeNetworkACLByRules model - network_acl_prototype_model = {} - network_acl_prototype_model['name'] = 'my-network-acl' - network_acl_prototype_model['resource_group'] = resource_group_identity_model - network_acl_prototype_model['vpc'] = vpc_identity_model - network_acl_prototype_model['rules'] = [network_acl_rule_prototype_network_acl_context_model] + # Construct a dict representation of a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model + cluster_network_subnet_prototype_model = {} + cluster_network_subnet_prototype_model['ip_version'] = 'ipv4' + cluster_network_subnet_prototype_model['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_prototype_model['total_ipv4_address_count'] = 256 # Set up parameter values - network_acl_prototype = network_acl_prototype_model + cluster_network_id = 'testString' + cluster_network_subnet_prototype = cluster_network_subnet_prototype_model # Invoke method - response = _service.create_network_acl( - network_acl_prototype, + response = _service.create_cluster_network_subnet( + cluster_network_id, + cluster_network_subnet_prototype, headers={}, ) @@ -33872,25 +34628,25 @@ def test_create_network_acl_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == network_acl_prototype + assert req_body == cluster_network_subnet_prototype - def test_create_network_acl_all_params_with_retries(self): - # Enable retries and run test_create_network_acl_all_params. + def test_create_cluster_network_subnet_all_params_with_retries(self): + # Enable retries and run test_create_cluster_network_subnet_all_params. _service.enable_retries() - self.test_create_network_acl_all_params() + self.test_create_cluster_network_subnet_all_params() - # Disable retries and run test_create_network_acl_all_params. + # Disable retries and run test_create_cluster_network_subnet_all_params. _service.disable_retries() - self.test_create_network_acl_all_params() + self.test_create_cluster_network_subnet_all_params() @responses.activate - def test_create_network_acl_value_error(self): + def test_create_cluster_network_subnet_value_error(self): """ - test_create_network_acl_value_error() + test_create_cluster_network_subnet_value_error() """ # Set up mock - url = preprocess_url('/network_acls') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/cluster_networks/testString/subnets') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' responses.add( responses.POST, url, @@ -33899,145 +34655,144 @@ def test_create_network_acl_value_error(self): status=201, ) - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a VPCIdentityById model - vpc_identity_model = {} - vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f' - - # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model - network_acl_rule_prototype_network_acl_context_model = {} - network_acl_rule_prototype_network_acl_context_model['action'] = 'allow' - network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_model['ip_version'] = 'ipv4' - network_acl_rule_prototype_network_acl_context_model['name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_model['source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_model['destination_port_max'] = 22 - network_acl_rule_prototype_network_acl_context_model['destination_port_min'] = 22 - network_acl_rule_prototype_network_acl_context_model['protocol'] = 'udp' - network_acl_rule_prototype_network_acl_context_model['source_port_max'] = 65535 - network_acl_rule_prototype_network_acl_context_model['source_port_min'] = 49152 - - # Construct a dict representation of a NetworkACLPrototypeNetworkACLByRules model - network_acl_prototype_model = {} - network_acl_prototype_model['name'] = 'my-network-acl' - network_acl_prototype_model['resource_group'] = resource_group_identity_model - network_acl_prototype_model['vpc'] = vpc_identity_model - network_acl_prototype_model['rules'] = [network_acl_rule_prototype_network_acl_context_model] + # Construct a dict representation of a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model + cluster_network_subnet_prototype_model = {} + cluster_network_subnet_prototype_model['ip_version'] = 'ipv4' + cluster_network_subnet_prototype_model['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_prototype_model['total_ipv4_address_count'] = 256 # Set up parameter values - network_acl_prototype = network_acl_prototype_model + cluster_network_id = 'testString' + cluster_network_subnet_prototype = cluster_network_subnet_prototype_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "network_acl_prototype": network_acl_prototype, + "cluster_network_id": cluster_network_id, + "cluster_network_subnet_prototype": cluster_network_subnet_prototype, } 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_network_acl(**req_copy) + _service.create_cluster_network_subnet(**req_copy) - def test_create_network_acl_value_error_with_retries(self): - # Enable retries and run test_create_network_acl_value_error. + def test_create_cluster_network_subnet_value_error_with_retries(self): + # Enable retries and run test_create_cluster_network_subnet_value_error. _service.enable_retries() - self.test_create_network_acl_value_error() + self.test_create_cluster_network_subnet_value_error() - # Disable retries and run test_create_network_acl_value_error. + # Disable retries and run test_create_cluster_network_subnet_value_error. _service.disable_retries() - self.test_create_network_acl_value_error() + self.test_create_cluster_network_subnet_value_error() -class TestDeleteNetworkAcl: +class TestListClusterNetworkSubnetReservedIps: """ - Test Class for delete_network_acl + Test Class for list_cluster_network_subnet_reserved_ips """ @responses.activate - def test_delete_network_acl_all_params(self): + def test_list_cluster_network_subnet_reserved_ips_all_params(self): """ - delete_network_acl() + list_cluster_network_subnet_reserved_ips() """ # Set up mock - url = preprocess_url('/network_acls/testString') + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reserved_ips": [{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}], "total_count": 132}' responses.add( - responses.DELETE, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - id = 'testString' + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + start = 'testString' + limit = 50 + name = 'my-name' + sort = 'name' # Invoke method - response = _service.delete_network_acl( - id, + response = _service.list_cluster_network_subnet_reserved_ips( + cluster_network_id, + cluster_network_subnet_id, + start=start, + limit=limit, + name=name, + sort=sort, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'name={}'.format(name) in query_string + assert 'sort={}'.format(sort) in query_string - def test_delete_network_acl_all_params_with_retries(self): - # Enable retries and run test_delete_network_acl_all_params. + def test_list_cluster_network_subnet_reserved_ips_all_params_with_retries(self): + # Enable retries and run test_list_cluster_network_subnet_reserved_ips_all_params. _service.enable_retries() - self.test_delete_network_acl_all_params() + self.test_list_cluster_network_subnet_reserved_ips_all_params() - # Disable retries and run test_delete_network_acl_all_params. + # Disable retries and run test_list_cluster_network_subnet_reserved_ips_all_params. _service.disable_retries() - self.test_delete_network_acl_all_params() + self.test_list_cluster_network_subnet_reserved_ips_all_params() @responses.activate - def test_delete_network_acl_value_error(self): + def test_list_cluster_network_subnet_reserved_ips_required_params(self): """ - test_delete_network_acl_value_error() + test_list_cluster_network_subnet_reserved_ips_required_params() """ # Set up mock - url = preprocess_url('/network_acls/testString') + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reserved_ips": [{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}], "total_count": 132}' responses.add( - responses.DELETE, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - id = 'testString' + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "id": id, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.delete_network_acl(**req_copy) + # Invoke method + response = _service.list_cluster_network_subnet_reserved_ips( + cluster_network_id, + cluster_network_subnet_id, + headers={}, + ) - def test_delete_network_acl_value_error_with_retries(self): - # Enable retries and run test_delete_network_acl_value_error. + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_cluster_network_subnet_reserved_ips_required_params_with_retries(self): + # Enable retries and run test_list_cluster_network_subnet_reserved_ips_required_params. _service.enable_retries() - self.test_delete_network_acl_value_error() + self.test_list_cluster_network_subnet_reserved_ips_required_params() - # Disable retries and run test_delete_network_acl_value_error. + # Disable retries and run test_list_cluster_network_subnet_reserved_ips_required_params. _service.disable_retries() - self.test_delete_network_acl_value_error() - - -class TestGetNetworkAcl: - """ - Test Class for get_network_acl - """ + self.test_list_cluster_network_subnet_reserved_ips_required_params() @responses.activate - def test_get_network_acl_all_params(self): + def test_list_cluster_network_subnet_reserved_ips_value_error(self): """ - get_network_acl() + test_list_cluster_network_subnet_reserved_ips_value_error() """ # Set up mock - url = preprocess_url('/network_acls/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "reserved_ips": [{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -34047,583 +34802,723 @@ def test_get_network_acl_all_params(self): ) # Set up parameter values - id = 'testString' - - # Invoke method - response = _service.get_network_acl( - id, - headers={}, - ) + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "cluster_network_id": cluster_network_id, + "cluster_network_subnet_id": cluster_network_subnet_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.list_cluster_network_subnet_reserved_ips(**req_copy) - def test_get_network_acl_all_params_with_retries(self): - # Enable retries and run test_get_network_acl_all_params. + def test_list_cluster_network_subnet_reserved_ips_value_error_with_retries(self): + # Enable retries and run test_list_cluster_network_subnet_reserved_ips_value_error. _service.enable_retries() - self.test_get_network_acl_all_params() + self.test_list_cluster_network_subnet_reserved_ips_value_error() - # Disable retries and run test_get_network_acl_all_params. + # Disable retries and run test_list_cluster_network_subnet_reserved_ips_value_error. _service.disable_retries() - self.test_get_network_acl_all_params() + self.test_list_cluster_network_subnet_reserved_ips_value_error() @responses.activate - def test_get_network_acl_value_error(self): + def test_list_cluster_network_subnet_reserved_ips_with_pager_get_next(self): """ - test_get_network_acl_value_error() + test_list_cluster_network_subnet_reserved_ips_with_pager_get_next() """ - # Set up mock - url = preprocess_url('/network_acls/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + # Set up a two-page mock response + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"reserved_ips":[{"address":"10.1.0.6","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet-reserved-ip","owner":"user","resource_type":"cluster_network_subnet_reserved_ip","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","resource_type":"cluster_network_interface"}}],"total_count":2,"limit":1}' + mock_response2 = '{"reserved_ips":[{"address":"10.1.0.6","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet-reserved-ip","owner":"user","resource_type":"cluster_network_subnet_reserved_ip","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","resource_type":"cluster_network_interface"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, - body=mock_response, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, content_type='application/json', status=200, ) - # Set up parameter values - id = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "id": id, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.get_network_acl(**req_copy) + # Exercise the pager class for this operation + all_results = [] + pager = ClusterNetworkSubnetReservedIpsPager( + client=_service, + cluster_network_id='testString', + cluster_network_subnet_id='testString', + limit=10, + name='my-name', + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 - def test_get_network_acl_value_error_with_retries(self): - # Enable retries and run test_get_network_acl_value_error. - _service.enable_retries() - self.test_get_network_acl_value_error() + @responses.activate + def test_list_cluster_network_subnet_reserved_ips_with_pager_get_all(self): + """ + test_list_cluster_network_subnet_reserved_ips_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"reserved_ips":[{"address":"10.1.0.6","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet-reserved-ip","owner":"user","resource_type":"cluster_network_subnet_reserved_ip","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","resource_type":"cluster_network_interface"}}],"total_count":2,"limit":1}' + mock_response2 = '{"reserved_ips":[{"address":"10.1.0.6","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-cluster-network-subnet-reserved-ip","owner":"user","resource_type":"cluster_network_subnet_reserved_ip","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","id":"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb","name":"my-cluster-network-interface","resource_type":"cluster_network_interface"}}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) - # Disable retries and run test_get_network_acl_value_error. - _service.disable_retries() - self.test_get_network_acl_value_error() + # Exercise the pager class for this operation + pager = ClusterNetworkSubnetReservedIpsPager( + client=_service, + cluster_network_id='testString', + cluster_network_subnet_id='testString', + limit=10, + name='my-name', + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 -class TestUpdateNetworkAcl: +class TestCreateClusterNetworkSubnetReservedIp: """ - Test Class for update_network_acl + Test Class for create_cluster_network_subnet_reserved_ip """ @responses.activate - def test_update_network_acl_all_params(self): + def test_create_cluster_network_subnet_reserved_ip_all_params(self): """ - update_network_acl() + create_cluster_network_subnet_reserved_ip() """ # Set up mock - url = preprocess_url('/network_acls/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( - responses.PATCH, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Construct a dict representation of a NetworkACLPatch model - network_acl_patch_model = {} - network_acl_patch_model['name'] = 'my-network-acl' - # Set up parameter values - id = 'testString' - network_acl_patch = network_acl_patch_model + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + address = '192.168.3.4' + name = 'my-cluster-network-subnet-reserved-ip' # Invoke method - response = _service.update_network_acl( - id, - network_acl_patch, + response = _service.create_cluster_network_subnet_reserved_ip( + cluster_network_id, + cluster_network_subnet_id, + address=address, + name=name, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == network_acl_patch + assert req_body['address'] == '192.168.3.4' + assert req_body['name'] == 'my-cluster-network-subnet-reserved-ip' - def test_update_network_acl_all_params_with_retries(self): - # Enable retries and run test_update_network_acl_all_params. + def test_create_cluster_network_subnet_reserved_ip_all_params_with_retries(self): + # Enable retries and run test_create_cluster_network_subnet_reserved_ip_all_params. _service.enable_retries() - self.test_update_network_acl_all_params() + self.test_create_cluster_network_subnet_reserved_ip_all_params() - # Disable retries and run test_update_network_acl_all_params. + # Disable retries and run test_create_cluster_network_subnet_reserved_ip_all_params. _service.disable_retries() - self.test_update_network_acl_all_params() + self.test_create_cluster_network_subnet_reserved_ip_all_params() @responses.activate - def test_update_network_acl_value_error(self): + def test_create_cluster_network_subnet_reserved_ip_value_error(self): """ - test_update_network_acl_value_error() + test_create_cluster_network_subnet_reserved_ip_value_error() """ # Set up mock - url = preprocess_url('/network_acls/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( - responses.PATCH, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Construct a dict representation of a NetworkACLPatch model - network_acl_patch_model = {} - network_acl_patch_model['name'] = 'my-network-acl' - # Set up parameter values - id = 'testString' - network_acl_patch = network_acl_patch_model + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + address = '192.168.3.4' + name = 'my-cluster-network-subnet-reserved-ip' # Pass in all but one required param and check for a ValueError req_param_dict = { - "id": id, - "network_acl_patch": network_acl_patch, + "cluster_network_id": cluster_network_id, + "cluster_network_subnet_id": cluster_network_subnet_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_network_acl(**req_copy) + _service.create_cluster_network_subnet_reserved_ip(**req_copy) - def test_update_network_acl_value_error_with_retries(self): - # Enable retries and run test_update_network_acl_value_error. + def test_create_cluster_network_subnet_reserved_ip_value_error_with_retries(self): + # Enable retries and run test_create_cluster_network_subnet_reserved_ip_value_error. _service.enable_retries() - self.test_update_network_acl_value_error() + self.test_create_cluster_network_subnet_reserved_ip_value_error() - # Disable retries and run test_update_network_acl_value_error. + # Disable retries and run test_create_cluster_network_subnet_reserved_ip_value_error. _service.disable_retries() - self.test_update_network_acl_value_error() + self.test_create_cluster_network_subnet_reserved_ip_value_error() -class TestListNetworkAclRules: +class TestDeleteClusterNetworkSubnetReservedIp: """ - Test Class for list_network_acl_rules + Test Class for delete_cluster_network_subnet_reserved_ip """ @responses.activate - def test_list_network_acl_rules_all_params(self): + def test_delete_cluster_network_subnet_reserved_ip_all_params(self): """ - list_network_acl_rules() + delete_cluster_network_subnet_reserved_ip() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips/testString') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( - responses.GET, + responses.DELETE, url, body=mock_response, content_type='application/json', - status=200, + status=202, ) # Set up parameter values - network_acl_id = 'testString' - start = 'testString' - limit = 50 - direction = 'inbound' + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + id = 'testString' + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method - response = _service.list_network_acl_rules( - network_acl_id, - start=start, - limit=limit, - direction=direction, + response = _service.delete_cluster_network_subnet_reserved_ip( + cluster_network_id, + cluster_network_subnet_id, + id, + if_match=if_match, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'direction={}'.format(direction) in query_string + assert response.status_code == 202 - def test_list_network_acl_rules_all_params_with_retries(self): - # Enable retries and run test_list_network_acl_rules_all_params. + def test_delete_cluster_network_subnet_reserved_ip_all_params_with_retries(self): + # Enable retries and run test_delete_cluster_network_subnet_reserved_ip_all_params. _service.enable_retries() - self.test_list_network_acl_rules_all_params() + self.test_delete_cluster_network_subnet_reserved_ip_all_params() - # Disable retries and run test_list_network_acl_rules_all_params. + # Disable retries and run test_delete_cluster_network_subnet_reserved_ip_all_params. _service.disable_retries() - self.test_list_network_acl_rules_all_params() + self.test_delete_cluster_network_subnet_reserved_ip_all_params() @responses.activate - def test_list_network_acl_rules_required_params(self): + def test_delete_cluster_network_subnet_reserved_ip_required_params(self): """ - test_list_network_acl_rules_required_params() + test_delete_cluster_network_subnet_reserved_ip_required_params() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips/testString') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( - responses.GET, + responses.DELETE, url, body=mock_response, content_type='application/json', - status=200, + status=202, ) # Set up parameter values - network_acl_id = 'testString' + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + id = 'testString' # Invoke method - response = _service.list_network_acl_rules( - network_acl_id, + response = _service.delete_cluster_network_subnet_reserved_ip( + cluster_network_id, + cluster_network_subnet_id, + id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 202 - def test_list_network_acl_rules_required_params_with_retries(self): - # Enable retries and run test_list_network_acl_rules_required_params. + def test_delete_cluster_network_subnet_reserved_ip_required_params_with_retries(self): + # Enable retries and run test_delete_cluster_network_subnet_reserved_ip_required_params. _service.enable_retries() - self.test_list_network_acl_rules_required_params() + self.test_delete_cluster_network_subnet_reserved_ip_required_params() - # Disable retries and run test_list_network_acl_rules_required_params. + # Disable retries and run test_delete_cluster_network_subnet_reserved_ip_required_params. _service.disable_retries() - self.test_list_network_acl_rules_required_params() + self.test_delete_cluster_network_subnet_reserved_ip_required_params() @responses.activate - def test_list_network_acl_rules_value_error(self): + def test_delete_cluster_network_subnet_reserved_ip_value_error(self): """ - test_list_network_acl_rules_value_error() + test_delete_cluster_network_subnet_reserved_ip_value_error() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips/testString') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( - responses.GET, + responses.DELETE, url, body=mock_response, content_type='application/json', - status=200, + status=202, ) # Set up parameter values - network_acl_id = 'testString' + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "network_acl_id": network_acl_id, + "cluster_network_id": cluster_network_id, + "cluster_network_subnet_id": cluster_network_subnet_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.list_network_acl_rules(**req_copy) + _service.delete_cluster_network_subnet_reserved_ip(**req_copy) - def test_list_network_acl_rules_value_error_with_retries(self): - # Enable retries and run test_list_network_acl_rules_value_error. + def test_delete_cluster_network_subnet_reserved_ip_value_error_with_retries(self): + # Enable retries and run test_delete_cluster_network_subnet_reserved_ip_value_error. _service.enable_retries() - self.test_list_network_acl_rules_value_error() + self.test_delete_cluster_network_subnet_reserved_ip_value_error() - # Disable retries and run test_list_network_acl_rules_value_error. + # Disable retries and run test_delete_cluster_network_subnet_reserved_ip_value_error. _service.disable_retries() - self.test_list_network_acl_rules_value_error() + self.test_delete_cluster_network_subnet_reserved_ip_value_error() + + +class TestGetClusterNetworkSubnetReservedIp: + """ + Test Class for get_cluster_network_subnet_reserved_ip + """ @responses.activate - def test_list_network_acl_rules_with_pager_get_next(self): + def test_get_cluster_network_subnet_reserved_ip_all_params(self): """ - test_list_network_acl_rules_with_pager_get_next() + get_cluster_network_subnet_reserved_ip() """ - # Set up a two-page mock response - url = preprocess_url('/network_acls/testString/rules') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' - mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) + # Set up mock + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips/testString') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( responses.GET, url, - body=mock_response2, + body=mock_response, content_type='application/json', status=200, ) - # Exercise the pager class for this operation - all_results = [] - pager = NetworkAclRulesPager( - client=_service, - network_acl_id='testString', - limit=10, - direction='inbound', + # Set up parameter values + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_cluster_network_subnet_reserved_ip( + cluster_network_id, + cluster_network_subnet_id, + id, + headers={}, ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_cluster_network_subnet_reserved_ip_all_params_with_retries(self): + # Enable retries and run test_get_cluster_network_subnet_reserved_ip_all_params. + _service.enable_retries() + self.test_get_cluster_network_subnet_reserved_ip_all_params() + + # Disable retries and run test_get_cluster_network_subnet_reserved_ip_all_params. + _service.disable_retries() + self.test_get_cluster_network_subnet_reserved_ip_all_params() @responses.activate - def test_list_network_acl_rules_with_pager_get_all(self): + def test_get_cluster_network_subnet_reserved_ip_value_error(self): """ - test_list_network_acl_rules_with_pager_get_all() + test_get_cluster_network_subnet_reserved_ip_value_error() """ - # Set up a two-page mock response - url = preprocess_url('/network_acls/testString/rules') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' - mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' + # Set up mock + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips/testString') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( responses.GET, url, - body=mock_response1, + body=mock_response, content_type='application/json', status=200, ) + + # Set up parameter values + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "cluster_network_id": cluster_network_id, + "cluster_network_subnet_id": cluster_network_subnet_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_cluster_network_subnet_reserved_ip(**req_copy) + + def test_get_cluster_network_subnet_reserved_ip_value_error_with_retries(self): + # Enable retries and run test_get_cluster_network_subnet_reserved_ip_value_error. + _service.enable_retries() + self.test_get_cluster_network_subnet_reserved_ip_value_error() + + # Disable retries and run test_get_cluster_network_subnet_reserved_ip_value_error. + _service.disable_retries() + self.test_get_cluster_network_subnet_reserved_ip_value_error() + + +class TestUpdateClusterNetworkSubnetReservedIp: + """ + Test Class for update_cluster_network_subnet_reserved_ip + """ + + @responses.activate + def test_update_cluster_network_subnet_reserved_ip_all_params(self): + """ + update_cluster_network_subnet_reserved_ip() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips/testString') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( - responses.GET, + responses.PATCH, url, - body=mock_response2, + body=mock_response, content_type='application/json', status=200, ) - # Exercise the pager class for this operation - pager = NetworkAclRulesPager( - client=_service, - network_acl_id='testString', - limit=10, - direction='inbound', + # Construct a dict representation of a ClusterNetworkSubnetReservedIPPatch model + cluster_network_subnet_reserved_ip_patch_model = {} + cluster_network_subnet_reserved_ip_patch_model['auto_delete'] = False + cluster_network_subnet_reserved_ip_patch_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + # Set up parameter values + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + id = 'testString' + cluster_network_subnet_reserved_ip_patch = cluster_network_subnet_reserved_ip_patch_model + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' + + # Invoke method + response = _service.update_cluster_network_subnet_reserved_ip( + cluster_network_id, + cluster_network_subnet_id, + id, + cluster_network_subnet_reserved_ip_patch, + if_match=if_match, + headers={}, ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + # 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 == cluster_network_subnet_reserved_ip_patch -class TestCreateNetworkAclRule: - """ - Test Class for create_network_acl_rule - """ + def test_update_cluster_network_subnet_reserved_ip_all_params_with_retries(self): + # Enable retries and run test_update_cluster_network_subnet_reserved_ip_all_params. + _service.enable_retries() + self.test_update_cluster_network_subnet_reserved_ip_all_params() + + # Disable retries and run test_update_cluster_network_subnet_reserved_ip_all_params. + _service.disable_retries() + self.test_update_cluster_network_subnet_reserved_ip_all_params() @responses.activate - def test_create_network_acl_rule_all_params(self): + def test_update_cluster_network_subnet_reserved_ip_required_params(self): """ - create_network_acl_rule() + test_update_cluster_network_subnet_reserved_ip_required_params() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips/testString') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( - responses.POST, + responses.PATCH, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model - network_acl_rule_before_prototype_model = {} - network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - - # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model - network_acl_rule_prototype_model = {} - network_acl_rule_prototype_model['action'] = 'allow' - network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model - network_acl_rule_prototype_model['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_model['direction'] = 'inbound' - network_acl_rule_prototype_model['ip_version'] = 'ipv4' - network_acl_rule_prototype_model['name'] = 'my-rule-2' - network_acl_rule_prototype_model['source'] = '192.168.3.2/32' - network_acl_rule_prototype_model['destination_port_max'] = 22 - network_acl_rule_prototype_model['destination_port_min'] = 22 - network_acl_rule_prototype_model['protocol'] = 'udp' - network_acl_rule_prototype_model['source_port_max'] = 65535 - network_acl_rule_prototype_model['source_port_min'] = 49152 + # Construct a dict representation of a ClusterNetworkSubnetReservedIPPatch model + cluster_network_subnet_reserved_ip_patch_model = {} + cluster_network_subnet_reserved_ip_patch_model['auto_delete'] = False + cluster_network_subnet_reserved_ip_patch_model['name'] = 'my-cluster-network-subnet-reserved-ip' # Set up parameter values - network_acl_id = 'testString' - network_acl_rule_prototype = network_acl_rule_prototype_model + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + id = 'testString' + cluster_network_subnet_reserved_ip_patch = cluster_network_subnet_reserved_ip_patch_model # Invoke method - response = _service.create_network_acl_rule( - network_acl_id, - network_acl_rule_prototype, + response = _service.update_cluster_network_subnet_reserved_ip( + cluster_network_id, + cluster_network_subnet_id, + id, + cluster_network_subnet_reserved_ip_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 201 + assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == network_acl_rule_prototype + assert req_body == cluster_network_subnet_reserved_ip_patch - def test_create_network_acl_rule_all_params_with_retries(self): - # Enable retries and run test_create_network_acl_rule_all_params. + def test_update_cluster_network_subnet_reserved_ip_required_params_with_retries(self): + # Enable retries and run test_update_cluster_network_subnet_reserved_ip_required_params. _service.enable_retries() - self.test_create_network_acl_rule_all_params() + self.test_update_cluster_network_subnet_reserved_ip_required_params() - # Disable retries and run test_create_network_acl_rule_all_params. + # Disable retries and run test_update_cluster_network_subnet_reserved_ip_required_params. _service.disable_retries() - self.test_create_network_acl_rule_all_params() + self.test_update_cluster_network_subnet_reserved_ip_required_params() @responses.activate - def test_create_network_acl_rule_value_error(self): + def test_update_cluster_network_subnet_reserved_ip_value_error(self): """ - test_create_network_acl_rule_value_error() + test_update_cluster_network_subnet_reserved_ip_value_error() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' + url = preprocess_url('/cluster_networks/testString/subnets/testString/reserved_ips/testString') + mock_response = '{"address": "10.1.0.6", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet-reserved-ip", "owner": "user", "resource_type": "cluster_network_subnet_reserved_ip", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "id": "0717-ffc092f7-5d02-4b93-ab69-26860529b9fb", "name": "my-cluster-network-interface", "resource_type": "cluster_network_interface"}}' responses.add( - responses.POST, + responses.PATCH, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model - network_acl_rule_before_prototype_model = {} - network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - - # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model - network_acl_rule_prototype_model = {} - network_acl_rule_prototype_model['action'] = 'allow' - network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model - network_acl_rule_prototype_model['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_model['direction'] = 'inbound' - network_acl_rule_prototype_model['ip_version'] = 'ipv4' - network_acl_rule_prototype_model['name'] = 'my-rule-2' - network_acl_rule_prototype_model['source'] = '192.168.3.2/32' - network_acl_rule_prototype_model['destination_port_max'] = 22 - network_acl_rule_prototype_model['destination_port_min'] = 22 - network_acl_rule_prototype_model['protocol'] = 'udp' - network_acl_rule_prototype_model['source_port_max'] = 65535 - network_acl_rule_prototype_model['source_port_min'] = 49152 + # Construct a dict representation of a ClusterNetworkSubnetReservedIPPatch model + cluster_network_subnet_reserved_ip_patch_model = {} + cluster_network_subnet_reserved_ip_patch_model['auto_delete'] = False + cluster_network_subnet_reserved_ip_patch_model['name'] = 'my-cluster-network-subnet-reserved-ip' # Set up parameter values - network_acl_id = 'testString' - network_acl_rule_prototype = network_acl_rule_prototype_model + cluster_network_id = 'testString' + cluster_network_subnet_id = 'testString' + id = 'testString' + cluster_network_subnet_reserved_ip_patch = cluster_network_subnet_reserved_ip_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "network_acl_id": network_acl_id, - "network_acl_rule_prototype": network_acl_rule_prototype, + "cluster_network_id": cluster_network_id, + "cluster_network_subnet_id": cluster_network_subnet_id, + "id": id, + "cluster_network_subnet_reserved_ip_patch": cluster_network_subnet_reserved_ip_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.create_network_acl_rule(**req_copy) + _service.update_cluster_network_subnet_reserved_ip(**req_copy) - def test_create_network_acl_rule_value_error_with_retries(self): - # Enable retries and run test_create_network_acl_rule_value_error. + def test_update_cluster_network_subnet_reserved_ip_value_error_with_retries(self): + # Enable retries and run test_update_cluster_network_subnet_reserved_ip_value_error. _service.enable_retries() - self.test_create_network_acl_rule_value_error() + self.test_update_cluster_network_subnet_reserved_ip_value_error() - # Disable retries and run test_create_network_acl_rule_value_error. + # Disable retries and run test_update_cluster_network_subnet_reserved_ip_value_error. _service.disable_retries() - self.test_create_network_acl_rule_value_error() + self.test_update_cluster_network_subnet_reserved_ip_value_error() -class TestDeleteNetworkAclRule: +class TestDeleteClusterNetworkSubnet: """ - Test Class for delete_network_acl_rule + Test Class for delete_cluster_network_subnet """ @responses.activate - def test_delete_network_acl_rule_all_params(self): + def test_delete_cluster_network_subnet_all_params(self): """ - delete_network_acl_rule() + delete_cluster_network_subnet() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules/testString') + url = preprocess_url('/cluster_networks/testString/subnets/testString') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' responses.add( responses.DELETE, url, - status=204, + body=mock_response, + content_type='application/json', + status=202, ) # Set up parameter values - network_acl_id = 'testString' + cluster_network_id = 'testString' id = 'testString' + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method - response = _service.delete_network_acl_rule( - network_acl_id, + response = _service.delete_cluster_network_subnet( + cluster_network_id, id, + if_match=if_match, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 202 - def test_delete_network_acl_rule_all_params_with_retries(self): - # Enable retries and run test_delete_network_acl_rule_all_params. + def test_delete_cluster_network_subnet_all_params_with_retries(self): + # Enable retries and run test_delete_cluster_network_subnet_all_params. _service.enable_retries() - self.test_delete_network_acl_rule_all_params() + self.test_delete_cluster_network_subnet_all_params() - # Disable retries and run test_delete_network_acl_rule_all_params. + # Disable retries and run test_delete_cluster_network_subnet_all_params. _service.disable_retries() - self.test_delete_network_acl_rule_all_params() + self.test_delete_cluster_network_subnet_all_params() @responses.activate - def test_delete_network_acl_rule_value_error(self): + def test_delete_cluster_network_subnet_required_params(self): """ - test_delete_network_acl_rule_value_error() + test_delete_cluster_network_subnet_required_params() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules/testString') + url = preprocess_url('/cluster_networks/testString/subnets/testString') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' responses.add( responses.DELETE, url, - status=204, + body=mock_response, + content_type='application/json', + status=202, ) # Set up parameter values - network_acl_id = 'testString' + cluster_network_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.delete_cluster_network_subnet( + cluster_network_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_cluster_network_subnet_required_params_with_retries(self): + # Enable retries and run test_delete_cluster_network_subnet_required_params. + _service.enable_retries() + self.test_delete_cluster_network_subnet_required_params() + + # Disable retries and run test_delete_cluster_network_subnet_required_params. + _service.disable_retries() + self.test_delete_cluster_network_subnet_required_params() + + @responses.activate + def test_delete_cluster_network_subnet_value_error(self): + """ + test_delete_cluster_network_subnet_value_error() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString/subnets/testString') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + cluster_network_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "network_acl_id": network_acl_id, + "cluster_network_id": cluster_network_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.delete_network_acl_rule(**req_copy) + _service.delete_cluster_network_subnet(**req_copy) - def test_delete_network_acl_rule_value_error_with_retries(self): - # Enable retries and run test_delete_network_acl_rule_value_error. + def test_delete_cluster_network_subnet_value_error_with_retries(self): + # Enable retries and run test_delete_cluster_network_subnet_value_error. _service.enable_retries() - self.test_delete_network_acl_rule_value_error() + self.test_delete_cluster_network_subnet_value_error() - # Disable retries and run test_delete_network_acl_rule_value_error. + # Disable retries and run test_delete_cluster_network_subnet_value_error. _service.disable_retries() - self.test_delete_network_acl_rule_value_error() + self.test_delete_cluster_network_subnet_value_error() -class TestGetNetworkAclRule: +class TestGetClusterNetworkSubnet: """ - Test Class for get_network_acl_rule + Test Class for get_cluster_network_subnet """ @responses.activate - def test_get_network_acl_rule_all_params(self): + def test_get_cluster_network_subnet_all_params(self): """ - get_network_acl_rule() + get_cluster_network_subnet() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules/testString') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' + url = preprocess_url('/cluster_networks/testString/subnets/testString') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' responses.add( responses.GET, url, @@ -34633,12 +35528,12 @@ def test_get_network_acl_rule_all_params(self): ) # Set up parameter values - network_acl_id = 'testString' + cluster_network_id = 'testString' id = 'testString' # Invoke method - response = _service.get_network_acl_rule( - network_acl_id, + response = _service.get_cluster_network_subnet( + cluster_network_id, id, headers={}, ) @@ -34647,23 +35542,23 @@ def test_get_network_acl_rule_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_network_acl_rule_all_params_with_retries(self): - # Enable retries and run test_get_network_acl_rule_all_params. + def test_get_cluster_network_subnet_all_params_with_retries(self): + # Enable retries and run test_get_cluster_network_subnet_all_params. _service.enable_retries() - self.test_get_network_acl_rule_all_params() + self.test_get_cluster_network_subnet_all_params() - # Disable retries and run test_get_network_acl_rule_all_params. + # Disable retries and run test_get_cluster_network_subnet_all_params. _service.disable_retries() - self.test_get_network_acl_rule_all_params() + self.test_get_cluster_network_subnet_all_params() @responses.activate - def test_get_network_acl_rule_value_error(self): + def test_get_cluster_network_subnet_value_error(self): """ - test_get_network_acl_rule_value_error() + test_get_cluster_network_subnet_value_error() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules/testString') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' + url = preprocess_url('/cluster_networks/testString/subnets/testString') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' responses.add( responses.GET, url, @@ -34673,42 +35568,42 @@ def test_get_network_acl_rule_value_error(self): ) # Set up parameter values - network_acl_id = 'testString' + cluster_network_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "network_acl_id": network_acl_id, + "cluster_network_id": cluster_network_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_network_acl_rule(**req_copy) + _service.get_cluster_network_subnet(**req_copy) - def test_get_network_acl_rule_value_error_with_retries(self): - # Enable retries and run test_get_network_acl_rule_value_error. + def test_get_cluster_network_subnet_value_error_with_retries(self): + # Enable retries and run test_get_cluster_network_subnet_value_error. _service.enable_retries() - self.test_get_network_acl_rule_value_error() + self.test_get_cluster_network_subnet_value_error() - # Disable retries and run test_get_network_acl_rule_value_error. + # Disable retries and run test_get_cluster_network_subnet_value_error. _service.disable_retries() - self.test_get_network_acl_rule_value_error() + self.test_get_cluster_network_subnet_value_error() -class TestUpdateNetworkAclRule: +class TestUpdateClusterNetworkSubnet: """ - Test Class for update_network_acl_rule + Test Class for update_cluster_network_subnet """ @responses.activate - def test_update_network_acl_rule_all_params(self): + def test_update_cluster_network_subnet_all_params(self): """ - update_network_acl_rule() + update_cluster_network_subnet() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules/testString') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' + url = preprocess_url('/cluster_networks/testString/subnets/testString') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' responses.add( responses.PATCH, url, @@ -34717,36 +35612,71 @@ def test_update_network_acl_rule_all_params(self): status=200, ) - # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model - network_acl_rule_before_patch_model = {} - network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + # Construct a dict representation of a ClusterNetworkSubnetPatch model + cluster_network_subnet_patch_model = {} + cluster_network_subnet_patch_model['name'] = 'my-cluster-network-subnet' - # Construct a dict representation of a NetworkACLRulePatch model - network_acl_rule_patch_model = {} - network_acl_rule_patch_model['action'] = 'allow' - network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model - network_acl_rule_patch_model['code'] = 0 - network_acl_rule_patch_model['destination'] = '192.168.3.2/32' - network_acl_rule_patch_model['destination_port_max'] = 22 - network_acl_rule_patch_model['destination_port_min'] = 22 - network_acl_rule_patch_model['direction'] = 'inbound' - network_acl_rule_patch_model['name'] = 'my-rule-1' - network_acl_rule_patch_model['protocol'] = 'tcp' - network_acl_rule_patch_model['source'] = '192.168.3.2/32' - network_acl_rule_patch_model['source_port_max'] = 65535 - network_acl_rule_patch_model['source_port_min'] = 49152 - network_acl_rule_patch_model['type'] = 8 + # Set up parameter values + cluster_network_id = 'testString' + id = 'testString' + cluster_network_subnet_patch = cluster_network_subnet_patch_model + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' + + # Invoke method + response = _service.update_cluster_network_subnet( + cluster_network_id, + id, + cluster_network_subnet_patch, + if_match=if_match, + 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 == cluster_network_subnet_patch + + def test_update_cluster_network_subnet_all_params_with_retries(self): + # Enable retries and run test_update_cluster_network_subnet_all_params. + _service.enable_retries() + self.test_update_cluster_network_subnet_all_params() + + # Disable retries and run test_update_cluster_network_subnet_all_params. + _service.disable_retries() + self.test_update_cluster_network_subnet_all_params() + + @responses.activate + def test_update_cluster_network_subnet_required_params(self): + """ + test_update_cluster_network_subnet_required_params() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString/subnets/testString') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ClusterNetworkSubnetPatch model + cluster_network_subnet_patch_model = {} + cluster_network_subnet_patch_model['name'] = 'my-cluster-network-subnet' # Set up parameter values - network_acl_id = 'testString' + cluster_network_id = 'testString' id = 'testString' - network_acl_rule_patch = network_acl_rule_patch_model + cluster_network_subnet_patch = cluster_network_subnet_patch_model # Invoke method - response = _service.update_network_acl_rule( - network_acl_id, + response = _service.update_cluster_network_subnet( + cluster_network_id, id, - network_acl_rule_patch, + cluster_network_subnet_patch, headers={}, ) @@ -34755,25 +35685,25 @@ def test_update_network_acl_rule_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == network_acl_rule_patch + assert req_body == cluster_network_subnet_patch - def test_update_network_acl_rule_all_params_with_retries(self): - # Enable retries and run test_update_network_acl_rule_all_params. + def test_update_cluster_network_subnet_required_params_with_retries(self): + # Enable retries and run test_update_cluster_network_subnet_required_params. _service.enable_retries() - self.test_update_network_acl_rule_all_params() + self.test_update_cluster_network_subnet_required_params() - # Disable retries and run test_update_network_acl_rule_all_params. + # Disable retries and run test_update_cluster_network_subnet_required_params. _service.disable_retries() - self.test_update_network_acl_rule_all_params() + self.test_update_cluster_network_subnet_required_params() @responses.activate - def test_update_network_acl_rule_value_error(self): + def test_update_cluster_network_subnet_value_error(self): """ - test_update_network_acl_rule_value_error() + test_update_cluster_network_subnet_value_error() """ # Set up mock - url = preprocess_url('/network_acls/testString/rules/testString') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' + url = preprocess_url('/cluster_networks/testString/subnets/testString') + mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "id": "0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network-subnet", "resource_type": "cluster_network_subnet", "total_ipv4_address_count": 256}' responses.add( responses.PATCH, url, @@ -34782,59 +35712,390 @@ def test_update_network_acl_rule_value_error(self): status=200, ) - # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model - network_acl_rule_before_patch_model = {} - network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + # Construct a dict representation of a ClusterNetworkSubnetPatch model + cluster_network_subnet_patch_model = {} + cluster_network_subnet_patch_model['name'] = 'my-cluster-network-subnet' - # Construct a dict representation of a NetworkACLRulePatch model - network_acl_rule_patch_model = {} - network_acl_rule_patch_model['action'] = 'allow' - network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model - network_acl_rule_patch_model['code'] = 0 - network_acl_rule_patch_model['destination'] = '192.168.3.2/32' - network_acl_rule_patch_model['destination_port_max'] = 22 - network_acl_rule_patch_model['destination_port_min'] = 22 - network_acl_rule_patch_model['direction'] = 'inbound' - network_acl_rule_patch_model['name'] = 'my-rule-1' - network_acl_rule_patch_model['protocol'] = 'tcp' - network_acl_rule_patch_model['source'] = '192.168.3.2/32' - network_acl_rule_patch_model['source_port_max'] = 65535 - network_acl_rule_patch_model['source_port_min'] = 49152 - network_acl_rule_patch_model['type'] = 8 + # Set up parameter values + cluster_network_id = 'testString' + id = 'testString' + cluster_network_subnet_patch = cluster_network_subnet_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "cluster_network_id": cluster_network_id, + "id": id, + "cluster_network_subnet_patch": cluster_network_subnet_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_cluster_network_subnet(**req_copy) + + def test_update_cluster_network_subnet_value_error_with_retries(self): + # Enable retries and run test_update_cluster_network_subnet_value_error. + _service.enable_retries() + self.test_update_cluster_network_subnet_value_error() + + # Disable retries and run test_update_cluster_network_subnet_value_error. + _service.disable_retries() + self.test_update_cluster_network_subnet_value_error() + + +class TestDeleteClusterNetwork: + """ + Test Class for delete_cluster_network + """ + + @responses.activate + def test_delete_cluster_network_all_params(self): + """ + delete_cluster_network() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + id = 'testString' + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' + + # Invoke method + response = _service.delete_cluster_network( + id, + if_match=if_match, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_cluster_network_all_params_with_retries(self): + # Enable retries and run test_delete_cluster_network_all_params. + _service.enable_retries() + self.test_delete_cluster_network_all_params() + + # Disable retries and run test_delete_cluster_network_all_params. + _service.disable_retries() + self.test_delete_cluster_network_all_params() + + @responses.activate + def test_delete_cluster_network_required_params(self): + """ + test_delete_cluster_network_required_params() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.delete_cluster_network( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_cluster_network_required_params_with_retries(self): + # Enable retries and run test_delete_cluster_network_required_params. + _service.enable_retries() + self.test_delete_cluster_network_required_params() + + # Disable retries and run test_delete_cluster_network_required_params. + _service.disable_retries() + self.test_delete_cluster_network_required_params() + + @responses.activate + def test_delete_cluster_network_value_error(self): + """ + test_delete_cluster_network_value_error() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) # Set up parameter values - network_acl_id = 'testString' id = 'testString' - network_acl_rule_patch = network_acl_rule_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "network_acl_id": network_acl_id, "id": id, - "network_acl_rule_patch": network_acl_rule_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_network_acl_rule(**req_copy) + _service.delete_cluster_network(**req_copy) - def test_update_network_acl_rule_value_error_with_retries(self): - # Enable retries and run test_update_network_acl_rule_value_error. + def test_delete_cluster_network_value_error_with_retries(self): + # Enable retries and run test_delete_cluster_network_value_error. _service.enable_retries() - self.test_update_network_acl_rule_value_error() + self.test_delete_cluster_network_value_error() - # Disable retries and run test_update_network_acl_rule_value_error. + # Disable retries and run test_delete_cluster_network_value_error. _service.disable_retries() - self.test_update_network_acl_rule_value_error() + self.test_delete_cluster_network_value_error() + + +class TestGetClusterNetwork: + """ + Test Class for get_cluster_network + """ + + @responses.activate + def test_get_cluster_network_all_params(self): + """ + get_cluster_network() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.get_cluster_network( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_cluster_network_all_params_with_retries(self): + # Enable retries and run test_get_cluster_network_all_params. + _service.enable_retries() + self.test_get_cluster_network_all_params() + + # Disable retries and run test_get_cluster_network_all_params. + _service.disable_retries() + self.test_get_cluster_network_all_params() + + @responses.activate + def test_get_cluster_network_value_error(self): + """ + test_get_cluster_network_value_error() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_cluster_network(**req_copy) + + def test_get_cluster_network_value_error_with_retries(self): + # Enable retries and run test_get_cluster_network_value_error. + _service.enable_retries() + self.test_get_cluster_network_value_error() + + # Disable retries and run test_get_cluster_network_value_error. + _service.disable_retries() + self.test_get_cluster_network_value_error() + + +class TestUpdateClusterNetwork: + """ + Test Class for update_cluster_network + """ + + @responses.activate + def test_update_cluster_network_all_params(self): + """ + update_cluster_network() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ClusterNetworkPatch model + cluster_network_patch_model = {} + cluster_network_patch_model['name'] = 'my-cluster-network' + + # Set up parameter values + id = 'testString' + cluster_network_patch = cluster_network_patch_model + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' + + # Invoke method + response = _service.update_cluster_network( + id, + cluster_network_patch, + if_match=if_match, + 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 == cluster_network_patch + + def test_update_cluster_network_all_params_with_retries(self): + # Enable retries and run test_update_cluster_network_all_params. + _service.enable_retries() + self.test_update_cluster_network_all_params() + + # Disable retries and run test_update_cluster_network_all_params. + _service.disable_retries() + self.test_update_cluster_network_all_params() + + @responses.activate + def test_update_cluster_network_required_params(self): + """ + test_update_cluster_network_required_params() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ClusterNetworkPatch model + cluster_network_patch_model = {} + cluster_network_patch_model['name'] = 'my-cluster-network' + + # Set up parameter values + id = 'testString' + cluster_network_patch = cluster_network_patch_model + + # Invoke method + response = _service.update_cluster_network( + id, + cluster_network_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == cluster_network_patch + + def test_update_cluster_network_required_params_with_retries(self): + # Enable retries and run test_update_cluster_network_required_params. + _service.enable_retries() + self.test_update_cluster_network_required_params() + + # Disable retries and run test_update_cluster_network_required_params. + _service.disable_retries() + self.test_update_cluster_network_required_params() + + @responses.activate + def test_update_cluster_network_value_error(self): + """ + test_update_cluster_network_value_error() + """ + # Set up mock + url = preprocess_url('/cluster_networks/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573", "href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573", "id": "0717-da0df18c-7598-4633-a648-fdaac28a5573", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-cluster-network", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100", "name": "h100", "resource_type": "cluster_network_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "cluster_network", "subnet_prefixes": [{"allocation_policy": "auto", "cidr": "10.0.0.0/24"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ClusterNetworkPatch model + cluster_network_patch_model = {} + cluster_network_patch_model['name'] = 'my-cluster-network' + + # Set up parameter values + id = 'testString' + cluster_network_patch = cluster_network_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + "cluster_network_patch": cluster_network_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_cluster_network(**req_copy) + + def test_update_cluster_network_value_error_with_retries(self): + # Enable retries and run test_update_cluster_network_value_error. + _service.enable_retries() + self.test_update_cluster_network_value_error() + + # Disable retries and run test_update_cluster_network_value_error. + _service.disable_retries() + self.test_update_cluster_network_value_error() # endregion ############################################################################## -# End of Service: NetworkACLs +# End of Service: ClusterNetworks ############################################################################## ############################################################################## -# Start of Service: SecurityGroups +# Start of Service: PublicGateways ############################################################################## # region @@ -34885,19 +36146,19 @@ def test_new_instance_required_param_none(self): ) -class TestListSecurityGroups: +class TestListPublicGateways: """ - Test Class for list_security_groups + Test Class for list_public_gateways """ @responses.activate - def test_list_security_groups_all_params(self): + def test_list_public_gateways_all_params(self): """ - list_security_groups() + list_public_gateways() """ # Set up mock - url = preprocess_url('/security_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' + url = preprocess_url('/public_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -34910,18 +36171,12 @@ def test_list_security_groups_all_params(self): start = 'testString' limit = 50 resource_group_id = 'testString' - vpc_id = 'testString' - vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' - vpc_name = 'my-vpc' # Invoke method - response = _service.list_security_groups( + response = _service.list_public_gateways( start=start, limit=limit, resource_group_id=resource_group_id, - vpc_id=vpc_id, - vpc_crn=vpc_crn, - vpc_name=vpc_name, headers={}, ) @@ -34934,27 +36189,24 @@ def test_list_security_groups_all_params(self): assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string - assert 'vpc.id={}'.format(vpc_id) in query_string - assert 'vpc.crn={}'.format(vpc_crn) in query_string - assert 'vpc.name={}'.format(vpc_name) in query_string - def test_list_security_groups_all_params_with_retries(self): - # Enable retries and run test_list_security_groups_all_params. + def test_list_public_gateways_all_params_with_retries(self): + # Enable retries and run test_list_public_gateways_all_params. _service.enable_retries() - self.test_list_security_groups_all_params() + self.test_list_public_gateways_all_params() - # Disable retries and run test_list_security_groups_all_params. + # Disable retries and run test_list_public_gateways_all_params. _service.disable_retries() - self.test_list_security_groups_all_params() + self.test_list_public_gateways_all_params() @responses.activate - def test_list_security_groups_required_params(self): + def test_list_public_gateways_required_params(self): """ - test_list_security_groups_required_params() + test_list_public_gateways_required_params() """ # Set up mock - url = preprocess_url('/security_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' + url = preprocess_url('/public_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -34964,29 +36216,29 @@ def test_list_security_groups_required_params(self): ) # Invoke method - response = _service.list_security_groups() + response = _service.list_public_gateways() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_security_groups_required_params_with_retries(self): - # Enable retries and run test_list_security_groups_required_params. + def test_list_public_gateways_required_params_with_retries(self): + # Enable retries and run test_list_public_gateways_required_params. _service.enable_retries() - self.test_list_security_groups_required_params() + self.test_list_public_gateways_required_params() - # Disable retries and run test_list_security_groups_required_params. + # Disable retries and run test_list_public_gateways_required_params. _service.disable_retries() - self.test_list_security_groups_required_params() + self.test_list_public_gateways_required_params() @responses.activate - def test_list_security_groups_value_error(self): + def test_list_public_gateways_value_error(self): """ - test_list_security_groups_value_error() + test_list_public_gateways_value_error() """ # Set up mock - url = preprocess_url('/security_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' + url = preprocess_url('/public_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -35001,26 +36253,26 @@ def test_list_security_groups_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_security_groups(**req_copy) + _service.list_public_gateways(**req_copy) - def test_list_security_groups_value_error_with_retries(self): - # Enable retries and run test_list_security_groups_value_error. + def test_list_public_gateways_value_error_with_retries(self): + # Enable retries and run test_list_public_gateways_value_error. _service.enable_retries() - self.test_list_security_groups_value_error() + self.test_list_public_gateways_value_error() - # Disable retries and run test_list_security_groups_value_error. + # Disable retries and run test_list_public_gateways_value_error. _service.disable_retries() - self.test_list_security_groups_value_error() + self.test_list_public_gateways_value_error() @responses.activate - def test_list_security_groups_with_pager_get_next(self): + def test_list_public_gateways_with_pager_get_next(self): """ - test_list_security_groups_with_pager_get_next() + test_list_public_gateways_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/security_groups') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + url = preprocess_url('/public_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -35038,13 +36290,10 @@ def test_list_security_groups_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = SecurityGroupsPager( + pager = PublicGatewaysPager( client=_service, limit=10, resource_group_id='testString', - vpc_id='testString', - vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', - vpc_name='my-vpc', ) while pager.has_next(): next_page = pager.get_next() @@ -35053,14 +36302,14 @@ def test_list_security_groups_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_security_groups_with_pager_get_all(self): + def test_list_public_gateways_with_pager_get_all(self): """ - test_list_security_groups_with_pager_get_all() + test_list_public_gateways_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/security_groups') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + url = preprocess_url('/public_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -35077,32 +36326,29 @@ def test_list_security_groups_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = SecurityGroupsPager( + pager = PublicGatewaysPager( client=_service, limit=10, resource_group_id='testString', - vpc_id='testString', - vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', - vpc_name='my-vpc', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateSecurityGroup: +class TestCreatePublicGateway: """ - Test Class for create_security_group + Test Class for create_public_gateway """ @responses.activate - def test_create_security_group_all_params(self): + def test_create_public_gateway_all_params(self): """ - create_security_group() + create_public_gateway() """ # Set up mock - url = preprocess_url('/security_groups') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/public_gateways') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -35115,38 +36361,32 @@ def test_create_security_group_all_params(self): vpc_identity_model = {} vpc_identity_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model + public_gateway_floating_ip_prototype_model = {} + public_gateway_floating_ip_prototype_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Construct a dict representation of a SecurityGroupRuleLocalPrototypeIP model - security_group_rule_local_prototype_model = {} - security_group_rule_local_prototype_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model - security_group_rule_remote_prototype_model = {} - security_group_rule_remote_prototype_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model - security_group_rule_prototype_model = {} - security_group_rule_prototype_model['direction'] = 'inbound' - security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['local'] = security_group_rule_local_prototype_model - security_group_rule_prototype_model['protocol'] = 'all' - security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - # Set up parameter values vpc = vpc_identity_model - name = 'my-security-group' + zone = zone_identity_model + floating_ip = public_gateway_floating_ip_prototype_model + name = 'my-public-gateway' resource_group = resource_group_identity_model - rules = [security_group_rule_prototype_model] # Invoke method - response = _service.create_security_group( + response = _service.create_public_gateway( vpc, + zone, + floating_ip=floating_ip, name=name, resource_group=resource_group, - rules=rules, headers={}, ) @@ -35156,27 +36396,28 @@ def test_create_security_group_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['vpc'] == vpc_identity_model - assert req_body['name'] == 'my-security-group' + assert req_body['zone'] == zone_identity_model + assert req_body['floating_ip'] == public_gateway_floating_ip_prototype_model + assert req_body['name'] == 'my-public-gateway' assert req_body['resource_group'] == resource_group_identity_model - assert req_body['rules'] == [security_group_rule_prototype_model] - def test_create_security_group_all_params_with_retries(self): - # Enable retries and run test_create_security_group_all_params. + def test_create_public_gateway_all_params_with_retries(self): + # Enable retries and run test_create_public_gateway_all_params. _service.enable_retries() - self.test_create_security_group_all_params() + self.test_create_public_gateway_all_params() - # Disable retries and run test_create_security_group_all_params. + # Disable retries and run test_create_public_gateway_all_params. _service.disable_retries() - self.test_create_security_group_all_params() + self.test_create_public_gateway_all_params() @responses.activate - def test_create_security_group_value_error(self): + def test_create_public_gateway_value_error(self): """ - test_create_security_group_value_error() + test_create_public_gateway_value_error() """ # Set up mock - url = preprocess_url('/security_groups') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/public_gateways') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -35189,63 +36430,57 @@ def test_create_security_group_value_error(self): vpc_identity_model = {} vpc_identity_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model + public_gateway_floating_ip_prototype_model = {} + public_gateway_floating_ip_prototype_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Construct a dict representation of a SecurityGroupRuleLocalPrototypeIP model - security_group_rule_local_prototype_model = {} - security_group_rule_local_prototype_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model - security_group_rule_remote_prototype_model = {} - security_group_rule_remote_prototype_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model - security_group_rule_prototype_model = {} - security_group_rule_prototype_model['direction'] = 'inbound' - security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['local'] = security_group_rule_local_prototype_model - security_group_rule_prototype_model['protocol'] = 'all' - security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - # Set up parameter values vpc = vpc_identity_model - name = 'my-security-group' + zone = zone_identity_model + floating_ip = public_gateway_floating_ip_prototype_model + name = 'my-public-gateway' resource_group = resource_group_identity_model - rules = [security_group_rule_prototype_model] # Pass in all but one required param and check for a ValueError req_param_dict = { "vpc": vpc, + "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_security_group(**req_copy) + _service.create_public_gateway(**req_copy) - def test_create_security_group_value_error_with_retries(self): - # Enable retries and run test_create_security_group_value_error. + def test_create_public_gateway_value_error_with_retries(self): + # Enable retries and run test_create_public_gateway_value_error. _service.enable_retries() - self.test_create_security_group_value_error() + self.test_create_public_gateway_value_error() - # Disable retries and run test_create_security_group_value_error. + # Disable retries and run test_create_public_gateway_value_error. _service.disable_retries() - self.test_create_security_group_value_error() + self.test_create_public_gateway_value_error() -class TestDeleteSecurityGroup: +class TestDeletePublicGateway: """ - Test Class for delete_security_group + Test Class for delete_public_gateway """ @responses.activate - def test_delete_security_group_all_params(self): + def test_delete_public_gateway_all_params(self): """ - delete_security_group() + delete_public_gateway() """ # Set up mock - url = preprocess_url('/security_groups/testString') + url = preprocess_url('/public_gateways/testString') responses.add( responses.DELETE, url, @@ -35256,7 +36491,7 @@ def test_delete_security_group_all_params(self): id = 'testString' # Invoke method - response = _service.delete_security_group( + response = _service.delete_public_gateway( id, headers={}, ) @@ -35265,22 +36500,22 @@ def test_delete_security_group_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 204 - def test_delete_security_group_all_params_with_retries(self): - # Enable retries and run test_delete_security_group_all_params. + def test_delete_public_gateway_all_params_with_retries(self): + # Enable retries and run test_delete_public_gateway_all_params. _service.enable_retries() - self.test_delete_security_group_all_params() + self.test_delete_public_gateway_all_params() - # Disable retries and run test_delete_security_group_all_params. + # Disable retries and run test_delete_public_gateway_all_params. _service.disable_retries() - self.test_delete_security_group_all_params() + self.test_delete_public_gateway_all_params() @responses.activate - def test_delete_security_group_value_error(self): + def test_delete_public_gateway_value_error(self): """ - test_delete_security_group_value_error() + test_delete_public_gateway_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString') + url = preprocess_url('/public_gateways/testString') responses.add( responses.DELETE, url, @@ -35297,31 +36532,31 @@ def test_delete_security_group_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.delete_security_group(**req_copy) + _service.delete_public_gateway(**req_copy) - def test_delete_security_group_value_error_with_retries(self): - # Enable retries and run test_delete_security_group_value_error. + def test_delete_public_gateway_value_error_with_retries(self): + # Enable retries and run test_delete_public_gateway_value_error. _service.enable_retries() - self.test_delete_security_group_value_error() + self.test_delete_public_gateway_value_error() - # Disable retries and run test_delete_security_group_value_error. + # Disable retries and run test_delete_public_gateway_value_error. _service.disable_retries() - self.test_delete_security_group_value_error() + self.test_delete_public_gateway_value_error() -class TestGetSecurityGroup: +class TestGetPublicGateway: """ - Test Class for get_security_group + Test Class for get_public_gateway """ @responses.activate - def test_get_security_group_all_params(self): + def test_get_public_gateway_all_params(self): """ - get_security_group() + get_public_gateway() """ # Set up mock - url = preprocess_url('/security_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/public_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -35334,7 +36569,7 @@ def test_get_security_group_all_params(self): id = 'testString' # Invoke method - response = _service.get_security_group( + response = _service.get_public_gateway( id, headers={}, ) @@ -35343,23 +36578,23 @@ def test_get_security_group_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_security_group_all_params_with_retries(self): - # Enable retries and run test_get_security_group_all_params. + def test_get_public_gateway_all_params_with_retries(self): + # Enable retries and run test_get_public_gateway_all_params. _service.enable_retries() - self.test_get_security_group_all_params() + self.test_get_public_gateway_all_params() - # Disable retries and run test_get_security_group_all_params. + # Disable retries and run test_get_public_gateway_all_params. _service.disable_retries() - self.test_get_security_group_all_params() + self.test_get_public_gateway_all_params() @responses.activate - def test_get_security_group_value_error(self): + def test_get_public_gateway_value_error(self): """ - test_get_security_group_value_error() + test_get_public_gateway_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/public_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -35378,31 +36613,31 @@ def test_get_security_group_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_security_group(**req_copy) + _service.get_public_gateway(**req_copy) - def test_get_security_group_value_error_with_retries(self): - # Enable retries and run test_get_security_group_value_error. + def test_get_public_gateway_value_error_with_retries(self): + # Enable retries and run test_get_public_gateway_value_error. _service.enable_retries() - self.test_get_security_group_value_error() + self.test_get_public_gateway_value_error() - # Disable retries and run test_get_security_group_value_error. + # Disable retries and run test_get_public_gateway_value_error. _service.disable_retries() - self.test_get_security_group_value_error() + self.test_get_public_gateway_value_error() -class TestUpdateSecurityGroup: +class TestUpdatePublicGateway: """ - Test Class for update_security_group + Test Class for update_public_gateway """ @responses.activate - def test_update_security_group_all_params(self): + def test_update_public_gateway_all_params(self): """ - update_security_group() + update_public_gateway() """ # Set up mock - url = preprocess_url('/security_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/public_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -35411,18 +36646,18 @@ def test_update_security_group_all_params(self): status=200, ) - # Construct a dict representation of a SecurityGroupPatch model - security_group_patch_model = {} - security_group_patch_model['name'] = 'my-security-group' + # Construct a dict representation of a PublicGatewayPatch model + public_gateway_patch_model = {} + public_gateway_patch_model['name'] = 'my-public-gateway' # Set up parameter values id = 'testString' - security_group_patch = security_group_patch_model + public_gateway_patch = public_gateway_patch_model # Invoke method - response = _service.update_security_group( + response = _service.update_public_gateway( id, - security_group_patch, + public_gateway_patch, headers={}, ) @@ -35431,25 +36666,25 @@ def test_update_security_group_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == security_group_patch + assert req_body == public_gateway_patch - def test_update_security_group_all_params_with_retries(self): - # Enable retries and run test_update_security_group_all_params. + def test_update_public_gateway_all_params_with_retries(self): + # Enable retries and run test_update_public_gateway_all_params. _service.enable_retries() - self.test_update_security_group_all_params() + self.test_update_public_gateway_all_params() - # Disable retries and run test_update_security_group_all_params. + # Disable retries and run test_update_public_gateway_all_params. _service.disable_retries() - self.test_update_security_group_all_params() + self.test_update_public_gateway_all_params() @responses.activate - def test_update_security_group_value_error(self): + def test_update_public_gateway_value_error(self): """ - test_update_security_group_value_error() + test_update_public_gateway_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/public_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -35458,47 +36693,104 @@ def test_update_security_group_value_error(self): status=200, ) - # Construct a dict representation of a SecurityGroupPatch model - security_group_patch_model = {} - security_group_patch_model['name'] = 'my-security-group' + # Construct a dict representation of a PublicGatewayPatch model + public_gateway_patch_model = {} + public_gateway_patch_model['name'] = 'my-public-gateway' # Set up parameter values id = 'testString' - security_group_patch = security_group_patch_model + public_gateway_patch = public_gateway_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { "id": id, - "security_group_patch": security_group_patch, + "public_gateway_patch": public_gateway_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_security_group(**req_copy) + _service.update_public_gateway(**req_copy) - def test_update_security_group_value_error_with_retries(self): - # Enable retries and run test_update_security_group_value_error. + def test_update_public_gateway_value_error_with_retries(self): + # Enable retries and run test_update_public_gateway_value_error. _service.enable_retries() - self.test_update_security_group_value_error() + self.test_update_public_gateway_value_error() - # Disable retries and run test_update_security_group_value_error. + # Disable retries and run test_update_public_gateway_value_error. _service.disable_retries() - self.test_update_security_group_value_error() + self.test_update_public_gateway_value_error() -class TestListSecurityGroupRules: +# endregion +############################################################################## +# End of Service: PublicGateways +############################################################################## + +############################################################################## +# Start of Service: FloatingIPs +############################################################################## +# region + + +class TestNewInstance: """ - Test Class for list_security_group_rules + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, VpcV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) + + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) + + +class TestListFloatingIps: + """ + Test Class for list_floating_ips """ @responses.activate - def test_list_security_group_rules_all_params(self): + def test_list_floating_ips_all_params(self): """ - list_security_group_rules() + list_floating_ips() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules') - mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}' + url = preprocess_url('/floating_ips') + mock_response = '{"first": {"href": "href"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -35508,35 +36800,60 @@ def test_list_security_group_rules_all_params(self): ) # Set up parameter values - security_group_id = 'testString' + start = 'testString' + limit = 50 + resource_group_id = 'testString' + sort = 'name' + target_id = 'testString' + target_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + target_name = 'my-resource' + target_resource_type = 'testString' # Invoke method - response = _service.list_security_group_rules( - security_group_id, + response = _service.list_floating_ips( + start=start, + limit=limit, + resource_group_id=resource_group_id, + sort=sort, + target_id=target_id, + target_crn=target_crn, + target_name=target_name, + target_resource_type=target_resource_type, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'sort={}'.format(sort) in query_string + assert 'target.id={}'.format(target_id) in query_string + assert 'target.crn={}'.format(target_crn) in query_string + assert 'target.name={}'.format(target_name) in query_string + assert 'target.resource_type={}'.format(target_resource_type) in query_string - def test_list_security_group_rules_all_params_with_retries(self): - # Enable retries and run test_list_security_group_rules_all_params. + def test_list_floating_ips_all_params_with_retries(self): + # Enable retries and run test_list_floating_ips_all_params. _service.enable_retries() - self.test_list_security_group_rules_all_params() + self.test_list_floating_ips_all_params() - # Disable retries and run test_list_security_group_rules_all_params. + # Disable retries and run test_list_floating_ips_all_params. _service.disable_retries() - self.test_list_security_group_rules_all_params() + self.test_list_floating_ips_all_params() @responses.activate - def test_list_security_group_rules_value_error(self): + def test_list_floating_ips_required_params(self): """ - test_list_security_group_rules_value_error() + test_list_floating_ips_required_params() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules') - mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}' + url = preprocess_url('/floating_ips') + mock_response = '{"first": {"href": "href"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -35545,41 +36862,150 @@ def test_list_security_group_rules_value_error(self): status=200, ) - # Set up parameter values - security_group_id = 'testString' + # Invoke method + response = _service.list_floating_ips() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_floating_ips_required_params_with_retries(self): + # Enable retries and run test_list_floating_ips_required_params. + _service.enable_retries() + self.test_list_floating_ips_required_params() + + # Disable retries and run test_list_floating_ips_required_params. + _service.disable_retries() + self.test_list_floating_ips_required_params() + + @responses.activate + def test_list_floating_ips_value_error(self): + """ + test_list_floating_ips_value_error() + """ + # Set up mock + url = preprocess_url('/floating_ips') + mock_response = '{"first": {"href": "href"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_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.list_security_group_rules(**req_copy) + _service.list_floating_ips(**req_copy) - def test_list_security_group_rules_value_error_with_retries(self): - # Enable retries and run test_list_security_group_rules_value_error. + def test_list_floating_ips_value_error_with_retries(self): + # Enable retries and run test_list_floating_ips_value_error. _service.enable_retries() - self.test_list_security_group_rules_value_error() + self.test_list_floating_ips_value_error() - # Disable retries and run test_list_security_group_rules_value_error. + # Disable retries and run test_list_floating_ips_value_error. _service.disable_retries() - self.test_list_security_group_rules_value_error() + self.test_list_floating_ips_value_error() + + @responses.activate + def test_list_floating_ips_with_pager_get_next(self): + """ + test_list_floating_ips_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/floating_ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + all_results = [] + pager = FloatingIpsPager( + client=_service, + limit=10, + resource_group_id='testString', + sort='name', + target_id='testString', + target_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727', + target_name='my-resource', + target_resource_type='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + @responses.activate + def test_list_floating_ips_with_pager_get_all(self): + """ + test_list_floating_ips_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/floating_ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","id":"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) -class TestCreateSecurityGroupRule: + # Exercise the pager class for this operation + pager = FloatingIpsPager( + client=_service, + limit=10, + resource_group_id='testString', + sort='name', + target_id='testString', + target_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727', + target_name='my-resource', + target_resource_type='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateFloatingIp: """ - Test Class for create_security_group_rule + Test Class for create_floating_ip """ @responses.activate - def test_create_security_group_rule_all_params(self): + def test_create_floating_ip_all_params(self): """ - create_security_group_rule() + create_floating_ip() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules') - mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + url = preprocess_url('/floating_ips') + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -35588,30 +37014,26 @@ def test_create_security_group_rule_all_params(self): status=201, ) - # Construct a dict representation of a SecurityGroupRuleLocalPrototypeIP model - security_group_rule_local_prototype_model = {} - security_group_rule_local_prototype_model['address'] = '192.168.3.4' + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model - security_group_rule_remote_prototype_model = {} - security_group_rule_remote_prototype_model['address'] = '192.168.3.4' + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' - # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model - security_group_rule_prototype_model = {} - security_group_rule_prototype_model['direction'] = 'inbound' - security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['local'] = security_group_rule_local_prototype_model - security_group_rule_prototype_model['protocol'] = 'all' - security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model + # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model + floating_ip_prototype_model = {} + floating_ip_prototype_model['name'] = 'my-floating-ip' + floating_ip_prototype_model['resource_group'] = resource_group_identity_model + floating_ip_prototype_model['zone'] = zone_identity_model # Set up parameter values - security_group_id = 'testString' - security_group_rule_prototype = security_group_rule_prototype_model + floating_ip_prototype = floating_ip_prototype_model # Invoke method - response = _service.create_security_group_rule( - security_group_id, - security_group_rule_prototype, + response = _service.create_floating_ip( + floating_ip_prototype, headers={}, ) @@ -35620,25 +37042,25 @@ def test_create_security_group_rule_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == security_group_rule_prototype + assert req_body == floating_ip_prototype - def test_create_security_group_rule_all_params_with_retries(self): - # Enable retries and run test_create_security_group_rule_all_params. + def test_create_floating_ip_all_params_with_retries(self): + # Enable retries and run test_create_floating_ip_all_params. _service.enable_retries() - self.test_create_security_group_rule_all_params() + self.test_create_floating_ip_all_params() - # Disable retries and run test_create_security_group_rule_all_params. + # Disable retries and run test_create_floating_ip_all_params. _service.disable_retries() - self.test_create_security_group_rule_all_params() + self.test_create_floating_ip_all_params() @responses.activate - def test_create_security_group_rule_value_error(self): + def test_create_floating_ip_value_error(self): """ - test_create_security_group_rule_value_error() + test_create_floating_ip_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules') - mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + url = preprocess_url('/floating_ips') + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -35647,58 +37069,54 @@ def test_create_security_group_rule_value_error(self): status=201, ) - # Construct a dict representation of a SecurityGroupRuleLocalPrototypeIP model - security_group_rule_local_prototype_model = {} - security_group_rule_local_prototype_model['address'] = '192.168.3.4' + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model - security_group_rule_remote_prototype_model = {} - security_group_rule_remote_prototype_model['address'] = '192.168.3.4' + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' - # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model - security_group_rule_prototype_model = {} - security_group_rule_prototype_model['direction'] = 'inbound' - security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['local'] = security_group_rule_local_prototype_model - security_group_rule_prototype_model['protocol'] = 'all' - security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model + # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model + floating_ip_prototype_model = {} + floating_ip_prototype_model['name'] = 'my-floating-ip' + floating_ip_prototype_model['resource_group'] = resource_group_identity_model + floating_ip_prototype_model['zone'] = zone_identity_model # Set up parameter values - security_group_id = 'testString' - security_group_rule_prototype = security_group_rule_prototype_model + floating_ip_prototype = floating_ip_prototype_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_id, - "security_group_rule_prototype": security_group_rule_prototype, + "floating_ip_prototype": floating_ip_prototype, } 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_security_group_rule(**req_copy) + _service.create_floating_ip(**req_copy) - def test_create_security_group_rule_value_error_with_retries(self): - # Enable retries and run test_create_security_group_rule_value_error. + def test_create_floating_ip_value_error_with_retries(self): + # Enable retries and run test_create_floating_ip_value_error. _service.enable_retries() - self.test_create_security_group_rule_value_error() + self.test_create_floating_ip_value_error() - # Disable retries and run test_create_security_group_rule_value_error. + # Disable retries and run test_create_floating_ip_value_error. _service.disable_retries() - self.test_create_security_group_rule_value_error() + self.test_create_floating_ip_value_error() -class TestDeleteSecurityGroupRule: +class TestDeleteFloatingIp: """ - Test Class for delete_security_group_rule + Test Class for delete_floating_ip """ @responses.activate - def test_delete_security_group_rule_all_params(self): + def test_delete_floating_ip_all_params(self): """ - delete_security_group_rule() + delete_floating_ip() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules/testString') + url = preprocess_url('/floating_ips/testString') responses.add( responses.DELETE, url, @@ -35706,12 +37124,10 @@ def test_delete_security_group_rule_all_params(self): ) # Set up parameter values - security_group_id = 'testString' id = 'testString' # Invoke method - response = _service.delete_security_group_rule( - security_group_id, + response = _service.delete_floating_ip( id, headers={}, ) @@ -35720,22 +37136,22 @@ def test_delete_security_group_rule_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 204 - def test_delete_security_group_rule_all_params_with_retries(self): - # Enable retries and run test_delete_security_group_rule_all_params. + def test_delete_floating_ip_all_params_with_retries(self): + # Enable retries and run test_delete_floating_ip_all_params. _service.enable_retries() - self.test_delete_security_group_rule_all_params() + self.test_delete_floating_ip_all_params() - # Disable retries and run test_delete_security_group_rule_all_params. + # Disable retries and run test_delete_floating_ip_all_params. _service.disable_retries() - self.test_delete_security_group_rule_all_params() + self.test_delete_floating_ip_all_params() @responses.activate - def test_delete_security_group_rule_value_error(self): + def test_delete_floating_ip_value_error(self): """ - test_delete_security_group_rule_value_error() + test_delete_floating_ip_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules/testString') + url = preprocess_url('/floating_ips/testString') responses.add( responses.DELETE, url, @@ -35743,42 +37159,40 @@ def test_delete_security_group_rule_value_error(self): ) # Set up parameter values - security_group_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_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.delete_security_group_rule(**req_copy) + _service.delete_floating_ip(**req_copy) - def test_delete_security_group_rule_value_error_with_retries(self): - # Enable retries and run test_delete_security_group_rule_value_error. + def test_delete_floating_ip_value_error_with_retries(self): + # Enable retries and run test_delete_floating_ip_value_error. _service.enable_retries() - self.test_delete_security_group_rule_value_error() + self.test_delete_floating_ip_value_error() - # Disable retries and run test_delete_security_group_rule_value_error. + # Disable retries and run test_delete_floating_ip_value_error. _service.disable_retries() - self.test_delete_security_group_rule_value_error() + self.test_delete_floating_ip_value_error() -class TestGetSecurityGroupRule: +class TestGetFloatingIp: """ - Test Class for get_security_group_rule + Test Class for get_floating_ip """ @responses.activate - def test_get_security_group_rule_all_params(self): + def test_get_floating_ip_all_params(self): """ - get_security_group_rule() + get_floating_ip() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules/testString') - mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + url = preprocess_url('/floating_ips/testString') + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -35788,12 +37202,10 @@ def test_get_security_group_rule_all_params(self): ) # Set up parameter values - security_group_id = 'testString' id = 'testString' # Invoke method - response = _service.get_security_group_rule( - security_group_id, + response = _service.get_floating_ip( id, headers={}, ) @@ -35802,23 +37214,23 @@ def test_get_security_group_rule_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_security_group_rule_all_params_with_retries(self): - # Enable retries and run test_get_security_group_rule_all_params. + def test_get_floating_ip_all_params_with_retries(self): + # Enable retries and run test_get_floating_ip_all_params. _service.enable_retries() - self.test_get_security_group_rule_all_params() + self.test_get_floating_ip_all_params() - # Disable retries and run test_get_security_group_rule_all_params. + # Disable retries and run test_get_floating_ip_all_params. _service.disable_retries() - self.test_get_security_group_rule_all_params() + self.test_get_floating_ip_all_params() @responses.activate - def test_get_security_group_rule_value_error(self): + def test_get_floating_ip_value_error(self): """ - test_get_security_group_rule_value_error() + test_get_floating_ip_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules/testString') - mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + url = preprocess_url('/floating_ips/testString') + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -35828,42 +37240,40 @@ def test_get_security_group_rule_value_error(self): ) # Set up parameter values - security_group_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_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_security_group_rule(**req_copy) + _service.get_floating_ip(**req_copy) - def test_get_security_group_rule_value_error_with_retries(self): - # Enable retries and run test_get_security_group_rule_value_error. + def test_get_floating_ip_value_error_with_retries(self): + # Enable retries and run test_get_floating_ip_value_error. _service.enable_retries() - self.test_get_security_group_rule_value_error() + self.test_get_floating_ip_value_error() - # Disable retries and run test_get_security_group_rule_value_error. + # Disable retries and run test_get_floating_ip_value_error. _service.disable_retries() - self.test_get_security_group_rule_value_error() + self.test_get_floating_ip_value_error() -class TestUpdateSecurityGroupRule: +class TestUpdateFloatingIp: """ - Test Class for update_security_group_rule + Test Class for update_floating_ip """ @responses.activate - def test_update_security_group_rule_all_params(self): + def test_update_floating_ip_all_params(self): """ - update_security_group_rule() + update_floating_ip() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules/testString') - mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + url = preprocess_url('/floating_ips/testString') + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -35872,35 +37282,23 @@ def test_update_security_group_rule_all_params(self): status=200, ) - # Construct a dict representation of a SecurityGroupRuleLocalPatchIP model - security_group_rule_local_patch_model = {} - security_group_rule_local_patch_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SecurityGroupRuleRemotePatchIP model - security_group_rule_remote_patch_model = {} - security_group_rule_remote_patch_model['address'] = '192.168.3.4' + # Construct a dict representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model + floating_ip_target_patch_model = {} + floating_ip_target_patch_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - # Construct a dict representation of a SecurityGroupRulePatch model - security_group_rule_patch_model = {} - security_group_rule_patch_model['code'] = 0 - security_group_rule_patch_model['direction'] = 'inbound' - security_group_rule_patch_model['ip_version'] = 'ipv4' - security_group_rule_patch_model['local'] = security_group_rule_local_patch_model - security_group_rule_patch_model['port_max'] = 22 - security_group_rule_patch_model['port_min'] = 22 - security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model - security_group_rule_patch_model['type'] = 8 + # Construct a dict representation of a FloatingIPPatch model + floating_ip_patch_model = {} + floating_ip_patch_model['name'] = 'my-floating-ip' + floating_ip_patch_model['target'] = floating_ip_target_patch_model # Set up parameter values - security_group_id = 'testString' id = 'testString' - security_group_rule_patch = security_group_rule_patch_model + floating_ip_patch = floating_ip_patch_model # Invoke method - response = _service.update_security_group_rule( - security_group_id, + response = _service.update_floating_ip( id, - security_group_rule_patch, + floating_ip_patch, headers={}, ) @@ -35909,25 +37307,25 @@ def test_update_security_group_rule_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == security_group_rule_patch + assert req_body == floating_ip_patch - def test_update_security_group_rule_all_params_with_retries(self): - # Enable retries and run test_update_security_group_rule_all_params. + def test_update_floating_ip_all_params_with_retries(self): + # Enable retries and run test_update_floating_ip_all_params. _service.enable_retries() - self.test_update_security_group_rule_all_params() + self.test_update_floating_ip_all_params() - # Disable retries and run test_update_security_group_rule_all_params. + # Disable retries and run test_update_floating_ip_all_params. _service.disable_retries() - self.test_update_security_group_rule_all_params() + self.test_update_floating_ip_all_params() @responses.activate - def test_update_security_group_rule_value_error(self): + def test_update_floating_ip_value_error(self): """ - test_update_security_group_rule_value_error() + test_update_floating_ip_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString/rules/testString') - mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + url = preprocess_url('/floating_ips/testString') + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "id": "r006-f45e0d90-12a8-4460-8210-290ff2ab75cd", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -35936,64 +37334,109 @@ def test_update_security_group_rule_value_error(self): status=200, ) - # Construct a dict representation of a SecurityGroupRuleLocalPatchIP model - security_group_rule_local_patch_model = {} - security_group_rule_local_patch_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SecurityGroupRuleRemotePatchIP model - security_group_rule_remote_patch_model = {} - security_group_rule_remote_patch_model['address'] = '192.168.3.4' + # Construct a dict representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model + floating_ip_target_patch_model = {} + floating_ip_target_patch_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - # Construct a dict representation of a SecurityGroupRulePatch model - security_group_rule_patch_model = {} - security_group_rule_patch_model['code'] = 0 - security_group_rule_patch_model['direction'] = 'inbound' - security_group_rule_patch_model['ip_version'] = 'ipv4' - security_group_rule_patch_model['local'] = security_group_rule_local_patch_model - security_group_rule_patch_model['port_max'] = 22 - security_group_rule_patch_model['port_min'] = 22 - security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model - security_group_rule_patch_model['type'] = 8 + # Construct a dict representation of a FloatingIPPatch model + floating_ip_patch_model = {} + floating_ip_patch_model['name'] = 'my-floating-ip' + floating_ip_patch_model['target'] = floating_ip_target_patch_model # Set up parameter values - security_group_id = 'testString' id = 'testString' - security_group_rule_patch = security_group_rule_patch_model + floating_ip_patch = floating_ip_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_id, "id": id, - "security_group_rule_patch": security_group_rule_patch, + "floating_ip_patch": floating_ip_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_security_group_rule(**req_copy) + _service.update_floating_ip(**req_copy) - def test_update_security_group_rule_value_error_with_retries(self): - # Enable retries and run test_update_security_group_rule_value_error. + def test_update_floating_ip_value_error_with_retries(self): + # Enable retries and run test_update_floating_ip_value_error. _service.enable_retries() - self.test_update_security_group_rule_value_error() + self.test_update_floating_ip_value_error() - # Disable retries and run test_update_security_group_rule_value_error. + # Disable retries and run test_update_floating_ip_value_error. _service.disable_retries() - self.test_update_security_group_rule_value_error() + self.test_update_floating_ip_value_error() -class TestListSecurityGroupTargets: +# endregion +############################################################################## +# End of Service: FloatingIPs +############################################################################## + +############################################################################## +# Start of Service: NetworkACLs +############################################################################## +# region + + +class TestNewInstance: """ - Test Class for list_security_group_targets + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, VpcV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) + + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) + + +class TestListNetworkAcls: + """ + Test Class for list_network_acls """ @responses.activate - def test_list_security_group_targets_all_params(self): + def test_list_network_acls_all_params(self): """ - list_security_group_targets() + list_network_acls() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' + url = preprocess_url('/network_acls') + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -36003,15 +37446,15 @@ def test_list_security_group_targets_all_params(self): ) # Set up parameter values - security_group_id = 'testString' start = 'testString' limit = 50 + resource_group_id = 'testString' # Invoke method - response = _service.list_security_group_targets( - security_group_id, + response = _service.list_network_acls( start=start, limit=limit, + resource_group_id=resource_group_id, headers={}, ) @@ -36023,24 +37466,25 @@ def test_list_security_group_targets_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string - def test_list_security_group_targets_all_params_with_retries(self): - # Enable retries and run test_list_security_group_targets_all_params. + def test_list_network_acls_all_params_with_retries(self): + # Enable retries and run test_list_network_acls_all_params. _service.enable_retries() - self.test_list_security_group_targets_all_params() + self.test_list_network_acls_all_params() - # Disable retries and run test_list_security_group_targets_all_params. + # Disable retries and run test_list_network_acls_all_params. _service.disable_retries() - self.test_list_security_group_targets_all_params() + self.test_list_network_acls_all_params() @responses.activate - def test_list_security_group_targets_required_params(self): + def test_list_network_acls_required_params(self): """ - test_list_security_group_targets_required_params() + test_list_network_acls_required_params() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' + url = preprocess_url('/network_acls') + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -36049,36 +37493,30 @@ def test_list_security_group_targets_required_params(self): status=200, ) - # Set up parameter values - security_group_id = 'testString' - # Invoke method - response = _service.list_security_group_targets( - security_group_id, - headers={}, - ) + response = _service.list_network_acls() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_security_group_targets_required_params_with_retries(self): - # Enable retries and run test_list_security_group_targets_required_params. + def test_list_network_acls_required_params_with_retries(self): + # Enable retries and run test_list_network_acls_required_params. _service.enable_retries() - self.test_list_security_group_targets_required_params() + self.test_list_network_acls_required_params() - # Disable retries and run test_list_security_group_targets_required_params. + # Disable retries and run test_list_network_acls_required_params. _service.disable_retries() - self.test_list_security_group_targets_required_params() + self.test_list_network_acls_required_params() @responses.activate - def test_list_security_group_targets_value_error(self): + def test_list_network_acls_value_error(self): """ - test_list_security_group_targets_value_error() + test_list_network_acls_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' + url = preprocess_url('/network_acls') + mock_response = '{"first": {"href": "href"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -36087,36 +37525,32 @@ def test_list_security_group_targets_value_error(self): status=200, ) - # Set up parameter values - security_group_id = 'testString' - # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_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.list_security_group_targets(**req_copy) + _service.list_network_acls(**req_copy) - def test_list_security_group_targets_value_error_with_retries(self): - # Enable retries and run test_list_security_group_targets_value_error. + def test_list_network_acls_value_error_with_retries(self): + # Enable retries and run test_list_network_acls_value_error. _service.enable_retries() - self.test_list_security_group_targets_value_error() + self.test_list_network_acls_value_error() - # Disable retries and run test_list_security_group_targets_value_error. + # Disable retries and run test_list_network_acls_value_error. _service.disable_retries() - self.test_list_security_group_targets_value_error() + self.test_list_network_acls_value_error() @responses.activate - def test_list_security_group_targets_with_pager_get_next(self): + def test_list_network_acls_with_pager_get_next(self): """ - test_list_security_group_targets_with_pager_get_next() + test_list_network_acls_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/security_groups/testString/targets') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}' - mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}' + url = preprocess_url('/network_acls') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -36134,10 +37568,10 @@ def test_list_security_group_targets_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = SecurityGroupTargetsPager( + pager = NetworkAclsPager( client=_service, - security_group_id='testString', limit=10, + resource_group_id='testString', ) while pager.has_next(): next_page = pager.get_next() @@ -36146,14 +37580,14 @@ def test_list_security_group_targets_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_security_group_targets_with_pager_get_all(self): + def test_list_network_acls_with_pager_get_all(self): """ - test_list_security_group_targets_with_pager_get_all() + test_list_network_acls_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/security_groups/testString/targets') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}' - mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}' + url = preprocess_url('/network_acls') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -36170,195 +37604,248 @@ def test_list_security_group_targets_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = SecurityGroupTargetsPager( + pager = NetworkAclsPager( client=_service, - security_group_id='testString', limit=10, + resource_group_id='testString', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestDeleteSecurityGroupTargetBinding: +class TestCreateNetworkAcl: """ - Test Class for delete_security_group_target_binding + Test Class for create_network_acl """ @responses.activate - def test_delete_security_group_target_binding_all_params(self): + def test_create_network_acl_all_params(self): """ - delete_security_group_target_binding() + create_network_acl() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets/testString') + url = preprocess_url('/network_acls') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.DELETE, + responses.POST, url, - status=204, + body=mock_response, + content_type='application/json', + status=201, ) + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f' + + # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model + network_acl_rule_prototype_network_acl_context_model = {} + network_acl_rule_prototype_network_acl_context_model['action'] = 'allow' + network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_model['ip_version'] = 'ipv4' + network_acl_rule_prototype_network_acl_context_model['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_model['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_model['destination_port_max'] = 22 + network_acl_rule_prototype_network_acl_context_model['destination_port_min'] = 22 + network_acl_rule_prototype_network_acl_context_model['protocol'] = 'udp' + network_acl_rule_prototype_network_acl_context_model['source_port_max'] = 65535 + network_acl_rule_prototype_network_acl_context_model['source_port_min'] = 49152 + + # Construct a dict representation of a NetworkACLPrototypeNetworkACLByRules model + network_acl_prototype_model = {} + network_acl_prototype_model['name'] = 'my-network-acl' + network_acl_prototype_model['resource_group'] = resource_group_identity_model + network_acl_prototype_model['vpc'] = vpc_identity_model + network_acl_prototype_model['rules'] = [network_acl_rule_prototype_network_acl_context_model] + # Set up parameter values - security_group_id = 'testString' - id = 'testString' + network_acl_prototype = network_acl_prototype_model # Invoke method - response = _service.delete_security_group_target_binding( - security_group_id, - id, + response = _service.create_network_acl( + network_acl_prototype, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == network_acl_prototype - def test_delete_security_group_target_binding_all_params_with_retries(self): - # Enable retries and run test_delete_security_group_target_binding_all_params. + def test_create_network_acl_all_params_with_retries(self): + # Enable retries and run test_create_network_acl_all_params. _service.enable_retries() - self.test_delete_security_group_target_binding_all_params() + self.test_create_network_acl_all_params() - # Disable retries and run test_delete_security_group_target_binding_all_params. + # Disable retries and run test_create_network_acl_all_params. _service.disable_retries() - self.test_delete_security_group_target_binding_all_params() + self.test_create_network_acl_all_params() @responses.activate - def test_delete_security_group_target_binding_value_error(self): + def test_create_network_acl_value_error(self): """ - test_delete_security_group_target_binding_value_error() + test_create_network_acl_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets/testString') + url = preprocess_url('/network_acls') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.DELETE, + responses.POST, url, - status=204, + body=mock_response, + content_type='application/json', + status=201, ) + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f' + + # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model + network_acl_rule_prototype_network_acl_context_model = {} + network_acl_rule_prototype_network_acl_context_model['action'] = 'allow' + network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_model['ip_version'] = 'ipv4' + network_acl_rule_prototype_network_acl_context_model['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_model['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_model['destination_port_max'] = 22 + network_acl_rule_prototype_network_acl_context_model['destination_port_min'] = 22 + network_acl_rule_prototype_network_acl_context_model['protocol'] = 'udp' + network_acl_rule_prototype_network_acl_context_model['source_port_max'] = 65535 + network_acl_rule_prototype_network_acl_context_model['source_port_min'] = 49152 + + # Construct a dict representation of a NetworkACLPrototypeNetworkACLByRules model + network_acl_prototype_model = {} + network_acl_prototype_model['name'] = 'my-network-acl' + network_acl_prototype_model['resource_group'] = resource_group_identity_model + network_acl_prototype_model['vpc'] = vpc_identity_model + network_acl_prototype_model['rules'] = [network_acl_rule_prototype_network_acl_context_model] + # Set up parameter values - security_group_id = 'testString' - id = 'testString' + network_acl_prototype = network_acl_prototype_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_id, - "id": id, + "network_acl_prototype": network_acl_prototype, } 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_security_group_target_binding(**req_copy) + _service.create_network_acl(**req_copy) - def test_delete_security_group_target_binding_value_error_with_retries(self): - # Enable retries and run test_delete_security_group_target_binding_value_error. + def test_create_network_acl_value_error_with_retries(self): + # Enable retries and run test_create_network_acl_value_error. _service.enable_retries() - self.test_delete_security_group_target_binding_value_error() + self.test_create_network_acl_value_error() - # Disable retries and run test_delete_security_group_target_binding_value_error. + # Disable retries and run test_create_network_acl_value_error. _service.disable_retries() - self.test_delete_security_group_target_binding_value_error() + self.test_create_network_acl_value_error() -class TestGetSecurityGroupTarget: +class TestDeleteNetworkAcl: """ - Test Class for get_security_group_target + Test Class for delete_network_acl """ @responses.activate - def test_get_security_group_target_all_params(self): + def test_delete_network_acl_all_params(self): """ - get_security_group_target() + delete_network_acl() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets/testString') - mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}' + url = preprocess_url('/network_acls/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=204, ) # Set up parameter values - security_group_id = 'testString' id = 'testString' # Invoke method - response = _service.get_security_group_target( - security_group_id, + response = _service.delete_network_acl( id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 204 - def test_get_security_group_target_all_params_with_retries(self): - # Enable retries and run test_get_security_group_target_all_params. + def test_delete_network_acl_all_params_with_retries(self): + # Enable retries and run test_delete_network_acl_all_params. _service.enable_retries() - self.test_get_security_group_target_all_params() + self.test_delete_network_acl_all_params() - # Disable retries and run test_get_security_group_target_all_params. + # Disable retries and run test_delete_network_acl_all_params. _service.disable_retries() - self.test_get_security_group_target_all_params() + self.test_delete_network_acl_all_params() @responses.activate - def test_get_security_group_target_value_error(self): + def test_delete_network_acl_value_error(self): """ - test_get_security_group_target_value_error() + test_delete_network_acl_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets/testString') - mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}' + url = preprocess_url('/network_acls/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=204, ) # Set up parameter values - security_group_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_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_security_group_target(**req_copy) + _service.delete_network_acl(**req_copy) - def test_get_security_group_target_value_error_with_retries(self): - # Enable retries and run test_get_security_group_target_value_error. + def test_delete_network_acl_value_error_with_retries(self): + # Enable retries and run test_delete_network_acl_value_error. _service.enable_retries() - self.test_get_security_group_target_value_error() + self.test_delete_network_acl_value_error() - # Disable retries and run test_get_security_group_target_value_error. + # Disable retries and run test_delete_network_acl_value_error. _service.disable_retries() - self.test_get_security_group_target_value_error() + self.test_delete_network_acl_value_error() -class TestCreateSecurityGroupTargetBinding: +class TestGetNetworkAcl: """ - Test Class for create_security_group_target_binding + Test Class for get_network_acl """ @responses.activate - def test_create_security_group_target_binding_all_params(self): + def test_get_network_acl_all_params(self): """ - create_security_group_target_binding() + get_network_acl() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets/testString') - mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}' + url = preprocess_url('/network_acls/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.PUT, + responses.GET, url, body=mock_response, content_type='application/json', @@ -36366,12 +37853,10 @@ def test_create_security_group_target_binding_all_params(self): ) # Set up parameter values - security_group_id = 'testString' id = 'testString' # Invoke method - response = _service.create_security_group_target_binding( - security_group_id, + response = _service.get_network_acl( id, headers={}, ) @@ -36380,25 +37865,25 @@ def test_create_security_group_target_binding_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_create_security_group_target_binding_all_params_with_retries(self): - # Enable retries and run test_create_security_group_target_binding_all_params. + def test_get_network_acl_all_params_with_retries(self): + # Enable retries and run test_get_network_acl_all_params. _service.enable_retries() - self.test_create_security_group_target_binding_all_params() + self.test_get_network_acl_all_params() - # Disable retries and run test_create_security_group_target_binding_all_params. + # Disable retries and run test_get_network_acl_all_params. _service.disable_retries() - self.test_create_security_group_target_binding_all_params() + self.test_get_network_acl_all_params() @responses.activate - def test_create_security_group_target_binding_value_error(self): + def test_get_network_acl_value_error(self): """ - test_create_security_group_target_binding_value_error() + test_get_network_acl_value_error() """ # Set up mock - url = preprocess_url('/security_groups/testString/targets/testString') - mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}' + url = preprocess_url('/network_acls/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.PUT, + responses.GET, url, body=mock_response, content_type='application/json', @@ -36406,99 +37891,136 @@ def test_create_security_group_target_binding_value_error(self): ) # Set up parameter values - security_group_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "security_group_id": security_group_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.create_security_group_target_binding(**req_copy) + _service.get_network_acl(**req_copy) - def test_create_security_group_target_binding_value_error_with_retries(self): - # Enable retries and run test_create_security_group_target_binding_value_error. + def test_get_network_acl_value_error_with_retries(self): + # Enable retries and run test_get_network_acl_value_error. _service.enable_retries() - self.test_create_security_group_target_binding_value_error() + self.test_get_network_acl_value_error() - # Disable retries and run test_create_security_group_target_binding_value_error. + # Disable retries and run test_get_network_acl_value_error. _service.disable_retries() - self.test_create_security_group_target_binding_value_error() - - -# endregion -############################################################################## -# End of Service: SecurityGroups -############################################################################## - -############################################################################## -# Start of Service: VPNGateways -############################################################################## -# region + self.test_get_network_acl_value_error() -class TestNewInstance: +class TestUpdateNetworkAcl: """ - Test Class for new_instance + Test Class for update_network_acl """ - def test_new_instance(self): + @responses.activate + def test_update_network_acl_all_params(self): """ - new_instance() + update_network_acl() """ - os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + # Set up mock + url = preprocess_url('/network_acls/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE', + # Construct a dict representation of a NetworkACLPatch model + network_acl_patch_model = {} + network_acl_patch_model['name'] = 'my-network-acl' + + # Set up parameter values + id = 'testString' + network_acl_patch = network_acl_patch_model + + # Invoke method + response = _service.update_network_acl( + id, + network_acl_patch, + headers={}, ) - assert service is not None - assert isinstance(service, VpcV1) + # 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 == network_acl_patch - def test_new_instance_without_authenticator(self): - """ - new_instance_without_authenticator() - """ - with pytest.raises(ValueError, match='authenticator must be provided'): - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE_NOT_FOUND', - ) + def test_update_network_acl_all_params_with_retries(self): + # Enable retries and run test_update_network_acl_all_params. + _service.enable_retries() + self.test_update_network_acl_all_params() - def test_new_instance_without_required_params(self): - """ - new_instance_without_required_params() - """ - with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): - service = VpcV1.new_instance() + # Disable retries and run test_update_network_acl_all_params. + _service.disable_retries() + self.test_update_network_acl_all_params() - def test_new_instance_required_param_none(self): + @responses.activate + def test_update_network_acl_value_error(self): """ - new_instance_required_param_none() + test_update_network_acl_value_error() """ - with pytest.raises(ValueError, match='version must be provided'): - service = VpcV1.new_instance( - version=None, - ) + # Set up mock + url = preprocess_url('/network_acls/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + # Construct a dict representation of a NetworkACLPatch model + network_acl_patch_model = {} + network_acl_patch_model['name'] = 'my-network-acl' -class TestListIkePolicies: + # Set up parameter values + id = 'testString' + network_acl_patch = network_acl_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + "network_acl_patch": network_acl_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_network_acl(**req_copy) + + def test_update_network_acl_value_error_with_retries(self): + # Enable retries and run test_update_network_acl_value_error. + _service.enable_retries() + self.test_update_network_acl_value_error() + + # Disable retries and run test_update_network_acl_value_error. + _service.disable_retries() + self.test_update_network_acl_value_error() + + +class TestListNetworkAclRules: """ - Test Class for list_ike_policies + Test Class for list_network_acl_rules """ @responses.activate - def test_list_ike_policies_all_params(self): + def test_list_network_acl_rules_all_params(self): """ - list_ike_policies() + list_network_acl_rules() """ # Set up mock - url = preprocess_url('/ike_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/network_acls/testString/rules') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add( responses.GET, url, @@ -36508,13 +38030,17 @@ def test_list_ike_policies_all_params(self): ) # Set up parameter values + network_acl_id = 'testString' start = 'testString' limit = 50 + direction = 'inbound' # Invoke method - response = _service.list_ike_policies( + response = _service.list_network_acl_rules( + network_acl_id, start=start, limit=limit, + direction=direction, headers={}, ) @@ -36526,24 +38052,25 @@ def test_list_ike_policies_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + assert 'direction={}'.format(direction) in query_string - def test_list_ike_policies_all_params_with_retries(self): - # Enable retries and run test_list_ike_policies_all_params. + def test_list_network_acl_rules_all_params_with_retries(self): + # Enable retries and run test_list_network_acl_rules_all_params. _service.enable_retries() - self.test_list_ike_policies_all_params() + self.test_list_network_acl_rules_all_params() - # Disable retries and run test_list_ike_policies_all_params. + # Disable retries and run test_list_network_acl_rules_all_params. _service.disable_retries() - self.test_list_ike_policies_all_params() + self.test_list_network_acl_rules_all_params() @responses.activate - def test_list_ike_policies_required_params(self): + def test_list_network_acl_rules_required_params(self): """ - test_list_ike_policies_required_params() + test_list_network_acl_rules_required_params() """ # Set up mock - url = preprocess_url('/ike_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/network_acls/testString/rules') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add( responses.GET, url, @@ -36552,30 +38079,36 @@ def test_list_ike_policies_required_params(self): status=200, ) + # Set up parameter values + network_acl_id = 'testString' + # Invoke method - response = _service.list_ike_policies() + response = _service.list_network_acl_rules( + network_acl_id, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_ike_policies_required_params_with_retries(self): - # Enable retries and run test_list_ike_policies_required_params. + def test_list_network_acl_rules_required_params_with_retries(self): + # Enable retries and run test_list_network_acl_rules_required_params. _service.enable_retries() - self.test_list_ike_policies_required_params() + self.test_list_network_acl_rules_required_params() - # Disable retries and run test_list_ike_policies_required_params. + # Disable retries and run test_list_network_acl_rules_required_params. _service.disable_retries() - self.test_list_ike_policies_required_params() + self.test_list_network_acl_rules_required_params() @responses.activate - def test_list_ike_policies_value_error(self): + def test_list_network_acl_rules_value_error(self): """ - test_list_ike_policies_value_error() + test_list_network_acl_rules_value_error() """ # Set up mock - url = preprocess_url('/ike_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/network_acls/testString/rules') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add( responses.GET, url, @@ -36584,32 +38117,36 @@ def test_list_ike_policies_value_error(self): status=200, ) + # Set up parameter values + network_acl_id = 'testString' + # Pass in all but one required param and check for a ValueError req_param_dict = { + "network_acl_id": network_acl_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.list_ike_policies(**req_copy) + _service.list_network_acl_rules(**req_copy) - def test_list_ike_policies_value_error_with_retries(self): - # Enable retries and run test_list_ike_policies_value_error. + def test_list_network_acl_rules_value_error_with_retries(self): + # Enable retries and run test_list_network_acl_rules_value_error. _service.enable_retries() - self.test_list_ike_policies_value_error() + self.test_list_network_acl_rules_value_error() - # Disable retries and run test_list_ike_policies_value_error. + # Disable retries and run test_list_network_acl_rules_value_error. _service.disable_retries() - self.test_list_ike_policies_value_error() + self.test_list_network_acl_rules_value_error() @responses.activate - def test_list_ike_policies_with_pager_get_next(self): + def test_list_network_acl_rules_with_pager_get_next(self): """ - test_list_ike_policies_with_pager_get_next() + test_list_network_acl_rules_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/ike_policies') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' - mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' + url = preprocess_url('/network_acls/testString/rules') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' + mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' responses.add( responses.GET, url, @@ -36627,9 +38164,11 @@ def test_list_ike_policies_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = IkePoliciesPager( + pager = NetworkAclRulesPager( client=_service, + network_acl_id='testString', limit=10, + direction='inbound', ) while pager.has_next(): next_page = pager.get_next() @@ -36638,14 +38177,14 @@ def test_list_ike_policies_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_ike_policies_with_pager_get_all(self): + def test_list_network_acl_rules_with_pager_get_all(self): """ - test_list_ike_policies_with_pager_get_all() + test_list_network_acl_rules_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/ike_policies') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' - mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' + url = preprocess_url('/network_acls/testString/rules') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' + mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' responses.add( responses.GET, url, @@ -36662,28 +38201,30 @@ def test_list_ike_policies_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = IkePoliciesPager( + pager = NetworkAclRulesPager( client=_service, + network_acl_id='testString', limit=10, + direction='inbound', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateIkePolicy: +class TestCreateNetworkAclRule: """ - Test Class for create_ike_policy + Test Class for create_network_acl_rule """ @responses.activate - def test_create_ike_policy_all_params(self): + def test_create_network_acl_rule_all_params(self): """ - create_ike_policy() + create_network_acl_rule() """ # Set up mock - url = preprocess_url('/ike_policies') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' + url = preprocess_url('/network_acls/testString/rules') + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add( responses.POST, url, @@ -36692,28 +38233,33 @@ def test_create_ike_policy_all_params(self): status=201, ) - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model + network_acl_rule_before_prototype_model = {} + network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + + # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model + network_acl_rule_prototype_model = {} + network_acl_rule_prototype_model['action'] = 'allow' + network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_model['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_model['direction'] = 'inbound' + network_acl_rule_prototype_model['ip_version'] = 'ipv4' + network_acl_rule_prototype_model['name'] = 'my-rule-2' + network_acl_rule_prototype_model['source'] = '192.168.3.2/32' + network_acl_rule_prototype_model['destination_port_max'] = 22 + network_acl_rule_prototype_model['destination_port_min'] = 22 + network_acl_rule_prototype_model['protocol'] = 'udp' + network_acl_rule_prototype_model['source_port_max'] = 65535 + network_acl_rule_prototype_model['source_port_min'] = 49152 # Set up parameter values - authentication_algorithm = 'sha256' - dh_group = 14 - encryption_algorithm = 'aes128' - ike_version = 1 - key_lifetime = 28800 - name = 'my-ike-policy' - resource_group = resource_group_identity_model + network_acl_id = 'testString' + network_acl_rule_prototype = network_acl_rule_prototype_model # Invoke method - response = _service.create_ike_policy( - authentication_algorithm, - dh_group, - encryption_algorithm, - ike_version, - key_lifetime=key_lifetime, - name=name, - resource_group=resource_group, + response = _service.create_network_acl_rule( + network_acl_id, + network_acl_rule_prototype, headers={}, ) @@ -36722,31 +38268,25 @@ def test_create_ike_policy_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['authentication_algorithm'] == 'sha256' - assert req_body['dh_group'] == 14 - assert req_body['encryption_algorithm'] == 'aes128' - assert req_body['ike_version'] == 1 - assert req_body['key_lifetime'] == 28800 - assert req_body['name'] == 'my-ike-policy' - assert req_body['resource_group'] == resource_group_identity_model + assert req_body == network_acl_rule_prototype - def test_create_ike_policy_all_params_with_retries(self): - # Enable retries and run test_create_ike_policy_all_params. + def test_create_network_acl_rule_all_params_with_retries(self): + # Enable retries and run test_create_network_acl_rule_all_params. _service.enable_retries() - self.test_create_ike_policy_all_params() + self.test_create_network_acl_rule_all_params() - # Disable retries and run test_create_ike_policy_all_params. + # Disable retries and run test_create_network_acl_rule_all_params. _service.disable_retries() - self.test_create_ike_policy_all_params() + self.test_create_network_acl_rule_all_params() @responses.activate - def test_create_ike_policy_value_error(self): + def test_create_network_acl_rule_value_error(self): """ - test_create_ike_policy_value_error() + test_create_network_acl_rule_value_error() """ # Set up mock - url = preprocess_url('/ike_policies') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' + url = preprocess_url('/network_acls/testString/rules') + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add( responses.POST, url, @@ -36755,53 +38295,61 @@ def test_create_ike_policy_value_error(self): status=201, ) - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model + network_acl_rule_before_prototype_model = {} + network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + + # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model + network_acl_rule_prototype_model = {} + network_acl_rule_prototype_model['action'] = 'allow' + network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_model['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_model['direction'] = 'inbound' + network_acl_rule_prototype_model['ip_version'] = 'ipv4' + network_acl_rule_prototype_model['name'] = 'my-rule-2' + network_acl_rule_prototype_model['source'] = '192.168.3.2/32' + network_acl_rule_prototype_model['destination_port_max'] = 22 + network_acl_rule_prototype_model['destination_port_min'] = 22 + network_acl_rule_prototype_model['protocol'] = 'udp' + network_acl_rule_prototype_model['source_port_max'] = 65535 + network_acl_rule_prototype_model['source_port_min'] = 49152 # Set up parameter values - authentication_algorithm = 'sha256' - dh_group = 14 - encryption_algorithm = 'aes128' - ike_version = 1 - key_lifetime = 28800 - name = 'my-ike-policy' - resource_group = resource_group_identity_model + network_acl_id = 'testString' + network_acl_rule_prototype = network_acl_rule_prototype_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "authentication_algorithm": authentication_algorithm, - "dh_group": dh_group, - "encryption_algorithm": encryption_algorithm, - "ike_version": ike_version, + "network_acl_id": network_acl_id, + "network_acl_rule_prototype": network_acl_rule_prototype, } 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_ike_policy(**req_copy) + _service.create_network_acl_rule(**req_copy) - def test_create_ike_policy_value_error_with_retries(self): - # Enable retries and run test_create_ike_policy_value_error. + def test_create_network_acl_rule_value_error_with_retries(self): + # Enable retries and run test_create_network_acl_rule_value_error. _service.enable_retries() - self.test_create_ike_policy_value_error() + self.test_create_network_acl_rule_value_error() - # Disable retries and run test_create_ike_policy_value_error. + # Disable retries and run test_create_network_acl_rule_value_error. _service.disable_retries() - self.test_create_ike_policy_value_error() + self.test_create_network_acl_rule_value_error() -class TestDeleteIkePolicy: +class TestDeleteNetworkAclRule: """ - Test Class for delete_ike_policy + Test Class for delete_network_acl_rule """ @responses.activate - def test_delete_ike_policy_all_params(self): + def test_delete_network_acl_rule_all_params(self): """ - delete_ike_policy() + delete_network_acl_rule() """ # Set up mock - url = preprocess_url('/ike_policies/testString') + url = preprocess_url('/network_acls/testString/rules/testString') responses.add( responses.DELETE, url, @@ -36809,10 +38357,12 @@ def test_delete_ike_policy_all_params(self): ) # Set up parameter values + network_acl_id = 'testString' id = 'testString' # Invoke method - response = _service.delete_ike_policy( + response = _service.delete_network_acl_rule( + network_acl_id, id, headers={}, ) @@ -36821,22 +38371,22 @@ def test_delete_ike_policy_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 204 - def test_delete_ike_policy_all_params_with_retries(self): - # Enable retries and run test_delete_ike_policy_all_params. + def test_delete_network_acl_rule_all_params_with_retries(self): + # Enable retries and run test_delete_network_acl_rule_all_params. _service.enable_retries() - self.test_delete_ike_policy_all_params() + self.test_delete_network_acl_rule_all_params() - # Disable retries and run test_delete_ike_policy_all_params. + # Disable retries and run test_delete_network_acl_rule_all_params. _service.disable_retries() - self.test_delete_ike_policy_all_params() + self.test_delete_network_acl_rule_all_params() @responses.activate - def test_delete_ike_policy_value_error(self): + def test_delete_network_acl_rule_value_error(self): """ - test_delete_ike_policy_value_error() + test_delete_network_acl_rule_value_error() """ # Set up mock - url = preprocess_url('/ike_policies/testString') + url = preprocess_url('/network_acls/testString/rules/testString') responses.add( responses.DELETE, url, @@ -36844,40 +38394,42 @@ def test_delete_ike_policy_value_error(self): ) # Set up parameter values + network_acl_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "network_acl_id": network_acl_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.delete_ike_policy(**req_copy) + _service.delete_network_acl_rule(**req_copy) - def test_delete_ike_policy_value_error_with_retries(self): - # Enable retries and run test_delete_ike_policy_value_error. + def test_delete_network_acl_rule_value_error_with_retries(self): + # Enable retries and run test_delete_network_acl_rule_value_error. _service.enable_retries() - self.test_delete_ike_policy_value_error() + self.test_delete_network_acl_rule_value_error() - # Disable retries and run test_delete_ike_policy_value_error. + # Disable retries and run test_delete_network_acl_rule_value_error. _service.disable_retries() - self.test_delete_ike_policy_value_error() + self.test_delete_network_acl_rule_value_error() -class TestGetIkePolicy: +class TestGetNetworkAclRule: """ - Test Class for get_ike_policy + Test Class for get_network_acl_rule """ @responses.activate - def test_get_ike_policy_all_params(self): + def test_get_network_acl_rule_all_params(self): """ - get_ike_policy() + get_network_acl_rule() """ # Set up mock - url = preprocess_url('/ike_policies/testString') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' + url = preprocess_url('/network_acls/testString/rules/testString') + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add( responses.GET, url, @@ -36887,10 +38439,12 @@ def test_get_ike_policy_all_params(self): ) # Set up parameter values + network_acl_id = 'testString' id = 'testString' # Invoke method - response = _service.get_ike_policy( + response = _service.get_network_acl_rule( + network_acl_id, id, headers={}, ) @@ -36899,23 +38453,23 @@ def test_get_ike_policy_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_ike_policy_all_params_with_retries(self): - # Enable retries and run test_get_ike_policy_all_params. + def test_get_network_acl_rule_all_params_with_retries(self): + # Enable retries and run test_get_network_acl_rule_all_params. _service.enable_retries() - self.test_get_ike_policy_all_params() + self.test_get_network_acl_rule_all_params() - # Disable retries and run test_get_ike_policy_all_params. + # Disable retries and run test_get_network_acl_rule_all_params. _service.disable_retries() - self.test_get_ike_policy_all_params() + self.test_get_network_acl_rule_all_params() @responses.activate - def test_get_ike_policy_value_error(self): + def test_get_network_acl_rule_value_error(self): """ - test_get_ike_policy_value_error() + test_get_network_acl_rule_value_error() """ # Set up mock - url = preprocess_url('/ike_policies/testString') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' + url = preprocess_url('/network_acls/testString/rules/testString') + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add( responses.GET, url, @@ -36925,40 +38479,42 @@ def test_get_ike_policy_value_error(self): ) # Set up parameter values + network_acl_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "network_acl_id": network_acl_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_ike_policy(**req_copy) + _service.get_network_acl_rule(**req_copy) - def test_get_ike_policy_value_error_with_retries(self): - # Enable retries and run test_get_ike_policy_value_error. + def test_get_network_acl_rule_value_error_with_retries(self): + # Enable retries and run test_get_network_acl_rule_value_error. _service.enable_retries() - self.test_get_ike_policy_value_error() + self.test_get_network_acl_rule_value_error() - # Disable retries and run test_get_ike_policy_value_error. + # Disable retries and run test_get_network_acl_rule_value_error. _service.disable_retries() - self.test_get_ike_policy_value_error() + self.test_get_network_acl_rule_value_error() -class TestUpdateIkePolicy: +class TestUpdateNetworkAclRule: """ - Test Class for update_ike_policy + Test Class for update_network_acl_rule """ @responses.activate - def test_update_ike_policy_all_params(self): + def test_update_network_acl_rule_all_params(self): """ - update_ike_policy() + update_network_acl_rule() """ # Set up mock - url = preprocess_url('/ike_policies/testString') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' + url = preprocess_url('/network_acls/testString/rules/testString') + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add( responses.PATCH, url, @@ -36967,23 +38523,36 @@ def test_update_ike_policy_all_params(self): status=200, ) - # Construct a dict representation of a IKEPolicyPatch model - ike_policy_patch_model = {} - ike_policy_patch_model['authentication_algorithm'] = 'sha256' - ike_policy_patch_model['dh_group'] = 14 - ike_policy_patch_model['encryption_algorithm'] = 'aes128' - ike_policy_patch_model['ike_version'] = 1 - ike_policy_patch_model['key_lifetime'] = 28800 - ike_policy_patch_model['name'] = 'my-ike-policy' - + # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model + network_acl_rule_before_patch_model = {} + network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + + # Construct a dict representation of a NetworkACLRulePatch model + network_acl_rule_patch_model = {} + network_acl_rule_patch_model['action'] = 'allow' + network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model + network_acl_rule_patch_model['code'] = 0 + network_acl_rule_patch_model['destination'] = '192.168.3.2/32' + network_acl_rule_patch_model['destination_port_max'] = 22 + network_acl_rule_patch_model['destination_port_min'] = 22 + network_acl_rule_patch_model['direction'] = 'inbound' + network_acl_rule_patch_model['name'] = 'my-rule-1' + network_acl_rule_patch_model['protocol'] = 'tcp' + network_acl_rule_patch_model['source'] = '192.168.3.2/32' + network_acl_rule_patch_model['source_port_max'] = 65535 + network_acl_rule_patch_model['source_port_min'] = 49152 + network_acl_rule_patch_model['type'] = 8 + # Set up parameter values + network_acl_id = 'testString' id = 'testString' - ike_policy_patch = ike_policy_patch_model + network_acl_rule_patch = network_acl_rule_patch_model # Invoke method - response = _service.update_ike_policy( + response = _service.update_network_acl_rule( + network_acl_id, id, - ike_policy_patch, + network_acl_rule_patch, headers={}, ) @@ -36992,25 +38561,25 @@ def test_update_ike_policy_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == ike_policy_patch + assert req_body == network_acl_rule_patch - def test_update_ike_policy_all_params_with_retries(self): - # Enable retries and run test_update_ike_policy_all_params. + def test_update_network_acl_rule_all_params_with_retries(self): + # Enable retries and run test_update_network_acl_rule_all_params. _service.enable_retries() - self.test_update_ike_policy_all_params() + self.test_update_network_acl_rule_all_params() - # Disable retries and run test_update_ike_policy_all_params. + # Disable retries and run test_update_network_acl_rule_all_params. _service.disable_retries() - self.test_update_ike_policy_all_params() + self.test_update_network_acl_rule_all_params() @responses.activate - def test_update_ike_policy_value_error(self): + def test_update_network_acl_rule_value_error(self): """ - test_update_ike_policy_value_error() + test_update_network_acl_rule_value_error() """ # Set up mock - url = preprocess_url('/ike_policies/testString') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' + url = preprocess_url('/network_acls/testString/rules/testString') + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add( responses.PATCH, url, @@ -37019,251 +38588,122 @@ def test_update_ike_policy_value_error(self): status=200, ) - # Construct a dict representation of a IKEPolicyPatch model - ike_policy_patch_model = {} - ike_policy_patch_model['authentication_algorithm'] = 'sha256' - ike_policy_patch_model['dh_group'] = 14 - ike_policy_patch_model['encryption_algorithm'] = 'aes128' - ike_policy_patch_model['ike_version'] = 1 - ike_policy_patch_model['key_lifetime'] = 28800 - ike_policy_patch_model['name'] = 'my-ike-policy' + # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model + network_acl_rule_before_patch_model = {} + network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + + # Construct a dict representation of a NetworkACLRulePatch model + network_acl_rule_patch_model = {} + network_acl_rule_patch_model['action'] = 'allow' + network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model + network_acl_rule_patch_model['code'] = 0 + network_acl_rule_patch_model['destination'] = '192.168.3.2/32' + network_acl_rule_patch_model['destination_port_max'] = 22 + network_acl_rule_patch_model['destination_port_min'] = 22 + network_acl_rule_patch_model['direction'] = 'inbound' + network_acl_rule_patch_model['name'] = 'my-rule-1' + network_acl_rule_patch_model['protocol'] = 'tcp' + network_acl_rule_patch_model['source'] = '192.168.3.2/32' + network_acl_rule_patch_model['source_port_max'] = 65535 + network_acl_rule_patch_model['source_port_min'] = 49152 + network_acl_rule_patch_model['type'] = 8 # Set up parameter values + network_acl_id = 'testString' id = 'testString' - ike_policy_patch = ike_policy_patch_model + network_acl_rule_patch = network_acl_rule_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { + "network_acl_id": network_acl_id, "id": id, - "ike_policy_patch": ike_policy_patch, + "network_acl_rule_patch": network_acl_rule_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_ike_policy(**req_copy) + _service.update_network_acl_rule(**req_copy) - def test_update_ike_policy_value_error_with_retries(self): - # Enable retries and run test_update_ike_policy_value_error. + def test_update_network_acl_rule_value_error_with_retries(self): + # Enable retries and run test_update_network_acl_rule_value_error. _service.enable_retries() - self.test_update_ike_policy_value_error() + self.test_update_network_acl_rule_value_error() - # Disable retries and run test_update_ike_policy_value_error. + # Disable retries and run test_update_network_acl_rule_value_error. _service.disable_retries() - self.test_update_ike_policy_value_error() - - -class TestListIkePolicyConnections: - """ - Test Class for list_ike_policy_connections - """ - - @responses.activate - def test_list_ike_policy_connections_all_params(self): - """ - list_ike_policy_connections() - """ - # Set up mock - url = preprocess_url('/ike_policies/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?start=c6d339ad873241c4acc936dfcff3f6d2&limit=20"}, "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) + self.test_update_network_acl_rule_value_error() - # Set up parameter values - id = 'testString' - start = 'testString' - limit = 50 - # Invoke method - response = _service.list_ike_policy_connections( - id, - start=start, - limit=limit, - headers={}, - ) +# endregion +############################################################################## +# End of Service: NetworkACLs +############################################################################## - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string +############################################################################## +# Start of Service: SecurityGroups +############################################################################## +# region - def test_list_ike_policy_connections_all_params_with_retries(self): - # Enable retries and run test_list_ike_policy_connections_all_params. - _service.enable_retries() - self.test_list_ike_policy_connections_all_params() - # Disable retries and run test_list_ike_policy_connections_all_params. - _service.disable_retries() - self.test_list_ike_policy_connections_all_params() +class TestNewInstance: + """ + Test Class for new_instance + """ - @responses.activate - def test_list_ike_policy_connections_required_params(self): + def test_new_instance(self): """ - test_list_ike_policy_connections_required_params() + new_instance() """ - # Set up mock - url = preprocess_url('/ike_policies/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?start=c6d339ad873241c4acc936dfcff3f6d2&limit=20"}, "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - id = 'testString' + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - # Invoke method - response = _service.list_ike_policy_connections( - id, - headers={}, + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', ) - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_list_ike_policy_connections_required_params_with_retries(self): - # Enable retries and run test_list_ike_policy_connections_required_params. - _service.enable_retries() - self.test_list_ike_policy_connections_required_params() - - # Disable retries and run test_list_ike_policy_connections_required_params. - _service.disable_retries() - self.test_list_ike_policy_connections_required_params() + assert service is not None + assert isinstance(service, VpcV1) - @responses.activate - def test_list_ike_policy_connections_value_error(self): + def test_new_instance_without_authenticator(self): """ - test_list_ike_policy_connections_value_error() + new_instance_without_authenticator() """ - # Set up mock - url = preprocess_url('/ike_policies/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?start=c6d339ad873241c4acc936dfcff3f6d2&limit=20"}, "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - id = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "id": id, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.list_ike_policy_connections(**req_copy) - - def test_list_ike_policy_connections_value_error_with_retries(self): - # Enable retries and run test_list_ike_policy_connections_value_error. - _service.enable_retries() - self.test_list_ike_policy_connections_value_error() - - # Disable retries and run test_list_ike_policy_connections_value_error. - _service.disable_retries() - self.test_list_ike_policy_connections_value_error() + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) - @responses.activate - def test_list_ike_policy_connections_with_pager_get_next(self): + def test_new_instance_without_required_params(self): """ - test_list_ike_policy_connections_with_pager_get_next() + new_instance_without_required_params() """ - # Set up a two-page mock response - url = preprocess_url('/ike_policies/testString/connections') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - all_results = [] - pager = IkePolicyConnectionsPager( - client=_service, - id='testString', - limit=10, - ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() - @responses.activate - def test_list_ike_policy_connections_with_pager_get_all(self): + def test_new_instance_required_param_none(self): """ - test_list_ike_policy_connections_with_pager_get_all() + new_instance_required_param_none() """ - # Set up a two-page mock response - url = preprocess_url('/ike_policies/testString/connections') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - pager = IkePolicyConnectionsPager( - client=_service, - id='testString', - limit=10, - ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) -class TestListIpsecPolicies: +class TestListSecurityGroups: """ - Test Class for list_ipsec_policies + Test Class for list_security_groups """ @responses.activate - def test_list_ipsec_policies_all_params(self): + def test_list_security_groups_all_params(self): """ - list_ipsec_policies() + list_security_groups() """ # Set up mock - url = preprocess_url('/ipsec_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/security_groups') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -37275,11 +38715,19 @@ def test_list_ipsec_policies_all_params(self): # Set up parameter values start = 'testString' limit = 50 + resource_group_id = 'testString' + vpc_id = 'testString' + vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_name = 'my-vpc' # Invoke method - response = _service.list_ipsec_policies( + response = _service.list_security_groups( start=start, limit=limit, + resource_group_id=resource_group_id, + vpc_id=vpc_id, + vpc_crn=vpc_crn, + vpc_name=vpc_name, headers={}, ) @@ -37291,24 +38739,28 @@ def test_list_ipsec_policies_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'vpc.id={}'.format(vpc_id) in query_string + assert 'vpc.crn={}'.format(vpc_crn) in query_string + assert 'vpc.name={}'.format(vpc_name) in query_string - def test_list_ipsec_policies_all_params_with_retries(self): - # Enable retries and run test_list_ipsec_policies_all_params. + def test_list_security_groups_all_params_with_retries(self): + # Enable retries and run test_list_security_groups_all_params. _service.enable_retries() - self.test_list_ipsec_policies_all_params() + self.test_list_security_groups_all_params() - # Disable retries and run test_list_ipsec_policies_all_params. + # Disable retries and run test_list_security_groups_all_params. _service.disable_retries() - self.test_list_ipsec_policies_all_params() + self.test_list_security_groups_all_params() @responses.activate - def test_list_ipsec_policies_required_params(self): + def test_list_security_groups_required_params(self): """ - test_list_ipsec_policies_required_params() + test_list_security_groups_required_params() """ # Set up mock - url = preprocess_url('/ipsec_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/security_groups') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -37318,29 +38770,29 @@ def test_list_ipsec_policies_required_params(self): ) # Invoke method - response = _service.list_ipsec_policies() + response = _service.list_security_groups() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_ipsec_policies_required_params_with_retries(self): - # Enable retries and run test_list_ipsec_policies_required_params. + def test_list_security_groups_required_params_with_retries(self): + # Enable retries and run test_list_security_groups_required_params. _service.enable_retries() - self.test_list_ipsec_policies_required_params() + self.test_list_security_groups_required_params() - # Disable retries and run test_list_ipsec_policies_required_params. + # Disable retries and run test_list_security_groups_required_params. _service.disable_retries() - self.test_list_ipsec_policies_required_params() + self.test_list_security_groups_required_params() @responses.activate - def test_list_ipsec_policies_value_error(self): + def test_list_security_groups_value_error(self): """ - test_list_ipsec_policies_value_error() + test_list_security_groups_value_error() """ # Set up mock - url = preprocess_url('/ipsec_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/security_groups') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -37355,26 +38807,26 @@ def test_list_ipsec_policies_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_ipsec_policies(**req_copy) + _service.list_security_groups(**req_copy) - def test_list_ipsec_policies_value_error_with_retries(self): - # Enable retries and run test_list_ipsec_policies_value_error. + def test_list_security_groups_value_error_with_retries(self): + # Enable retries and run test_list_security_groups_value_error. _service.enable_retries() - self.test_list_ipsec_policies_value_error() + self.test_list_security_groups_value_error() - # Disable retries and run test_list_ipsec_policies_value_error. + # Disable retries and run test_list_security_groups_value_error. _service.disable_retries() - self.test_list_ipsec_policies_value_error() + self.test_list_security_groups_value_error() @responses.activate - def test_list_ipsec_policies_with_pager_get_next(self): + def test_list_security_groups_with_pager_get_next(self): """ - test_list_ipsec_policies_with_pager_get_next() + test_list_security_groups_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/ipsec_policies') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' - mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + url = preprocess_url('/security_groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -37392,9 +38844,13 @@ def test_list_ipsec_policies_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = IpsecPoliciesPager( + pager = SecurityGroupsPager( client=_service, limit=10, + resource_group_id='testString', + vpc_id='testString', + vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', + vpc_name='my-vpc', ) while pager.has_next(): next_page = pager.get_next() @@ -37403,14 +38859,14 @@ def test_list_ipsec_policies_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_ipsec_policies_with_pager_get_all(self): + def test_list_security_groups_with_pager_get_all(self): """ - test_list_ipsec_policies_with_pager_get_all() + test_list_security_groups_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/ipsec_policies') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' - mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + url = preprocess_url('/security_groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","local":{"address":"192.168.3.4"},"remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -37427,28 +38883,32 @@ def test_list_ipsec_policies_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = IpsecPoliciesPager( + pager = SecurityGroupsPager( client=_service, limit=10, + resource_group_id='testString', + vpc_id='testString', + vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', + vpc_name='my-vpc', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateIpsecPolicy: +class TestCreateSecurityGroup: """ - Test Class for create_ipsec_policy + Test Class for create_security_group """ @responses.activate - def test_create_ipsec_policy_all_params(self): + def test_create_security_group_all_params(self): """ - create_ipsec_policy() + create_security_group() """ # Set up mock - url = preprocess_url('/ipsec_policies') - mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + url = preprocess_url('/security_groups') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -37457,26 +38917,42 @@ def test_create_ipsec_policy_all_params(self): status=201, ) + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a SecurityGroupRuleLocalPrototypeIP model + security_group_rule_local_prototype_model = {} + security_group_rule_local_prototype_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model + security_group_rule_remote_prototype_model = {} + security_group_rule_remote_prototype_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model + security_group_rule_prototype_model = {} + security_group_rule_prototype_model['direction'] = 'inbound' + security_group_rule_prototype_model['ip_version'] = 'ipv4' + security_group_rule_prototype_model['local'] = security_group_rule_local_prototype_model + security_group_rule_prototype_model['protocol'] = 'all' + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model + # Set up parameter values - authentication_algorithm = 'disabled' - encryption_algorithm = 'aes128' - pfs = 'disabled' - key_lifetime = 3600 - name = 'my-ipsec-policy' + vpc = vpc_identity_model + name = 'my-security-group' resource_group = resource_group_identity_model + rules = [security_group_rule_prototype_model] # Invoke method - response = _service.create_ipsec_policy( - authentication_algorithm, - encryption_algorithm, - pfs, - key_lifetime=key_lifetime, + response = _service.create_security_group( + vpc, name=name, resource_group=resource_group, + rules=rules, headers={}, ) @@ -37485,30 +38961,28 @@ def test_create_ipsec_policy_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['authentication_algorithm'] == 'disabled' - assert req_body['encryption_algorithm'] == 'aes128' - assert req_body['pfs'] == 'disabled' - assert req_body['key_lifetime'] == 3600 - assert req_body['name'] == 'my-ipsec-policy' + assert req_body['vpc'] == vpc_identity_model + assert req_body['name'] == 'my-security-group' assert req_body['resource_group'] == resource_group_identity_model + assert req_body['rules'] == [security_group_rule_prototype_model] - def test_create_ipsec_policy_all_params_with_retries(self): - # Enable retries and run test_create_ipsec_policy_all_params. + def test_create_security_group_all_params_with_retries(self): + # Enable retries and run test_create_security_group_all_params. _service.enable_retries() - self.test_create_ipsec_policy_all_params() + self.test_create_security_group_all_params() - # Disable retries and run test_create_ipsec_policy_all_params. + # Disable retries and run test_create_security_group_all_params. _service.disable_retries() - self.test_create_ipsec_policy_all_params() + self.test_create_security_group_all_params() @responses.activate - def test_create_ipsec_policy_value_error(self): + def test_create_security_group_value_error(self): """ - test_create_ipsec_policy_value_error() + test_create_security_group_value_error() """ # Set up mock - url = preprocess_url('/ipsec_policies') - mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + url = preprocess_url('/security_groups') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -37517,51 +38991,67 @@ def test_create_ipsec_policy_value_error(self): status=201, ) + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a SecurityGroupRuleLocalPrototypeIP model + security_group_rule_local_prototype_model = {} + security_group_rule_local_prototype_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model + security_group_rule_remote_prototype_model = {} + security_group_rule_remote_prototype_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model + security_group_rule_prototype_model = {} + security_group_rule_prototype_model['direction'] = 'inbound' + security_group_rule_prototype_model['ip_version'] = 'ipv4' + security_group_rule_prototype_model['local'] = security_group_rule_local_prototype_model + security_group_rule_prototype_model['protocol'] = 'all' + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model + # Set up parameter values - authentication_algorithm = 'disabled' - encryption_algorithm = 'aes128' - pfs = 'disabled' - key_lifetime = 3600 - name = 'my-ipsec-policy' + vpc = vpc_identity_model + name = 'my-security-group' resource_group = resource_group_identity_model + rules = [security_group_rule_prototype_model] # Pass in all but one required param and check for a ValueError req_param_dict = { - "authentication_algorithm": authentication_algorithm, - "encryption_algorithm": encryption_algorithm, - "pfs": pfs, + "vpc": vpc, } 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_ipsec_policy(**req_copy) + _service.create_security_group(**req_copy) - def test_create_ipsec_policy_value_error_with_retries(self): - # Enable retries and run test_create_ipsec_policy_value_error. + def test_create_security_group_value_error_with_retries(self): + # Enable retries and run test_create_security_group_value_error. _service.enable_retries() - self.test_create_ipsec_policy_value_error() + self.test_create_security_group_value_error() - # Disable retries and run test_create_ipsec_policy_value_error. + # Disable retries and run test_create_security_group_value_error. _service.disable_retries() - self.test_create_ipsec_policy_value_error() + self.test_create_security_group_value_error() -class TestDeleteIpsecPolicy: +class TestDeleteSecurityGroup: """ - Test Class for delete_ipsec_policy + Test Class for delete_security_group """ @responses.activate - def test_delete_ipsec_policy_all_params(self): + def test_delete_security_group_all_params(self): """ - delete_ipsec_policy() + delete_security_group() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString') + url = preprocess_url('/security_groups/testString') responses.add( responses.DELETE, url, @@ -37572,7 +39062,7 @@ def test_delete_ipsec_policy_all_params(self): id = 'testString' # Invoke method - response = _service.delete_ipsec_policy( + response = _service.delete_security_group( id, headers={}, ) @@ -37581,22 +39071,22 @@ def test_delete_ipsec_policy_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 204 - def test_delete_ipsec_policy_all_params_with_retries(self): - # Enable retries and run test_delete_ipsec_policy_all_params. + def test_delete_security_group_all_params_with_retries(self): + # Enable retries and run test_delete_security_group_all_params. _service.enable_retries() - self.test_delete_ipsec_policy_all_params() + self.test_delete_security_group_all_params() - # Disable retries and run test_delete_ipsec_policy_all_params. + # Disable retries and run test_delete_security_group_all_params. _service.disable_retries() - self.test_delete_ipsec_policy_all_params() + self.test_delete_security_group_all_params() @responses.activate - def test_delete_ipsec_policy_value_error(self): + def test_delete_security_group_value_error(self): """ - test_delete_ipsec_policy_value_error() + test_delete_security_group_value_error() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString') + url = preprocess_url('/security_groups/testString') responses.add( responses.DELETE, url, @@ -37613,31 +39103,31 @@ def test_delete_ipsec_policy_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.delete_ipsec_policy(**req_copy) + _service.delete_security_group(**req_copy) - def test_delete_ipsec_policy_value_error_with_retries(self): - # Enable retries and run test_delete_ipsec_policy_value_error. + def test_delete_security_group_value_error_with_retries(self): + # Enable retries and run test_delete_security_group_value_error. _service.enable_retries() - self.test_delete_ipsec_policy_value_error() + self.test_delete_security_group_value_error() - # Disable retries and run test_delete_ipsec_policy_value_error. + # Disable retries and run test_delete_security_group_value_error. _service.disable_retries() - self.test_delete_ipsec_policy_value_error() + self.test_delete_security_group_value_error() -class TestGetIpsecPolicy: +class TestGetSecurityGroup: """ - Test Class for get_ipsec_policy + Test Class for get_security_group """ @responses.activate - def test_get_ipsec_policy_all_params(self): + def test_get_security_group_all_params(self): """ - get_ipsec_policy() + get_security_group() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString') - mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + url = preprocess_url('/security_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -37650,7 +39140,7 @@ def test_get_ipsec_policy_all_params(self): id = 'testString' # Invoke method - response = _service.get_ipsec_policy( + response = _service.get_security_group( id, headers={}, ) @@ -37659,23 +39149,23 @@ def test_get_ipsec_policy_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_ipsec_policy_all_params_with_retries(self): - # Enable retries and run test_get_ipsec_policy_all_params. + def test_get_security_group_all_params_with_retries(self): + # Enable retries and run test_get_security_group_all_params. _service.enable_retries() - self.test_get_ipsec_policy_all_params() + self.test_get_security_group_all_params() - # Disable retries and run test_get_ipsec_policy_all_params. + # Disable retries and run test_get_security_group_all_params. _service.disable_retries() - self.test_get_ipsec_policy_all_params() + self.test_get_security_group_all_params() @responses.activate - def test_get_ipsec_policy_value_error(self): + def test_get_security_group_value_error(self): """ - test_get_ipsec_policy_value_error() + test_get_security_group_value_error() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString') - mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + url = preprocess_url('/security_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -37694,31 +39184,31 @@ def test_get_ipsec_policy_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_ipsec_policy(**req_copy) + _service.get_security_group(**req_copy) - def test_get_ipsec_policy_value_error_with_retries(self): - # Enable retries and run test_get_ipsec_policy_value_error. + def test_get_security_group_value_error_with_retries(self): + # Enable retries and run test_get_security_group_value_error. _service.enable_retries() - self.test_get_ipsec_policy_value_error() + self.test_get_security_group_value_error() - # Disable retries and run test_get_ipsec_policy_value_error. + # Disable retries and run test_get_security_group_value_error. _service.disable_retries() - self.test_get_ipsec_policy_value_error() + self.test_get_security_group_value_error() -class TestUpdateIpsecPolicy: +class TestUpdateSecurityGroup: """ - Test Class for update_ipsec_policy + Test Class for update_security_group """ @responses.activate - def test_update_ipsec_policy_all_params(self): + def test_update_security_group_all_params(self): """ - update_ipsec_policy() + update_security_group() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString') - mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + url = preprocess_url('/security_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -37727,22 +39217,18 @@ def test_update_ipsec_policy_all_params(self): status=200, ) - # Construct a dict representation of a IPsecPolicyPatch model - i_psec_policy_patch_model = {} - i_psec_policy_patch_model['authentication_algorithm'] = 'disabled' - i_psec_policy_patch_model['encryption_algorithm'] = 'aes128' - i_psec_policy_patch_model['key_lifetime'] = 3600 - i_psec_policy_patch_model['name'] = 'my-ipsec-policy' - i_psec_policy_patch_model['pfs'] = 'disabled' + # Construct a dict representation of a SecurityGroupPatch model + security_group_patch_model = {} + security_group_patch_model['name'] = 'my-security-group' # Set up parameter values id = 'testString' - i_psec_policy_patch = i_psec_policy_patch_model + security_group_patch = security_group_patch_model # Invoke method - response = _service.update_ipsec_policy( + response = _service.update_security_group( id, - i_psec_policy_patch, + security_group_patch, headers={}, ) @@ -37751,25 +39237,25 @@ def test_update_ipsec_policy_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == i_psec_policy_patch + assert req_body == security_group_patch - def test_update_ipsec_policy_all_params_with_retries(self): - # Enable retries and run test_update_ipsec_policy_all_params. + def test_update_security_group_all_params_with_retries(self): + # Enable retries and run test_update_security_group_all_params. _service.enable_retries() - self.test_update_ipsec_policy_all_params() + self.test_update_security_group_all_params() - # Disable retries and run test_update_ipsec_policy_all_params. + # Disable retries and run test_update_security_group_all_params. _service.disable_retries() - self.test_update_ipsec_policy_all_params() + self.test_update_security_group_all_params() @responses.activate - def test_update_ipsec_policy_value_error(self): + def test_update_security_group_value_error(self): """ - test_update_ipsec_policy_value_error() + test_update_security_group_value_error() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString') - mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + url = preprocess_url('/security_groups/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -37778,51 +39264,47 @@ def test_update_ipsec_policy_value_error(self): status=200, ) - # Construct a dict representation of a IPsecPolicyPatch model - i_psec_policy_patch_model = {} - i_psec_policy_patch_model['authentication_algorithm'] = 'disabled' - i_psec_policy_patch_model['encryption_algorithm'] = 'aes128' - i_psec_policy_patch_model['key_lifetime'] = 3600 - i_psec_policy_patch_model['name'] = 'my-ipsec-policy' - i_psec_policy_patch_model['pfs'] = 'disabled' + # Construct a dict representation of a SecurityGroupPatch model + security_group_patch_model = {} + security_group_patch_model['name'] = 'my-security-group' # Set up parameter values id = 'testString' - i_psec_policy_patch = i_psec_policy_patch_model + security_group_patch = security_group_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { "id": id, - "i_psec_policy_patch": i_psec_policy_patch, + "security_group_patch": security_group_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_ipsec_policy(**req_copy) + _service.update_security_group(**req_copy) - def test_update_ipsec_policy_value_error_with_retries(self): - # Enable retries and run test_update_ipsec_policy_value_error. + def test_update_security_group_value_error_with_retries(self): + # Enable retries and run test_update_security_group_value_error. _service.enable_retries() - self.test_update_ipsec_policy_value_error() + self.test_update_security_group_value_error() - # Disable retries and run test_update_ipsec_policy_value_error. + # Disable retries and run test_update_security_group_value_error. _service.disable_retries() - self.test_update_ipsec_policy_value_error() + self.test_update_security_group_value_error() -class TestListIpsecPolicyConnections: +class TestListSecurityGroupRules: """ - Test Class for list_ipsec_policy_connections + Test Class for list_security_group_rules """ @responses.activate - def test_list_ipsec_policy_connections_all_params(self): + def test_list_security_group_rules_all_params(self): """ - list_ipsec_policy_connections() + list_security_group_rules() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?start=250337b8fa72455c962e-c23e5706d452&limit=20"}, "total_count": 132}' + url = preprocess_url('/security_groups/testString/rules') + mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}' responses.add( responses.GET, url, @@ -37832,44 +39314,35 @@ def test_list_ipsec_policy_connections_all_params(self): ) # Set up parameter values - id = 'testString' - start = 'testString' - limit = 50 + security_group_id = 'testString' # Invoke method - response = _service.list_ipsec_policy_connections( - id, - start=start, - limit=limit, + response = _service.list_security_group_rules( + security_group_id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - def test_list_ipsec_policy_connections_all_params_with_retries(self): - # Enable retries and run test_list_ipsec_policy_connections_all_params. + def test_list_security_group_rules_all_params_with_retries(self): + # Enable retries and run test_list_security_group_rules_all_params. _service.enable_retries() - self.test_list_ipsec_policy_connections_all_params() + self.test_list_security_group_rules_all_params() - # Disable retries and run test_list_ipsec_policy_connections_all_params. + # Disable retries and run test_list_security_group_rules_all_params. _service.disable_retries() - self.test_list_ipsec_policy_connections_all_params() + self.test_list_security_group_rules_all_params() @responses.activate - def test_list_ipsec_policy_connections_required_params(self): + def test_list_security_group_rules_value_error(self): """ - test_list_ipsec_policy_connections_required_params() + test_list_security_group_rules_value_error() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?start=250337b8fa72455c962e-c23e5706d452&limit=20"}, "total_count": 132}' + url = preprocess_url('/security_groups/testString/rules') + mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}' responses.add( responses.GET, url, @@ -37879,149 +39352,239 @@ def test_list_ipsec_policy_connections_required_params(self): ) # Set up parameter values - id = 'testString' + security_group_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "security_group_id": security_group_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.list_security_group_rules(**req_copy) + + def test_list_security_group_rules_value_error_with_retries(self): + # Enable retries and run test_list_security_group_rules_value_error. + _service.enable_retries() + self.test_list_security_group_rules_value_error() + + # Disable retries and run test_list_security_group_rules_value_error. + _service.disable_retries() + self.test_list_security_group_rules_value_error() + + +class TestCreateSecurityGroupRule: + """ + Test Class for create_security_group_rule + """ + + @responses.activate + def test_create_security_group_rule_all_params(self): + """ + create_security_group_rule() + """ + # Set up mock + url = preprocess_url('/security_groups/testString/rules') + mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a SecurityGroupRuleLocalPrototypeIP model + security_group_rule_local_prototype_model = {} + security_group_rule_local_prototype_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model + security_group_rule_remote_prototype_model = {} + security_group_rule_remote_prototype_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model + security_group_rule_prototype_model = {} + security_group_rule_prototype_model['direction'] = 'inbound' + security_group_rule_prototype_model['ip_version'] = 'ipv4' + security_group_rule_prototype_model['local'] = security_group_rule_local_prototype_model + security_group_rule_prototype_model['protocol'] = 'all' + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model + + # Set up parameter values + security_group_id = 'testString' + security_group_rule_prototype = security_group_rule_prototype_model # Invoke method - response = _service.list_ipsec_policy_connections( - id, + response = _service.create_security_group_rule( + security_group_id, + security_group_rule_prototype, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == security_group_rule_prototype - def test_list_ipsec_policy_connections_required_params_with_retries(self): - # Enable retries and run test_list_ipsec_policy_connections_required_params. + def test_create_security_group_rule_all_params_with_retries(self): + # Enable retries and run test_create_security_group_rule_all_params. _service.enable_retries() - self.test_list_ipsec_policy_connections_required_params() + self.test_create_security_group_rule_all_params() - # Disable retries and run test_list_ipsec_policy_connections_required_params. + # Disable retries and run test_create_security_group_rule_all_params. _service.disable_retries() - self.test_list_ipsec_policy_connections_required_params() + self.test_create_security_group_rule_all_params() @responses.activate - def test_list_ipsec_policy_connections_value_error(self): + def test_create_security_group_rule_value_error(self): """ - test_list_ipsec_policy_connections_value_error() + test_create_security_group_rule_value_error() """ # Set up mock - url = preprocess_url('/ipsec_policies/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?start=250337b8fa72455c962e-c23e5706d452&limit=20"}, "total_count": 132}' + url = preprocess_url('/security_groups/testString/rules') + mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' responses.add( - responses.GET, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) + # Construct a dict representation of a SecurityGroupRuleLocalPrototypeIP model + security_group_rule_local_prototype_model = {} + security_group_rule_local_prototype_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model + security_group_rule_remote_prototype_model = {} + security_group_rule_remote_prototype_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model + security_group_rule_prototype_model = {} + security_group_rule_prototype_model['direction'] = 'inbound' + security_group_rule_prototype_model['ip_version'] = 'ipv4' + security_group_rule_prototype_model['local'] = security_group_rule_local_prototype_model + security_group_rule_prototype_model['protocol'] = 'all' + security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model + # Set up parameter values - id = 'testString' + security_group_id = 'testString' + security_group_rule_prototype = security_group_rule_prototype_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "id": id, + "security_group_id": security_group_id, + "security_group_rule_prototype": security_group_rule_prototype, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_ipsec_policy_connections(**req_copy) + _service.create_security_group_rule(**req_copy) - def test_list_ipsec_policy_connections_value_error_with_retries(self): - # Enable retries and run test_list_ipsec_policy_connections_value_error. + def test_create_security_group_rule_value_error_with_retries(self): + # Enable retries and run test_create_security_group_rule_value_error. _service.enable_retries() - self.test_list_ipsec_policy_connections_value_error() + self.test_create_security_group_rule_value_error() - # Disable retries and run test_list_ipsec_policy_connections_value_error. + # Disable retries and run test_create_security_group_rule_value_error. _service.disable_retries() - self.test_list_ipsec_policy_connections_value_error() + self.test_create_security_group_rule_value_error() + + +class TestDeleteSecurityGroupRule: + """ + Test Class for delete_security_group_rule + """ @responses.activate - def test_list_ipsec_policy_connections_with_pager_get_next(self): + def test_delete_security_group_rule_all_params(self): """ - test_list_ipsec_policy_connections_with_pager_get_next() + delete_security_group_rule() """ - # Set up a two-page mock response - url = preprocess_url('/ipsec_policies/testString/connections') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) + # Set up mock + url = preprocess_url('/security_groups/testString/rules/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response2, - content_type='application/json', - status=200, + status=204, ) - # Exercise the pager class for this operation - all_results = [] - pager = IpsecPolicyConnectionsPager( - client=_service, - id='testString', - limit=10, + # Set up parameter values + security_group_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.delete_security_group_rule( + security_group_id, + id, + headers={}, ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_delete_security_group_rule_all_params_with_retries(self): + # Enable retries and run test_delete_security_group_rule_all_params. + _service.enable_retries() + self.test_delete_security_group_rule_all_params() + + # Disable retries and run test_delete_security_group_rule_all_params. + _service.disable_retries() + self.test_delete_security_group_rule_all_params() @responses.activate - def test_list_ipsec_policy_connections_with_pager_get_all(self): + def test_delete_security_group_rule_value_error(self): """ - test_list_ipsec_policy_connections_with_pager_get_all() + test_delete_security_group_rule_value_error() """ - # Set up a two-page mock response - url = preprocess_url('/ipsec_policies/testString/connections') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) + # Set up mock + url = preprocess_url('/security_groups/testString/rules/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response2, - content_type='application/json', - status=200, + status=204, ) - # Exercise the pager class for this operation - pager = IpsecPolicyConnectionsPager( - client=_service, - id='testString', - limit=10, - ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + # Set up parameter values + security_group_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "security_group_id": security_group_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.delete_security_group_rule(**req_copy) + def test_delete_security_group_rule_value_error_with_retries(self): + # Enable retries and run test_delete_security_group_rule_value_error. + _service.enable_retries() + self.test_delete_security_group_rule_value_error() -class TestListVpnGateways: + # Disable retries and run test_delete_security_group_rule_value_error. + _service.disable_retries() + self.test_delete_security_group_rule_value_error() + + +class TestGetSecurityGroupRule: """ - Test Class for list_vpn_gateways + Test Class for get_security_group_rule """ @responses.activate - def test_list_vpn_gateways_all_params(self): + def test_get_security_group_rule_all_params(self): """ - list_vpn_gateways() + get_security_group_rule() """ # Set up mock - url = preprocess_url('/vpn_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}' + url = preprocess_url('/security_groups/testString/rules/testString') + mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' responses.add( responses.GET, url, @@ -38031,51 +39594,37 @@ def test_list_vpn_gateways_all_params(self): ) # Set up parameter values - start = 'testString' - limit = 50 - resource_group_id = 'testString' - sort = 'name' - mode = 'policy' + security_group_id = 'testString' + id = 'testString' # Invoke method - response = _service.list_vpn_gateways( - start=start, - limit=limit, - resource_group_id=resource_group_id, - sort=sort, - mode=mode, + response = _service.get_security_group_rule( + security_group_id, + id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'resource_group.id={}'.format(resource_group_id) in query_string - assert 'sort={}'.format(sort) in query_string - assert 'mode={}'.format(mode) in query_string - def test_list_vpn_gateways_all_params_with_retries(self): - # Enable retries and run test_list_vpn_gateways_all_params. + def test_get_security_group_rule_all_params_with_retries(self): + # Enable retries and run test_get_security_group_rule_all_params. _service.enable_retries() - self.test_list_vpn_gateways_all_params() + self.test_get_security_group_rule_all_params() - # Disable retries and run test_list_vpn_gateways_all_params. + # Disable retries and run test_get_security_group_rule_all_params. _service.disable_retries() - self.test_list_vpn_gateways_all_params() + self.test_get_security_group_rule_all_params() @responses.activate - def test_list_vpn_gateways_required_params(self): + def test_get_security_group_rule_value_error(self): """ - test_list_vpn_gateways_required_params() + test_get_security_group_rule_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}' + url = preprocess_url('/security_groups/testString/rules/testString') + mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' responses.add( responses.GET, url, @@ -38084,30 +39633,258 @@ def test_list_vpn_gateways_required_params(self): status=200, ) - # Invoke method - response = _service.list_vpn_gateways() + # Set up parameter values + security_group_id = 'testString' + id = 'testString' - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "security_group_id": security_group_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_security_group_rule(**req_copy) - def test_list_vpn_gateways_required_params_with_retries(self): - # Enable retries and run test_list_vpn_gateways_required_params. + def test_get_security_group_rule_value_error_with_retries(self): + # Enable retries and run test_get_security_group_rule_value_error. _service.enable_retries() - self.test_list_vpn_gateways_required_params() + self.test_get_security_group_rule_value_error() - # Disable retries and run test_list_vpn_gateways_required_params. + # Disable retries and run test_get_security_group_rule_value_error. _service.disable_retries() - self.test_list_vpn_gateways_required_params() + self.test_get_security_group_rule_value_error() + + +class TestUpdateSecurityGroupRule: + """ + Test Class for update_security_group_rule + """ @responses.activate - def test_list_vpn_gateways_value_error(self): + def test_update_security_group_rule_all_params(self): """ - test_list_vpn_gateways_value_error() + update_security_group_rule() """ # Set up mock - url = preprocess_url('/vpn_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}' + url = preprocess_url('/security_groups/testString/rules/testString') + mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a SecurityGroupRuleLocalPatchIP model + security_group_rule_local_patch_model = {} + security_group_rule_local_patch_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRuleRemotePatchCIDR model + security_group_rule_remote_patch_model = {} + security_group_rule_remote_patch_model['cidr_block'] = '10.0.0.0/8' + + # Construct a dict representation of a SecurityGroupRulePatch model + security_group_rule_patch_model = {} + security_group_rule_patch_model['code'] = 0 + security_group_rule_patch_model['direction'] = 'inbound' + security_group_rule_patch_model['ip_version'] = 'ipv4' + security_group_rule_patch_model['local'] = security_group_rule_local_patch_model + security_group_rule_patch_model['port_max'] = 22 + security_group_rule_patch_model['port_min'] = 22 + security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model + security_group_rule_patch_model['type'] = 8 + + # Set up parameter values + security_group_id = 'testString' + id = 'testString' + security_group_rule_patch = security_group_rule_patch_model + + # Invoke method + response = _service.update_security_group_rule( + security_group_id, + id, + security_group_rule_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == security_group_rule_patch + + def test_update_security_group_rule_all_params_with_retries(self): + # Enable retries and run test_update_security_group_rule_all_params. + _service.enable_retries() + self.test_update_security_group_rule_all_params() + + # Disable retries and run test_update_security_group_rule_all_params. + _service.disable_retries() + self.test_update_security_group_rule_all_params() + + @responses.activate + def test_update_security_group_rule_value_error(self): + """ + test_update_security_group_rule_value_error() + """ + # Set up mock + url = preprocess_url('/security_groups/testString/rules/testString') + mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "r006-6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "local": {"address": "192.168.3.4"}, "remote": {"address": "192.168.3.4"}, "protocol": "all"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a SecurityGroupRuleLocalPatchIP model + security_group_rule_local_patch_model = {} + security_group_rule_local_patch_model['address'] = '192.168.3.4' + + # Construct a dict representation of a SecurityGroupRuleRemotePatchCIDR model + security_group_rule_remote_patch_model = {} + security_group_rule_remote_patch_model['cidr_block'] = '10.0.0.0/8' + + # Construct a dict representation of a SecurityGroupRulePatch model + security_group_rule_patch_model = {} + security_group_rule_patch_model['code'] = 0 + security_group_rule_patch_model['direction'] = 'inbound' + security_group_rule_patch_model['ip_version'] = 'ipv4' + security_group_rule_patch_model['local'] = security_group_rule_local_patch_model + security_group_rule_patch_model['port_max'] = 22 + security_group_rule_patch_model['port_min'] = 22 + security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model + security_group_rule_patch_model['type'] = 8 + + # Set up parameter values + security_group_id = 'testString' + id = 'testString' + security_group_rule_patch = security_group_rule_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "security_group_id": security_group_id, + "id": id, + "security_group_rule_patch": security_group_rule_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_security_group_rule(**req_copy) + + def test_update_security_group_rule_value_error_with_retries(self): + # Enable retries and run test_update_security_group_rule_value_error. + _service.enable_retries() + self.test_update_security_group_rule_value_error() + + # Disable retries and run test_update_security_group_rule_value_error. + _service.disable_retries() + self.test_update_security_group_rule_value_error() + + +class TestListSecurityGroupTargets: + """ + Test Class for list_security_group_targets + """ + + @responses.activate + def test_list_security_group_targets_all_params(self): + """ + list_security_group_targets() + """ + # Set up mock + url = preprocess_url('/security_groups/testString/targets') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + security_group_id = 'testString' + start = 'testString' + limit = 50 + + # Invoke method + response = _service.list_security_group_targets( + security_group_id, + start=start, + limit=limit, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + + def test_list_security_group_targets_all_params_with_retries(self): + # Enable retries and run test_list_security_group_targets_all_params. + _service.enable_retries() + self.test_list_security_group_targets_all_params() + + # Disable retries and run test_list_security_group_targets_all_params. + _service.disable_retries() + self.test_list_security_group_targets_all_params() + + @responses.activate + def test_list_security_group_targets_required_params(self): + """ + test_list_security_group_targets_required_params() + """ + # Set up mock + url = preprocess_url('/security_groups/testString/targets') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + security_group_id = 'testString' + + # Invoke method + response = _service.list_security_group_targets( + security_group_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_security_group_targets_required_params_with_retries(self): + # Enable retries and run test_list_security_group_targets_required_params. + _service.enable_retries() + self.test_list_security_group_targets_required_params() + + # Disable retries and run test_list_security_group_targets_required_params. + _service.disable_retries() + self.test_list_security_group_targets_required_params() + + @responses.activate + def test_list_security_group_targets_value_error(self): + """ + test_list_security_group_targets_value_error() + """ + # Set up mock + url = preprocess_url('/security_groups/testString/targets') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' responses.add( responses.GET, url, @@ -38116,32 +39893,36 @@ def test_list_vpn_gateways_value_error(self): status=200, ) + # Set up parameter values + security_group_id = 'testString' + # Pass in all but one required param and check for a ValueError req_param_dict = { + "security_group_id": security_group_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.list_vpn_gateways(**req_copy) + _service.list_security_group_targets(**req_copy) - def test_list_vpn_gateways_value_error_with_retries(self): - # Enable retries and run test_list_vpn_gateways_value_error. + def test_list_security_group_targets_value_error_with_retries(self): + # Enable retries and run test_list_security_group_targets_value_error. _service.enable_retries() - self.test_list_vpn_gateways_value_error() + self.test_list_security_group_targets_value_error() - # Disable retries and run test_list_vpn_gateways_value_error. + # Disable retries and run test_list_security_group_targets_value_error. _service.disable_retries() - self.test_list_vpn_gateways_value_error() + self.test_list_security_group_targets_value_error() @responses.activate - def test_list_vpn_gateways_with_pager_get_next(self): + def test_list_security_group_targets_with_pager_get_next(self): """ - test_list_vpn_gateways_with_pager_get_next() + test_list_security_group_targets_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/vpn_gateways') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}' - mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}' + url = preprocess_url('/security_groups/testString/targets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"}]}' + mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"}]}' responses.add( responses.GET, url, @@ -38159,12 +39940,10 @@ def test_list_vpn_gateways_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = VpnGatewaysPager( + pager = SecurityGroupTargetsPager( client=_service, + security_group_id='testString', limit=10, - resource_group_id='testString', - sort='name', - mode='policy', ) while pager.has_next(): next_page = pager.get_next() @@ -38173,14 +39952,14 @@ def test_list_vpn_gateways_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_vpn_gateways_with_pager_get_all(self): + def test_list_security_group_targets_with_pager_get_all(self): """ - test_list_vpn_gateways_with_pager_get_all() + test_list_security_group_targets_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/vpn_gateways') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}' - mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}' + url = preprocess_url('/security_groups/testString/targets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"}]}' + mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"}]}' responses.add( responses.GET, url, @@ -38197,222 +39976,195 @@ def test_list_vpn_gateways_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = VpnGatewaysPager( + pager = SecurityGroupTargetsPager( client=_service, + security_group_id='testString', limit=10, - resource_group_id='testString', - sort='name', - mode='policy', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateVpnGateway: +class TestDeleteSecurityGroupTargetBinding: """ - Test Class for create_vpn_gateway + Test Class for delete_security_group_target_binding """ @responses.activate - def test_create_vpn_gateway_all_params(self): + def test_delete_security_group_target_binding_all_params(self): """ - create_vpn_gateway() + delete_security_group_target_binding() """ # Set up mock - url = preprocess_url('/vpn_gateways') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' + url = preprocess_url('/security_groups/testString/targets/testString') responses.add( - responses.POST, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=201, + status=204, ) - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a SubnetIdentityById model - subnet_identity_model = {} - subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model - vpn_gateway_prototype_model = {} - vpn_gateway_prototype_model['name'] = 'my-vpn-gateway' - vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model - vpn_gateway_prototype_model['subnet'] = subnet_identity_model - vpn_gateway_prototype_model['mode'] = 'route' - # Set up parameter values - vpn_gateway_prototype = vpn_gateway_prototype_model + security_group_id = 'testString' + id = 'testString' # Invoke method - response = _service.create_vpn_gateway( - vpn_gateway_prototype, + response = _service.delete_security_group_target_binding( + security_group_id, + id, 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 == vpn_gateway_prototype + assert response.status_code == 204 - def test_create_vpn_gateway_all_params_with_retries(self): - # Enable retries and run test_create_vpn_gateway_all_params. + def test_delete_security_group_target_binding_all_params_with_retries(self): + # Enable retries and run test_delete_security_group_target_binding_all_params. _service.enable_retries() - self.test_create_vpn_gateway_all_params() + self.test_delete_security_group_target_binding_all_params() - # Disable retries and run test_create_vpn_gateway_all_params. + # Disable retries and run test_delete_security_group_target_binding_all_params. _service.disable_retries() - self.test_create_vpn_gateway_all_params() + self.test_delete_security_group_target_binding_all_params() @responses.activate - def test_create_vpn_gateway_value_error(self): + def test_delete_security_group_target_binding_value_error(self): """ - test_create_vpn_gateway_value_error() + test_delete_security_group_target_binding_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' + url = preprocess_url('/security_groups/testString/targets/testString') responses.add( - responses.POST, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=201, + status=204, ) - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a SubnetIdentityById model - subnet_identity_model = {} - subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model - vpn_gateway_prototype_model = {} - vpn_gateway_prototype_model['name'] = 'my-vpn-gateway' - vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model - vpn_gateway_prototype_model['subnet'] = subnet_identity_model - vpn_gateway_prototype_model['mode'] = 'route' - # Set up parameter values - vpn_gateway_prototype = vpn_gateway_prototype_model + security_group_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_prototype": vpn_gateway_prototype, + "security_group_id": security_group_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.create_vpn_gateway(**req_copy) + _service.delete_security_group_target_binding(**req_copy) - def test_create_vpn_gateway_value_error_with_retries(self): - # Enable retries and run test_create_vpn_gateway_value_error. + def test_delete_security_group_target_binding_value_error_with_retries(self): + # Enable retries and run test_delete_security_group_target_binding_value_error. _service.enable_retries() - self.test_create_vpn_gateway_value_error() + self.test_delete_security_group_target_binding_value_error() - # Disable retries and run test_create_vpn_gateway_value_error. + # Disable retries and run test_delete_security_group_target_binding_value_error. _service.disable_retries() - self.test_create_vpn_gateway_value_error() + self.test_delete_security_group_target_binding_value_error() -class TestDeleteVpnGateway: +class TestGetSecurityGroupTarget: """ - Test Class for delete_vpn_gateway + Test Class for get_security_group_target """ @responses.activate - def test_delete_vpn_gateway_all_params(self): + def test_get_security_group_target_all_params(self): """ - delete_vpn_gateway() + get_security_group_target() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString') + url = preprocess_url('/security_groups/testString/targets/testString') + mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}' responses.add( - responses.DELETE, + responses.GET, url, - status=202, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values + security_group_id = 'testString' id = 'testString' # Invoke method - response = _service.delete_vpn_gateway( + response = _service.get_security_group_target( + security_group_id, id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 202 + assert response.status_code == 200 - def test_delete_vpn_gateway_all_params_with_retries(self): - # Enable retries and run test_delete_vpn_gateway_all_params. + def test_get_security_group_target_all_params_with_retries(self): + # Enable retries and run test_get_security_group_target_all_params. _service.enable_retries() - self.test_delete_vpn_gateway_all_params() + self.test_get_security_group_target_all_params() - # Disable retries and run test_delete_vpn_gateway_all_params. + # Disable retries and run test_get_security_group_target_all_params. _service.disable_retries() - self.test_delete_vpn_gateway_all_params() + self.test_get_security_group_target_all_params() @responses.activate - def test_delete_vpn_gateway_value_error(self): + def test_get_security_group_target_value_error(self): """ - test_delete_vpn_gateway_value_error() + test_get_security_group_target_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString') + url = preprocess_url('/security_groups/testString/targets/testString') + mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}' responses.add( - responses.DELETE, + responses.GET, url, - status=202, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values + security_group_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "security_group_id": security_group_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.delete_vpn_gateway(**req_copy) + _service.get_security_group_target(**req_copy) - def test_delete_vpn_gateway_value_error_with_retries(self): - # Enable retries and run test_delete_vpn_gateway_value_error. + def test_get_security_group_target_value_error_with_retries(self): + # Enable retries and run test_get_security_group_target_value_error. _service.enable_retries() - self.test_delete_vpn_gateway_value_error() + self.test_get_security_group_target_value_error() - # Disable retries and run test_delete_vpn_gateway_value_error. + # Disable retries and run test_get_security_group_target_value_error. _service.disable_retries() - self.test_delete_vpn_gateway_value_error() + self.test_get_security_group_target_value_error() -class TestGetVpnGateway: +class TestCreateSecurityGroupTargetBinding: """ - Test Class for get_vpn_gateway + Test Class for create_security_group_target_binding """ @responses.activate - def test_get_vpn_gateway_all_params(self): + def test_create_security_group_target_binding_all_params(self): """ - get_vpn_gateway() + create_security_group_target_binding() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' + url = preprocess_url('/security_groups/testString/targets/testString') + mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}' responses.add( - responses.GET, + responses.PUT, url, body=mock_response, content_type='application/json', @@ -38420,10 +40172,12 @@ def test_get_vpn_gateway_all_params(self): ) # Set up parameter values + security_group_id = 'testString' id = 'testString' # Invoke method - response = _service.get_vpn_gateway( + response = _service.create_security_group_target_binding( + security_group_id, id, headers={}, ) @@ -38432,25 +40186,25 @@ def test_get_vpn_gateway_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_vpn_gateway_all_params_with_retries(self): - # Enable retries and run test_get_vpn_gateway_all_params. + def test_create_security_group_target_binding_all_params_with_retries(self): + # Enable retries and run test_create_security_group_target_binding_all_params. _service.enable_retries() - self.test_get_vpn_gateway_all_params() + self.test_create_security_group_target_binding_all_params() - # Disable retries and run test_get_vpn_gateway_all_params. + # Disable retries and run test_create_security_group_target_binding_all_params. _service.disable_retries() - self.test_get_vpn_gateway_all_params() + self.test_create_security_group_target_binding_all_params() @responses.activate - def test_get_vpn_gateway_value_error(self): + def test_create_security_group_target_binding_value_error(self): """ - test_get_vpn_gateway_value_error() + test_create_security_group_target_binding_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' + url = preprocess_url('/security_groups/testString/targets/testString') + mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}' responses.add( - responses.GET, + responses.PUT, url, body=mock_response, content_type='application/json', @@ -38458,136 +40212,99 @@ def test_get_vpn_gateway_value_error(self): ) # Set up parameter values + security_group_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "security_group_id": security_group_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_vpn_gateway(**req_copy) + _service.create_security_group_target_binding(**req_copy) - def test_get_vpn_gateway_value_error_with_retries(self): - # Enable retries and run test_get_vpn_gateway_value_error. + def test_create_security_group_target_binding_value_error_with_retries(self): + # Enable retries and run test_create_security_group_target_binding_value_error. _service.enable_retries() - self.test_get_vpn_gateway_value_error() + self.test_create_security_group_target_binding_value_error() - # Disable retries and run test_get_vpn_gateway_value_error. + # Disable retries and run test_create_security_group_target_binding_value_error. _service.disable_retries() - self.test_get_vpn_gateway_value_error() + self.test_create_security_group_target_binding_value_error() -class TestUpdateVpnGateway: +# endregion +############################################################################## +# End of Service: SecurityGroups +############################################################################## + +############################################################################## +# Start of Service: VPNGateways +############################################################################## +# region + + +class TestNewInstance: """ - Test Class for update_vpn_gateway + Test Class for new_instance """ - @responses.activate - def test_update_vpn_gateway_all_params(self): + def test_new_instance(self): """ - update_vpn_gateway() + new_instance() """ - # Set up mock - url = preprocess_url('/vpn_gateways/testString') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' - responses.add( - responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200, - ) + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - # Construct a dict representation of a VPNGatewayPatch model - vpn_gateway_patch_model = {} - vpn_gateway_patch_model['name'] = 'my-vpn-gateway' - - # Set up parameter values - id = 'testString' - vpn_gateway_patch = vpn_gateway_patch_model - - # Invoke method - response = _service.update_vpn_gateway( - id, - vpn_gateway_patch, - headers={}, + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', ) - # 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 == vpn_gateway_patch - - def test_update_vpn_gateway_all_params_with_retries(self): - # Enable retries and run test_update_vpn_gateway_all_params. - _service.enable_retries() - self.test_update_vpn_gateway_all_params() - - # Disable retries and run test_update_vpn_gateway_all_params. - _service.disable_retries() - self.test_update_vpn_gateway_all_params() + assert service is not None + assert isinstance(service, VpcV1) - @responses.activate - def test_update_vpn_gateway_value_error(self): + def test_new_instance_without_authenticator(self): """ - test_update_vpn_gateway_value_error() + new_instance_without_authenticator() """ - # Set up mock - url = preprocess_url('/vpn_gateways/testString') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' - responses.add( - responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Construct a dict representation of a VPNGatewayPatch model - vpn_gateway_patch_model = {} - vpn_gateway_patch_model['name'] = 'my-vpn-gateway' - - # Set up parameter values - id = 'testString' - vpn_gateway_patch = vpn_gateway_patch_model - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "id": id, - "vpn_gateway_patch": vpn_gateway_patch, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.update_vpn_gateway(**req_copy) + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) - def test_update_vpn_gateway_value_error_with_retries(self): - # Enable retries and run test_update_vpn_gateway_value_error. - _service.enable_retries() - self.test_update_vpn_gateway_value_error() + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() - # Disable retries and run test_update_vpn_gateway_value_error. - _service.disable_retries() - self.test_update_vpn_gateway_value_error() + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) -class TestListVpnGatewayConnections: +class TestListIkePolicies: """ - Test Class for list_vpn_gateway_connections + Test Class for list_ike_policies """ @responses.activate - def test_list_vpn_gateway_connections_all_params(self): + def test_list_ike_policies_all_params(self): """ - list_vpn_gateway_connections() + list_ike_policies() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?start=b67efb2c-bd17-457d-be8e-7b46404062dc&limit=20"}, "total_count": 132}' + url = preprocess_url('/ike_policies') + mock_response = '{"first": {"href": "href"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -38597,17 +40314,13 @@ def test_list_vpn_gateway_connections_all_params(self): ) # Set up parameter values - vpn_gateway_id = 'testString' start = 'testString' limit = 50 - status = 'down' # Invoke method - response = _service.list_vpn_gateway_connections( - vpn_gateway_id, + response = _service.list_ike_policies( start=start, limit=limit, - status=status, headers={}, ) @@ -38619,25 +40332,24 @@ def test_list_vpn_gateway_connections_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string - assert 'status={}'.format(status) in query_string - def test_list_vpn_gateway_connections_all_params_with_retries(self): - # Enable retries and run test_list_vpn_gateway_connections_all_params. + def test_list_ike_policies_all_params_with_retries(self): + # Enable retries and run test_list_ike_policies_all_params. _service.enable_retries() - self.test_list_vpn_gateway_connections_all_params() + self.test_list_ike_policies_all_params() - # Disable retries and run test_list_vpn_gateway_connections_all_params. + # Disable retries and run test_list_ike_policies_all_params. _service.disable_retries() - self.test_list_vpn_gateway_connections_all_params() + self.test_list_ike_policies_all_params() @responses.activate - def test_list_vpn_gateway_connections_required_params(self): + def test_list_ike_policies_required_params(self): """ - test_list_vpn_gateway_connections_required_params() + test_list_ike_policies_required_params() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?start=b67efb2c-bd17-457d-be8e-7b46404062dc&limit=20"}, "total_count": 132}' + url = preprocess_url('/ike_policies') + mock_response = '{"first": {"href": "href"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -38646,36 +40358,30 @@ def test_list_vpn_gateway_connections_required_params(self): status=200, ) - # Set up parameter values - vpn_gateway_id = 'testString' - # Invoke method - response = _service.list_vpn_gateway_connections( - vpn_gateway_id, - headers={}, - ) + response = _service.list_ike_policies() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_vpn_gateway_connections_required_params_with_retries(self): - # Enable retries and run test_list_vpn_gateway_connections_required_params. + def test_list_ike_policies_required_params_with_retries(self): + # Enable retries and run test_list_ike_policies_required_params. _service.enable_retries() - self.test_list_vpn_gateway_connections_required_params() + self.test_list_ike_policies_required_params() - # Disable retries and run test_list_vpn_gateway_connections_required_params. + # Disable retries and run test_list_ike_policies_required_params. _service.disable_retries() - self.test_list_vpn_gateway_connections_required_params() + self.test_list_ike_policies_required_params() @responses.activate - def test_list_vpn_gateway_connections_value_error(self): + def test_list_ike_policies_value_error(self): """ - test_list_vpn_gateway_connections_value_error() + test_list_ike_policies_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections') - mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?start=b67efb2c-bd17-457d-be8e-7b46404062dc&limit=20"}, "total_count": 132}' + url = preprocess_url('/ike_policies') + mock_response = '{"first": {"href": "href"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -38684,36 +40390,32 @@ def test_list_vpn_gateway_connections_value_error(self): status=200, ) - # Set up parameter values - vpn_gateway_id = 'testString' - # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_gateway_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.list_vpn_gateway_connections(**req_copy) + _service.list_ike_policies(**req_copy) - def test_list_vpn_gateway_connections_value_error_with_retries(self): - # Enable retries and run test_list_vpn_gateway_connections_value_error. + def test_list_ike_policies_value_error_with_retries(self): + # Enable retries and run test_list_ike_policies_value_error. _service.enable_retries() - self.test_list_vpn_gateway_connections_value_error() + self.test_list_ike_policies_value_error() - # Disable retries and run test_list_vpn_gateway_connections_value_error. + # Disable retries and run test_list_ike_policies_value_error. _service.disable_retries() - self.test_list_vpn_gateway_connections_value_error() + self.test_list_ike_policies_value_error() @responses.activate - def test_list_vpn_gateway_connections_with_pager_get_next(self): + def test_list_ike_policies_with_pager_get_next(self): """ - test_list_vpn_gateway_connections_with_pager_get_next() + test_list_ike_policies_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/vpn_gateways/testString/connections') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' + url = preprocess_url('/ike_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' + mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' responses.add( responses.GET, url, @@ -38731,11 +40433,9 @@ def test_list_vpn_gateway_connections_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = VpnGatewayConnectionsPager( + pager = IkePoliciesPager( client=_service, - vpn_gateway_id='testString', limit=10, - status='down', ) while pager.has_next(): next_page = pager.get_next() @@ -38744,14 +40444,14 @@ def test_list_vpn_gateway_connections_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_vpn_gateway_connections_with_pager_get_all(self): + def test_list_ike_policies_with_pager_get_all(self): """ - test_list_vpn_gateway_connections_with_pager_get_all() + test_list_ike_policies_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/vpn_gateways/testString/connections') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' - mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' + url = preprocess_url('/ike_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' + mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' responses.add( responses.GET, url, @@ -38768,30 +40468,28 @@ def test_list_vpn_gateway_connections_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = VpnGatewayConnectionsPager( + pager = IkePoliciesPager( client=_service, - vpn_gateway_id='testString', limit=10, - status='down', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateVpnGatewayConnection: +class TestCreateIkePolicy: """ - Test Class for create_vpn_gateway_connection + Test Class for create_ike_policy """ @responses.activate - def test_create_vpn_gateway_connection_all_params(self): + def test_create_ike_policy_all_params(self): """ - create_vpn_gateway_connection() + create_ike_policy() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections') - mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' + url = preprocess_url('/ike_policies') + mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add( responses.POST, url, @@ -38800,56 +40498,28 @@ def test_create_vpn_gateway_connection_all_params(self): status=201, ) - # Construct a dict representation of a VPNGatewayConnectionDPDPrototype model - vpn_gateway_connection_dpd_prototype_model = {} - vpn_gateway_connection_dpd_prototype_model['action'] = 'restart' - vpn_gateway_connection_dpd_prototype_model['interval'] = 30 - vpn_gateway_connection_dpd_prototype_model['timeout'] = 120 - - # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model - vpn_gateway_connection_ike_policy_prototype_model = {} - vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - - # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model - vpn_gateway_connection_i_psec_policy_prototype_model = {} - vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - - # Construct a dict representation of a VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN model - vpn_gateway_connection_ike_identity_prototype_model = {} - vpn_gateway_connection_ike_identity_prototype_model['type'] = 'fqdn' - vpn_gateway_connection_ike_identity_prototype_model['value'] = 'my-service.example.com' - - # Construct a dict representation of a VPNGatewayConnectionStaticRouteModeLocalPrototype model - vpn_gateway_connection_static_route_mode_local_prototype_model = {} - vpn_gateway_connection_static_route_mode_local_prototype_model['ike_identities'] = [vpn_gateway_connection_ike_identity_prototype_model] - - # Construct a dict representation of a VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model - vpn_gateway_connection_static_route_mode_peer_prototype_model = {} - vpn_gateway_connection_static_route_mode_peer_prototype_model['ike_identity'] = vpn_gateway_connection_ike_identity_prototype_model - vpn_gateway_connection_static_route_mode_peer_prototype_model['address'] = '169.21.50.5' - - # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model - vpn_gateway_connection_prototype_model = {} - vpn_gateway_connection_prototype_model['admin_state_up'] = True - vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_prototype_model['establish_mode'] = 'bidirectional' - vpn_gateway_connection_prototype_model['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model - vpn_gateway_connection_prototype_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model - vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso' - vpn_gateway_connection_prototype_model['distribute_traffic'] = False - vpn_gateway_connection_prototype_model['local'] = vpn_gateway_connection_static_route_mode_local_prototype_model - vpn_gateway_connection_prototype_model['peer'] = vpn_gateway_connection_static_route_mode_peer_prototype_model - vpn_gateway_connection_prototype_model['routing_protocol'] = 'none' + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - vpn_gateway_id = 'testString' - vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model + authentication_algorithm = 'sha256' + dh_group = 14 + encryption_algorithm = 'aes128' + ike_version = 1 + key_lifetime = 28800 + name = 'my-ike-policy' + resource_group = resource_group_identity_model # Invoke method - response = _service.create_vpn_gateway_connection( - vpn_gateway_id, - vpn_gateway_connection_prototype, + response = _service.create_ike_policy( + authentication_algorithm, + dh_group, + encryption_algorithm, + ike_version, + key_lifetime=key_lifetime, + name=name, + resource_group=resource_group, headers={}, ) @@ -38858,25 +40528,31 @@ def test_create_vpn_gateway_connection_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == vpn_gateway_connection_prototype + assert req_body['authentication_algorithm'] == 'sha256' + assert req_body['dh_group'] == 14 + assert req_body['encryption_algorithm'] == 'aes128' + assert req_body['ike_version'] == 1 + assert req_body['key_lifetime'] == 28800 + assert req_body['name'] == 'my-ike-policy' + assert req_body['resource_group'] == resource_group_identity_model - def test_create_vpn_gateway_connection_all_params_with_retries(self): - # Enable retries and run test_create_vpn_gateway_connection_all_params. + def test_create_ike_policy_all_params_with_retries(self): + # Enable retries and run test_create_ike_policy_all_params. _service.enable_retries() - self.test_create_vpn_gateway_connection_all_params() + self.test_create_ike_policy_all_params() - # Disable retries and run test_create_vpn_gateway_connection_all_params. + # Disable retries and run test_create_ike_policy_all_params. _service.disable_retries() - self.test_create_vpn_gateway_connection_all_params() + self.test_create_ike_policy_all_params() @responses.activate - def test_create_vpn_gateway_connection_value_error(self): + def test_create_ike_policy_value_error(self): """ - test_create_vpn_gateway_connection_value_error() + test_create_ike_policy_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections') - mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' + url = preprocess_url('/ike_policies') + mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add( responses.POST, url, @@ -38885,164 +40561,129 @@ def test_create_vpn_gateway_connection_value_error(self): status=201, ) - # Construct a dict representation of a VPNGatewayConnectionDPDPrototype model - vpn_gateway_connection_dpd_prototype_model = {} - vpn_gateway_connection_dpd_prototype_model['action'] = 'restart' - vpn_gateway_connection_dpd_prototype_model['interval'] = 30 - vpn_gateway_connection_dpd_prototype_model['timeout'] = 120 - - # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model - vpn_gateway_connection_ike_policy_prototype_model = {} - vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - - # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model - vpn_gateway_connection_i_psec_policy_prototype_model = {} - vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - - # Construct a dict representation of a VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN model - vpn_gateway_connection_ike_identity_prototype_model = {} - vpn_gateway_connection_ike_identity_prototype_model['type'] = 'fqdn' - vpn_gateway_connection_ike_identity_prototype_model['value'] = 'my-service.example.com' - - # Construct a dict representation of a VPNGatewayConnectionStaticRouteModeLocalPrototype model - vpn_gateway_connection_static_route_mode_local_prototype_model = {} - vpn_gateway_connection_static_route_mode_local_prototype_model['ike_identities'] = [vpn_gateway_connection_ike_identity_prototype_model] - - # Construct a dict representation of a VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model - vpn_gateway_connection_static_route_mode_peer_prototype_model = {} - vpn_gateway_connection_static_route_mode_peer_prototype_model['ike_identity'] = vpn_gateway_connection_ike_identity_prototype_model - vpn_gateway_connection_static_route_mode_peer_prototype_model['address'] = '169.21.50.5' - - # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model - vpn_gateway_connection_prototype_model = {} - vpn_gateway_connection_prototype_model['admin_state_up'] = True - vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model - vpn_gateway_connection_prototype_model['establish_mode'] = 'bidirectional' - vpn_gateway_connection_prototype_model['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model - vpn_gateway_connection_prototype_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model - vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso' - vpn_gateway_connection_prototype_model['distribute_traffic'] = False - vpn_gateway_connection_prototype_model['local'] = vpn_gateway_connection_static_route_mode_local_prototype_model - vpn_gateway_connection_prototype_model['peer'] = vpn_gateway_connection_static_route_mode_peer_prototype_model - vpn_gateway_connection_prototype_model['routing_protocol'] = 'none' + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - vpn_gateway_id = 'testString' - vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model + authentication_algorithm = 'sha256' + dh_group = 14 + encryption_algorithm = 'aes128' + ike_version = 1 + key_lifetime = 28800 + name = 'my-ike-policy' + resource_group = resource_group_identity_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_gateway_id, - "vpn_gateway_connection_prototype": vpn_gateway_connection_prototype, + "authentication_algorithm": authentication_algorithm, + "dh_group": dh_group, + "encryption_algorithm": encryption_algorithm, + "ike_version": ike_version, } 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_vpn_gateway_connection(**req_copy) + _service.create_ike_policy(**req_copy) - def test_create_vpn_gateway_connection_value_error_with_retries(self): - # Enable retries and run test_create_vpn_gateway_connection_value_error. + def test_create_ike_policy_value_error_with_retries(self): + # Enable retries and run test_create_ike_policy_value_error. _service.enable_retries() - self.test_create_vpn_gateway_connection_value_error() + self.test_create_ike_policy_value_error() - # Disable retries and run test_create_vpn_gateway_connection_value_error. + # Disable retries and run test_create_ike_policy_value_error. _service.disable_retries() - self.test_create_vpn_gateway_connection_value_error() + self.test_create_ike_policy_value_error() -class TestDeleteVpnGatewayConnection: +class TestDeleteIkePolicy: """ - Test Class for delete_vpn_gateway_connection + Test Class for delete_ike_policy """ @responses.activate - def test_delete_vpn_gateway_connection_all_params(self): + def test_delete_ike_policy_all_params(self): """ - delete_vpn_gateway_connection() + delete_ike_policy() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString') + url = preprocess_url('/ike_policies/testString') responses.add( responses.DELETE, url, - status=202, + status=204, ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' # Invoke method - response = _service.delete_vpn_gateway_connection( - vpn_gateway_id, + response = _service.delete_ike_policy( id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 202 + assert response.status_code == 204 - def test_delete_vpn_gateway_connection_all_params_with_retries(self): - # Enable retries and run test_delete_vpn_gateway_connection_all_params. + def test_delete_ike_policy_all_params_with_retries(self): + # Enable retries and run test_delete_ike_policy_all_params. _service.enable_retries() - self.test_delete_vpn_gateway_connection_all_params() + self.test_delete_ike_policy_all_params() - # Disable retries and run test_delete_vpn_gateway_connection_all_params. + # Disable retries and run test_delete_ike_policy_all_params. _service.disable_retries() - self.test_delete_vpn_gateway_connection_all_params() + self.test_delete_ike_policy_all_params() @responses.activate - def test_delete_vpn_gateway_connection_value_error(self): + def test_delete_ike_policy_value_error(self): """ - test_delete_vpn_gateway_connection_value_error() + test_delete_ike_policy_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString') + url = preprocess_url('/ike_policies/testString') responses.add( responses.DELETE, url, - status=202, + status=204, ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_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.delete_vpn_gateway_connection(**req_copy) + _service.delete_ike_policy(**req_copy) - def test_delete_vpn_gateway_connection_value_error_with_retries(self): - # Enable retries and run test_delete_vpn_gateway_connection_value_error. + def test_delete_ike_policy_value_error_with_retries(self): + # Enable retries and run test_delete_ike_policy_value_error. _service.enable_retries() - self.test_delete_vpn_gateway_connection_value_error() + self.test_delete_ike_policy_value_error() - # Disable retries and run test_delete_vpn_gateway_connection_value_error. + # Disable retries and run test_delete_ike_policy_value_error. _service.disable_retries() - self.test_delete_vpn_gateway_connection_value_error() + self.test_delete_ike_policy_value_error() -class TestGetVpnGatewayConnection: +class TestGetIkePolicy: """ - Test Class for get_vpn_gateway_connection + Test Class for get_ike_policy """ @responses.activate - def test_get_vpn_gateway_connection_all_params(self): + def test_get_ike_policy_all_params(self): """ - get_vpn_gateway_connection() + get_ike_policy() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString') - mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' + url = preprocess_url('/ike_policies/testString') + mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add( responses.GET, url, @@ -39052,12 +40693,10 @@ def test_get_vpn_gateway_connection_all_params(self): ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' # Invoke method - response = _service.get_vpn_gateway_connection( - vpn_gateway_id, + response = _service.get_ike_policy( id, headers={}, ) @@ -39066,23 +40705,23 @@ def test_get_vpn_gateway_connection_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_vpn_gateway_connection_all_params_with_retries(self): - # Enable retries and run test_get_vpn_gateway_connection_all_params. + def test_get_ike_policy_all_params_with_retries(self): + # Enable retries and run test_get_ike_policy_all_params. _service.enable_retries() - self.test_get_vpn_gateway_connection_all_params() + self.test_get_ike_policy_all_params() - # Disable retries and run test_get_vpn_gateway_connection_all_params. + # Disable retries and run test_get_ike_policy_all_params. _service.disable_retries() - self.test_get_vpn_gateway_connection_all_params() + self.test_get_ike_policy_all_params() @responses.activate - def test_get_vpn_gateway_connection_value_error(self): + def test_get_ike_policy_value_error(self): """ - test_get_vpn_gateway_connection_value_error() + test_get_ike_policy_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString') - mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' + url = preprocess_url('/ike_policies/testString') + mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add( responses.GET, url, @@ -39092,42 +40731,40 @@ def test_get_vpn_gateway_connection_value_error(self): ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_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_vpn_gateway_connection(**req_copy) + _service.get_ike_policy(**req_copy) - def test_get_vpn_gateway_connection_value_error_with_retries(self): - # Enable retries and run test_get_vpn_gateway_connection_value_error. + def test_get_ike_policy_value_error_with_retries(self): + # Enable retries and run test_get_ike_policy_value_error. _service.enable_retries() - self.test_get_vpn_gateway_connection_value_error() + self.test_get_ike_policy_value_error() - # Disable retries and run test_get_vpn_gateway_connection_value_error. + # Disable retries and run test_get_ike_policy_value_error. _service.disable_retries() - self.test_get_vpn_gateway_connection_value_error() + self.test_get_ike_policy_value_error() -class TestUpdateVpnGatewayConnection: +class TestUpdateIkePolicy: """ - Test Class for update_vpn_gateway_connection + Test Class for update_ike_policy """ @responses.activate - def test_update_vpn_gateway_connection_all_params(self): + def test_update_ike_policy_all_params(self): """ - update_vpn_gateway_connection() + update_ike_policy() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString') - mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' + url = preprocess_url('/ike_policies/testString') + mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add( responses.PATCH, url, @@ -39136,73 +40773,50 @@ def test_update_vpn_gateway_connection_all_params(self): status=200, ) - # Construct a dict representation of a VPNGatewayConnectionDPDPatch model - vpn_gateway_connection_dpd_patch_model = {} - vpn_gateway_connection_dpd_patch_model['action'] = 'restart' - vpn_gateway_connection_dpd_patch_model['interval'] = 30 - vpn_gateway_connection_dpd_patch_model['timeout'] = 120 - - # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model - vpn_gateway_connection_ike_policy_patch_model = {} - vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + # Construct a dict representation of a IKEPolicyPatch model + ike_policy_patch_model = {} + ike_policy_patch_model['authentication_algorithm'] = 'sha256' + ike_policy_patch_model['dh_group'] = 14 + ike_policy_patch_model['encryption_algorithm'] = 'aes128' + ike_policy_patch_model['ike_version'] = 1 + ike_policy_patch_model['key_lifetime'] = 28800 + ike_policy_patch_model['name'] = 'my-ike-policy' - # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model - vpn_gateway_connection_i_psec_policy_patch_model = {} - vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + # Set up parameter values + id = 'testString' + ike_policy_patch = ike_policy_patch_model - # Construct a dict representation of a VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model - vpn_gateway_connection_peer_patch_model = {} - vpn_gateway_connection_peer_patch_model['address'] = '169.21.50.5' - - # Construct a dict representation of a VPNGatewayConnectionPatch model - vpn_gateway_connection_patch_model = {} - vpn_gateway_connection_patch_model['admin_state_up'] = True - vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model - vpn_gateway_connection_patch_model['distribute_traffic'] = True - vpn_gateway_connection_patch_model['establish_mode'] = 'bidirectional' - vpn_gateway_connection_patch_model['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model - vpn_gateway_connection_patch_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model - vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_patch_model['peer'] = vpn_gateway_connection_peer_patch_model - vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso' - - # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - vpn_gateway_connection_patch = vpn_gateway_connection_patch_model - - # Invoke method - response = _service.update_vpn_gateway_connection( - vpn_gateway_id, - id, - vpn_gateway_connection_patch, - headers={}, - ) + # Invoke method + response = _service.update_ike_policy( + id, + ike_policy_patch, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == vpn_gateway_connection_patch + assert req_body == ike_policy_patch - def test_update_vpn_gateway_connection_all_params_with_retries(self): - # Enable retries and run test_update_vpn_gateway_connection_all_params. + def test_update_ike_policy_all_params_with_retries(self): + # Enable retries and run test_update_ike_policy_all_params. _service.enable_retries() - self.test_update_vpn_gateway_connection_all_params() + self.test_update_ike_policy_all_params() - # Disable retries and run test_update_vpn_gateway_connection_all_params. + # Disable retries and run test_update_ike_policy_all_params. _service.disable_retries() - self.test_update_vpn_gateway_connection_all_params() + self.test_update_ike_policy_all_params() @responses.activate - def test_update_vpn_gateway_connection_value_error(self): + def test_update_ike_policy_value_error(self): """ - test_update_vpn_gateway_connection_value_error() + test_update_ike_policy_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString') - mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' + url = preprocess_url('/ike_policies/testString') + mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}' responses.add( responses.PATCH, url, @@ -39211,75 +40825,52 @@ def test_update_vpn_gateway_connection_value_error(self): status=200, ) - # Construct a dict representation of a VPNGatewayConnectionDPDPatch model - vpn_gateway_connection_dpd_patch_model = {} - vpn_gateway_connection_dpd_patch_model['action'] = 'restart' - vpn_gateway_connection_dpd_patch_model['interval'] = 30 - vpn_gateway_connection_dpd_patch_model['timeout'] = 120 - - # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model - vpn_gateway_connection_ike_policy_patch_model = {} - vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - - # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model - vpn_gateway_connection_i_psec_policy_patch_model = {} - vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - - # Construct a dict representation of a VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model - vpn_gateway_connection_peer_patch_model = {} - vpn_gateway_connection_peer_patch_model['address'] = '169.21.50.5' - - # Construct a dict representation of a VPNGatewayConnectionPatch model - vpn_gateway_connection_patch_model = {} - vpn_gateway_connection_patch_model['admin_state_up'] = True - vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model - vpn_gateway_connection_patch_model['distribute_traffic'] = True - vpn_gateway_connection_patch_model['establish_mode'] = 'bidirectional' - vpn_gateway_connection_patch_model['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model - vpn_gateway_connection_patch_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model - vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection' - vpn_gateway_connection_patch_model['peer'] = vpn_gateway_connection_peer_patch_model - vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso' + # Construct a dict representation of a IKEPolicyPatch model + ike_policy_patch_model = {} + ike_policy_patch_model['authentication_algorithm'] = 'sha256' + ike_policy_patch_model['dh_group'] = 14 + ike_policy_patch_model['encryption_algorithm'] = 'aes128' + ike_policy_patch_model['ike_version'] = 1 + ike_policy_patch_model['key_lifetime'] = 28800 + ike_policy_patch_model['name'] = 'my-ike-policy' # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' - vpn_gateway_connection_patch = vpn_gateway_connection_patch_model + ike_policy_patch = ike_policy_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_gateway_id, "id": id, - "vpn_gateway_connection_patch": vpn_gateway_connection_patch, + "ike_policy_patch": ike_policy_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_vpn_gateway_connection(**req_copy) + _service.update_ike_policy(**req_copy) - def test_update_vpn_gateway_connection_value_error_with_retries(self): - # Enable retries and run test_update_vpn_gateway_connection_value_error. + def test_update_ike_policy_value_error_with_retries(self): + # Enable retries and run test_update_ike_policy_value_error. _service.enable_retries() - self.test_update_vpn_gateway_connection_value_error() + self.test_update_ike_policy_value_error() - # Disable retries and run test_update_vpn_gateway_connection_value_error. + # Disable retries and run test_update_ike_policy_value_error. _service.disable_retries() - self.test_update_vpn_gateway_connection_value_error() + self.test_update_ike_policy_value_error() -class TestListVpnGatewayConnectionsLocalCidrs: +class TestListIkePolicyConnections: """ - Test Class for list_vpn_gateway_connections_local_cidrs + Test Class for list_ike_policy_connections """ @responses.activate - def test_list_vpn_gateway_connections_local_cidrs_all_params(self): + def test_list_ike_policy_connections_all_params(self): """ - list_vpn_gateway_connections_local_cidrs() + list_ike_policy_connections() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs') - mock_response = '{"cidrs": ["192.168.1.0/24"]}' + url = preprocess_url('/ike_policies/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -39289,37 +40880,44 @@ def test_list_vpn_gateway_connections_local_cidrs_all_params(self): ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' + start = 'testString' + limit = 50 # Invoke method - response = _service.list_vpn_gateway_connections_local_cidrs( - vpn_gateway_id, + response = _service.list_ike_policy_connections( id, + start=start, + limit=limit, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string - def test_list_vpn_gateway_connections_local_cidrs_all_params_with_retries(self): - # Enable retries and run test_list_vpn_gateway_connections_local_cidrs_all_params. + def test_list_ike_policy_connections_all_params_with_retries(self): + # Enable retries and run test_list_ike_policy_connections_all_params. _service.enable_retries() - self.test_list_vpn_gateway_connections_local_cidrs_all_params() + self.test_list_ike_policy_connections_all_params() - # Disable retries and run test_list_vpn_gateway_connections_local_cidrs_all_params. + # Disable retries and run test_list_ike_policy_connections_all_params. _service.disable_retries() - self.test_list_vpn_gateway_connections_local_cidrs_all_params() + self.test_list_ike_policy_connections_all_params() @responses.activate - def test_list_vpn_gateway_connections_local_cidrs_value_error(self): + def test_list_ike_policy_connections_required_params(self): """ - test_list_vpn_gateway_connections_local_cidrs_value_error() + test_list_ike_policy_connections_required_params() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs') - mock_response = '{"cidrs": ["192.168.1.0/24"]}' + url = preprocess_url('/ike_policies/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -39329,291 +40927,194 @@ def test_list_vpn_gateway_connections_local_cidrs_value_error(self): ) # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "vpn_gateway_id": vpn_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.list_vpn_gateway_connections_local_cidrs(**req_copy) - - def test_list_vpn_gateway_connections_local_cidrs_value_error_with_retries(self): - # Enable retries and run test_list_vpn_gateway_connections_local_cidrs_value_error. - _service.enable_retries() - self.test_list_vpn_gateway_connections_local_cidrs_value_error() - - # Disable retries and run test_list_vpn_gateway_connections_local_cidrs_value_error. - _service.disable_retries() - self.test_list_vpn_gateway_connections_local_cidrs_value_error() - - -class TestRemoveVpnGatewayConnectionsLocalCidr: - """ - Test Class for remove_vpn_gateway_connections_local_cidr - """ - - @responses.activate - def test_remove_vpn_gateway_connections_local_cidr_all_params(self): - """ - remove_vpn_gateway_connections_local_cidr() - """ - # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') - responses.add( - responses.DELETE, - url, - status=204, - ) - - # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' - cidr = '192.168.1.0/24' # Invoke method - response = _service.remove_vpn_gateway_connections_local_cidr( - vpn_gateway_id, + response = _service.list_ike_policy_connections( id, - cidr, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 200 - def test_remove_vpn_gateway_connections_local_cidr_all_params_with_retries(self): - # Enable retries and run test_remove_vpn_gateway_connections_local_cidr_all_params. + def test_list_ike_policy_connections_required_params_with_retries(self): + # Enable retries and run test_list_ike_policy_connections_required_params. _service.enable_retries() - self.test_remove_vpn_gateway_connections_local_cidr_all_params() + self.test_list_ike_policy_connections_required_params() - # Disable retries and run test_remove_vpn_gateway_connections_local_cidr_all_params. + # Disable retries and run test_list_ike_policy_connections_required_params. _service.disable_retries() - self.test_remove_vpn_gateway_connections_local_cidr_all_params() + self.test_list_ike_policy_connections_required_params() @responses.activate - def test_remove_vpn_gateway_connections_local_cidr_value_error(self): + def test_list_ike_policy_connections_value_error(self): """ - test_remove_vpn_gateway_connections_local_cidr_value_error() + test_list_ike_policy_connections_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') + url = preprocess_url('/ike_policies/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( - responses.DELETE, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' - cidr = '192.168.1.0/24' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_gateway_id, "id": id, - "cidr": cidr, } 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.remove_vpn_gateway_connections_local_cidr(**req_copy) + _service.list_ike_policy_connections(**req_copy) - def test_remove_vpn_gateway_connections_local_cidr_value_error_with_retries(self): - # Enable retries and run test_remove_vpn_gateway_connections_local_cidr_value_error. + def test_list_ike_policy_connections_value_error_with_retries(self): + # Enable retries and run test_list_ike_policy_connections_value_error. _service.enable_retries() - self.test_remove_vpn_gateway_connections_local_cidr_value_error() + self.test_list_ike_policy_connections_value_error() - # Disable retries and run test_remove_vpn_gateway_connections_local_cidr_value_error. + # Disable retries and run test_list_ike_policy_connections_value_error. _service.disable_retries() - self.test_remove_vpn_gateway_connections_local_cidr_value_error() - - -class TestCheckVpnGatewayConnectionsLocalCidr: - """ - Test Class for check_vpn_gateway_connections_local_cidr - """ + self.test_list_ike_policy_connections_value_error() @responses.activate - def test_check_vpn_gateway_connections_local_cidr_all_params(self): + def test_list_ike_policy_connections_with_pager_get_next(self): """ - check_vpn_gateway_connections_local_cidr() + test_list_ike_policy_connections_with_pager_get_next() """ - # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') + # Set up a two-page mock response + url = preprocess_url('/ike_policies/testString/connections') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' responses.add( responses.GET, url, - status=204, + body=mock_response1, + content_type='application/json', + status=200, ) - - # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - cidr = '192.168.1.0/24' - - # Invoke method - response = _service.check_vpn_gateway_connections_local_cidr( - vpn_gateway_id, - id, - cidr, - headers={}, + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, ) - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 204 - - def test_check_vpn_gateway_connections_local_cidr_all_params_with_retries(self): - # Enable retries and run test_check_vpn_gateway_connections_local_cidr_all_params. - _service.enable_retries() - self.test_check_vpn_gateway_connections_local_cidr_all_params() - - # Disable retries and run test_check_vpn_gateway_connections_local_cidr_all_params. - _service.disable_retries() - self.test_check_vpn_gateway_connections_local_cidr_all_params() + # Exercise the pager class for this operation + all_results = [] + pager = IkePolicyConnectionsPager( + client=_service, + id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 @responses.activate - def test_check_vpn_gateway_connections_local_cidr_value_error(self): + def test_list_ike_policy_connections_with_pager_get_all(self): """ - test_check_vpn_gateway_connections_local_cidr_value_error() + test_list_ike_policy_connections_with_pager_get_all() """ - # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') + # Set up a two-page mock response + url = preprocess_url('/ike_policies/testString/connections') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' responses.add( responses.GET, url, - status=204, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, ) - # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - cidr = '192.168.1.0/24' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "vpn_gateway_id": vpn_gateway_id, - "id": id, - "cidr": cidr, - } - 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.check_vpn_gateway_connections_local_cidr(**req_copy) - - def test_check_vpn_gateway_connections_local_cidr_value_error_with_retries(self): - # Enable retries and run test_check_vpn_gateway_connections_local_cidr_value_error. - _service.enable_retries() - self.test_check_vpn_gateway_connections_local_cidr_value_error() - - # Disable retries and run test_check_vpn_gateway_connections_local_cidr_value_error. - _service.disable_retries() - self.test_check_vpn_gateway_connections_local_cidr_value_error() + # Exercise the pager class for this operation + pager = IkePolicyConnectionsPager( + client=_service, + id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 -class TestAddVpnGatewayConnectionsLocalCidr: +class TestListIpsecPolicies: """ - Test Class for add_vpn_gateway_connections_local_cidr + Test Class for list_ipsec_policies """ @responses.activate - def test_add_vpn_gateway_connections_local_cidr_all_params(self): + def test_list_ipsec_policies_all_params(self): """ - add_vpn_gateway_connections_local_cidr() + list_ipsec_policies() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') + url = preprocess_url('/ipsec_policies') + mock_response = '{"first": {"href": "href"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( - responses.PUT, + responses.GET, url, - status=201, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - cidr = '192.168.1.0/24' + start = 'testString' + limit = 50 # Invoke method - response = _service.add_vpn_gateway_connections_local_cidr( - vpn_gateway_id, - id, - cidr, + response = _service.list_ipsec_policies( + start=start, + limit=limit, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 201 - - def test_add_vpn_gateway_connections_local_cidr_all_params_with_retries(self): - # Enable retries and run test_add_vpn_gateway_connections_local_cidr_all_params. - _service.enable_retries() - self.test_add_vpn_gateway_connections_local_cidr_all_params() - - # Disable retries and run test_add_vpn_gateway_connections_local_cidr_all_params. - _service.disable_retries() - self.test_add_vpn_gateway_connections_local_cidr_all_params() - - @responses.activate - def test_add_vpn_gateway_connections_local_cidr_value_error(self): - """ - test_add_vpn_gateway_connections_local_cidr_value_error() - """ - # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') - responses.add( - responses.PUT, - url, - status=201, - ) - - # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - cidr = '192.168.1.0/24' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "vpn_gateway_id": vpn_gateway_id, - "id": id, - "cidr": cidr, - } - 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.add_vpn_gateway_connections_local_cidr(**req_copy) + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string - def test_add_vpn_gateway_connections_local_cidr_value_error_with_retries(self): - # Enable retries and run test_add_vpn_gateway_connections_local_cidr_value_error. + def test_list_ipsec_policies_all_params_with_retries(self): + # Enable retries and run test_list_ipsec_policies_all_params. _service.enable_retries() - self.test_add_vpn_gateway_connections_local_cidr_value_error() + self.test_list_ipsec_policies_all_params() - # Disable retries and run test_add_vpn_gateway_connections_local_cidr_value_error. + # Disable retries and run test_list_ipsec_policies_all_params. _service.disable_retries() - self.test_add_vpn_gateway_connections_local_cidr_value_error() - - -class TestListVpnGatewayConnectionsPeerCidrs: - """ - Test Class for list_vpn_gateway_connections_peer_cidrs - """ + self.test_list_ipsec_policies_all_params() @responses.activate - def test_list_vpn_gateway_connections_peer_cidrs_all_params(self): + def test_list_ipsec_policies_required_params(self): """ - list_vpn_gateway_connections_peer_cidrs() + test_list_ipsec_policies_required_params() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs') - mock_response = '{"cidrs": ["192.168.1.0/24"]}' + url = preprocess_url('/ipsec_policies') + mock_response = '{"first": {"href": "href"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -39622,38 +41123,30 @@ def test_list_vpn_gateway_connections_peer_cidrs_all_params(self): status=200, ) - # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - # Invoke method - response = _service.list_vpn_gateway_connections_peer_cidrs( - vpn_gateway_id, - id, - headers={}, - ) + response = _service.list_ipsec_policies() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_vpn_gateway_connections_peer_cidrs_all_params_with_retries(self): - # Enable retries and run test_list_vpn_gateway_connections_peer_cidrs_all_params. + def test_list_ipsec_policies_required_params_with_retries(self): + # Enable retries and run test_list_ipsec_policies_required_params. _service.enable_retries() - self.test_list_vpn_gateway_connections_peer_cidrs_all_params() + self.test_list_ipsec_policies_required_params() - # Disable retries and run test_list_vpn_gateway_connections_peer_cidrs_all_params. + # Disable retries and run test_list_ipsec_policies_required_params. _service.disable_retries() - self.test_list_vpn_gateway_connections_peer_cidrs_all_params() + self.test_list_ipsec_policies_required_params() @responses.activate - def test_list_vpn_gateway_connections_peer_cidrs_value_error(self): + def test_list_ipsec_policies_value_error(self): """ - test_list_vpn_gateway_connections_peer_cidrs_value_error() + test_list_ipsec_policies_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs') - mock_response = '{"cidrs": ["192.168.1.0/24"]}' + url = preprocess_url('/ipsec_policies') + mock_response = '{"first": {"href": "href"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -39662,141 +41155,231 @@ def test_list_vpn_gateway_connections_peer_cidrs_value_error(self): status=200, ) - # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_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.list_vpn_gateway_connections_peer_cidrs(**req_copy) + _service.list_ipsec_policies(**req_copy) - def test_list_vpn_gateway_connections_peer_cidrs_value_error_with_retries(self): - # Enable retries and run test_list_vpn_gateway_connections_peer_cidrs_value_error. + def test_list_ipsec_policies_value_error_with_retries(self): + # Enable retries and run test_list_ipsec_policies_value_error. _service.enable_retries() - self.test_list_vpn_gateway_connections_peer_cidrs_value_error() + self.test_list_ipsec_policies_value_error() - # Disable retries and run test_list_vpn_gateway_connections_peer_cidrs_value_error. + # Disable retries and run test_list_ipsec_policies_value_error. _service.disable_retries() - self.test_list_vpn_gateway_connections_peer_cidrs_value_error() - - -class TestRemoveVpnGatewayConnectionsPeerCidr: - """ - Test Class for remove_vpn_gateway_connections_peer_cidr - """ + self.test_list_ipsec_policies_value_error() @responses.activate - def test_remove_vpn_gateway_connections_peer_cidr_all_params(self): + def test_list_ipsec_policies_with_pager_get_next(self): """ - remove_vpn_gateway_connections_peer_cidr() + test_list_ipsec_policies_with_pager_get_next() """ - # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + # Set up a two-page mock response + url = preprocess_url('/ipsec_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' responses.add( - responses.DELETE, + responses.GET, url, - status=204, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, ) - # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - cidr = '192.168.1.0/24' + # Exercise the pager class for this operation + all_results = [] + pager = IpsecPoliciesPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_ipsec_policies_with_pager_get_all(self): + """ + test_list_ipsec_policies_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/ipsec_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = IpsecPoliciesPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateIpsecPolicy: + """ + Test Class for create_ipsec_policy + """ + + @responses.activate + def test_create_ipsec_policy_all_params(self): + """ + create_ipsec_policy() + """ + # Set up mock + url = preprocess_url('/ipsec_policies') + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Set up parameter values + authentication_algorithm = 'disabled' + encryption_algorithm = 'aes128' + pfs = 'disabled' + key_lifetime = 3600 + name = 'my-ipsec-policy' + resource_group = resource_group_identity_model # Invoke method - response = _service.remove_vpn_gateway_connections_peer_cidr( - vpn_gateway_id, - id, - cidr, + response = _service.create_ipsec_policy( + authentication_algorithm, + encryption_algorithm, + pfs, + key_lifetime=key_lifetime, + name=name, + resource_group=resource_group, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['authentication_algorithm'] == 'disabled' + assert req_body['encryption_algorithm'] == 'aes128' + assert req_body['pfs'] == 'disabled' + assert req_body['key_lifetime'] == 3600 + assert req_body['name'] == 'my-ipsec-policy' + assert req_body['resource_group'] == resource_group_identity_model - def test_remove_vpn_gateway_connections_peer_cidr_all_params_with_retries(self): - # Enable retries and run test_remove_vpn_gateway_connections_peer_cidr_all_params. + def test_create_ipsec_policy_all_params_with_retries(self): + # Enable retries and run test_create_ipsec_policy_all_params. _service.enable_retries() - self.test_remove_vpn_gateway_connections_peer_cidr_all_params() + self.test_create_ipsec_policy_all_params() - # Disable retries and run test_remove_vpn_gateway_connections_peer_cidr_all_params. + # Disable retries and run test_create_ipsec_policy_all_params. _service.disable_retries() - self.test_remove_vpn_gateway_connections_peer_cidr_all_params() + self.test_create_ipsec_policy_all_params() @responses.activate - def test_remove_vpn_gateway_connections_peer_cidr_value_error(self): + def test_create_ipsec_policy_value_error(self): """ - test_remove_vpn_gateway_connections_peer_cidr_value_error() + test_create_ipsec_policy_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + url = preprocess_url('/ipsec_policies') + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add( - responses.DELETE, + responses.POST, url, - status=204, + body=mock_response, + content_type='application/json', + status=201, ) + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Set up parameter values - vpn_gateway_id = 'testString' - id = 'testString' - cidr = '192.168.1.0/24' + authentication_algorithm = 'disabled' + encryption_algorithm = 'aes128' + pfs = 'disabled' + key_lifetime = 3600 + name = 'my-ipsec-policy' + resource_group = resource_group_identity_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_gateway_id, - "id": id, - "cidr": cidr, + "authentication_algorithm": authentication_algorithm, + "encryption_algorithm": encryption_algorithm, + "pfs": pfs, } 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.remove_vpn_gateway_connections_peer_cidr(**req_copy) + _service.create_ipsec_policy(**req_copy) - def test_remove_vpn_gateway_connections_peer_cidr_value_error_with_retries(self): - # Enable retries and run test_remove_vpn_gateway_connections_peer_cidr_value_error. + def test_create_ipsec_policy_value_error_with_retries(self): + # Enable retries and run test_create_ipsec_policy_value_error. _service.enable_retries() - self.test_remove_vpn_gateway_connections_peer_cidr_value_error() + self.test_create_ipsec_policy_value_error() - # Disable retries and run test_remove_vpn_gateway_connections_peer_cidr_value_error. + # Disable retries and run test_create_ipsec_policy_value_error. _service.disable_retries() - self.test_remove_vpn_gateway_connections_peer_cidr_value_error() + self.test_create_ipsec_policy_value_error() -class TestCheckVpnGatewayConnectionsPeerCidr: +class TestDeleteIpsecPolicy: """ - Test Class for check_vpn_gateway_connections_peer_cidr + Test Class for delete_ipsec_policy """ @responses.activate - def test_check_vpn_gateway_connections_peer_cidr_all_params(self): + def test_delete_ipsec_policy_all_params(self): """ - check_vpn_gateway_connections_peer_cidr() + delete_ipsec_policy() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + url = preprocess_url('/ipsec_policies/testString') responses.add( - responses.GET, + responses.DELETE, url, status=204, ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' - cidr = '192.168.1.0/24' # Invoke method - response = _service.check_vpn_gateway_connections_peer_cidr( - vpn_gateway_id, + response = _service.delete_ipsec_policy( id, - cidr, headers={}, ) @@ -39804,207 +41387,248 @@ def test_check_vpn_gateway_connections_peer_cidr_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 204 - def test_check_vpn_gateway_connections_peer_cidr_all_params_with_retries(self): - # Enable retries and run test_check_vpn_gateway_connections_peer_cidr_all_params. + def test_delete_ipsec_policy_all_params_with_retries(self): + # Enable retries and run test_delete_ipsec_policy_all_params. _service.enable_retries() - self.test_check_vpn_gateway_connections_peer_cidr_all_params() + self.test_delete_ipsec_policy_all_params() - # Disable retries and run test_check_vpn_gateway_connections_peer_cidr_all_params. + # Disable retries and run test_delete_ipsec_policy_all_params. _service.disable_retries() - self.test_check_vpn_gateway_connections_peer_cidr_all_params() + self.test_delete_ipsec_policy_all_params() @responses.activate - def test_check_vpn_gateway_connections_peer_cidr_value_error(self): + def test_delete_ipsec_policy_value_error(self): """ - test_check_vpn_gateway_connections_peer_cidr_value_error() + test_delete_ipsec_policy_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + url = preprocess_url('/ipsec_policies/testString') responses.add( - responses.GET, + responses.DELETE, url, status=204, ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' - cidr = '192.168.1.0/24' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_gateway_id, "id": id, - "cidr": cidr, } 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.check_vpn_gateway_connections_peer_cidr(**req_copy) + _service.delete_ipsec_policy(**req_copy) - def test_check_vpn_gateway_connections_peer_cidr_value_error_with_retries(self): - # Enable retries and run test_check_vpn_gateway_connections_peer_cidr_value_error. + def test_delete_ipsec_policy_value_error_with_retries(self): + # Enable retries and run test_delete_ipsec_policy_value_error. _service.enable_retries() - self.test_check_vpn_gateway_connections_peer_cidr_value_error() + self.test_delete_ipsec_policy_value_error() - # Disable retries and run test_check_vpn_gateway_connections_peer_cidr_value_error. + # Disable retries and run test_delete_ipsec_policy_value_error. _service.disable_retries() - self.test_check_vpn_gateway_connections_peer_cidr_value_error() + self.test_delete_ipsec_policy_value_error() -class TestAddVpnGatewayConnectionsPeerCidr: +class TestGetIpsecPolicy: """ - Test Class for add_vpn_gateway_connections_peer_cidr + Test Class for get_ipsec_policy """ @responses.activate - def test_add_vpn_gateway_connections_peer_cidr_all_params(self): + def test_get_ipsec_policy_all_params(self): """ - add_vpn_gateway_connections_peer_cidr() + get_ipsec_policy() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + url = preprocess_url('/ipsec_policies/testString') + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add( - responses.PUT, + responses.GET, url, - status=201, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' - cidr = '192.168.1.0/24' # Invoke method - response = _service.add_vpn_gateway_connections_peer_cidr( - vpn_gateway_id, + response = _service.get_ipsec_policy( id, - cidr, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 201 + assert response.status_code == 200 - def test_add_vpn_gateway_connections_peer_cidr_all_params_with_retries(self): - # Enable retries and run test_add_vpn_gateway_connections_peer_cidr_all_params. + def test_get_ipsec_policy_all_params_with_retries(self): + # Enable retries and run test_get_ipsec_policy_all_params. _service.enable_retries() - self.test_add_vpn_gateway_connections_peer_cidr_all_params() + self.test_get_ipsec_policy_all_params() - # Disable retries and run test_add_vpn_gateway_connections_peer_cidr_all_params. + # Disable retries and run test_get_ipsec_policy_all_params. _service.disable_retries() - self.test_add_vpn_gateway_connections_peer_cidr_all_params() + self.test_get_ipsec_policy_all_params() @responses.activate - def test_add_vpn_gateway_connections_peer_cidr_value_error(self): + def test_get_ipsec_policy_value_error(self): """ - test_add_vpn_gateway_connections_peer_cidr_value_error() + test_get_ipsec_policy_value_error() """ # Set up mock - url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + url = preprocess_url('/ipsec_policies/testString') + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add( - responses.PUT, + responses.GET, url, - status=201, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - vpn_gateway_id = 'testString' id = 'testString' - cidr = '192.168.1.0/24' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_gateway_id": vpn_gateway_id, "id": id, - "cidr": cidr, } 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.add_vpn_gateway_connections_peer_cidr(**req_copy) + _service.get_ipsec_policy(**req_copy) - def test_add_vpn_gateway_connections_peer_cidr_value_error_with_retries(self): - # Enable retries and run test_add_vpn_gateway_connections_peer_cidr_value_error. + def test_get_ipsec_policy_value_error_with_retries(self): + # Enable retries and run test_get_ipsec_policy_value_error. _service.enable_retries() - self.test_add_vpn_gateway_connections_peer_cidr_value_error() + self.test_get_ipsec_policy_value_error() - # Disable retries and run test_add_vpn_gateway_connections_peer_cidr_value_error. + # Disable retries and run test_get_ipsec_policy_value_error. _service.disable_retries() - self.test_add_vpn_gateway_connections_peer_cidr_value_error() - - -# endregion -############################################################################## -# End of Service: VPNGateways -############################################################################## - -############################################################################## -# Start of Service: VPNServers -############################################################################## -# region + self.test_get_ipsec_policy_value_error() -class TestNewInstance: +class TestUpdateIpsecPolicy: """ - Test Class for new_instance + Test Class for update_ipsec_policy """ - def test_new_instance(self): + @responses.activate + def test_update_ipsec_policy_all_params(self): """ - new_instance() + update_ipsec_policy() """ - os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + # Set up mock + url = preprocess_url('/ipsec_policies/testString') + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE', + # Construct a dict representation of a IPsecPolicyPatch model + i_psec_policy_patch_model = {} + i_psec_policy_patch_model['authentication_algorithm'] = 'disabled' + i_psec_policy_patch_model['encryption_algorithm'] = 'aes128' + i_psec_policy_patch_model['key_lifetime'] = 3600 + i_psec_policy_patch_model['name'] = 'my-ipsec-policy' + i_psec_policy_patch_model['pfs'] = 'disabled' + + # Set up parameter values + id = 'testString' + i_psec_policy_patch = i_psec_policy_patch_model + + # Invoke method + response = _service.update_ipsec_policy( + id, + i_psec_policy_patch, + headers={}, ) - assert service is not None - assert isinstance(service, VpcV1) + # 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 == i_psec_policy_patch - def test_new_instance_without_authenticator(self): - """ - new_instance_without_authenticator() - """ - with pytest.raises(ValueError, match='authenticator must be provided'): - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE_NOT_FOUND', - ) + def test_update_ipsec_policy_all_params_with_retries(self): + # Enable retries and run test_update_ipsec_policy_all_params. + _service.enable_retries() + self.test_update_ipsec_policy_all_params() - def test_new_instance_without_required_params(self): - """ - new_instance_without_required_params() - """ - with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): - service = VpcV1.new_instance() + # Disable retries and run test_update_ipsec_policy_all_params. + _service.disable_retries() + self.test_update_ipsec_policy_all_params() - def test_new_instance_required_param_none(self): + @responses.activate + def test_update_ipsec_policy_value_error(self): """ - new_instance_required_param_none() + test_update_ipsec_policy_value_error() """ - with pytest.raises(ValueError, match='version must be provided'): - service = VpcV1.new_instance( - version=None, - ) + # Set up mock + url = preprocess_url('/ipsec_policies/testString') + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a IPsecPolicyPatch model + i_psec_policy_patch_model = {} + i_psec_policy_patch_model['authentication_algorithm'] = 'disabled' + i_psec_policy_patch_model['encryption_algorithm'] = 'aes128' + i_psec_policy_patch_model['key_lifetime'] = 3600 + i_psec_policy_patch_model['name'] = 'my-ipsec-policy' + i_psec_policy_patch_model['pfs'] = 'disabled' + # Set up parameter values + id = 'testString' + i_psec_policy_patch = i_psec_policy_patch_model -class TestListVpnServers: + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + "i_psec_policy_patch": i_psec_policy_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_ipsec_policy(**req_copy) + + def test_update_ipsec_policy_value_error_with_retries(self): + # Enable retries and run test_update_ipsec_policy_value_error. + _service.enable_retries() + self.test_update_ipsec_policy_value_error() + + # Disable retries and run test_update_ipsec_policy_value_error. + _service.disable_retries() + self.test_update_ipsec_policy_value_error() + + +class TestListIpsecPolicyConnections: """ - Test Class for list_vpn_servers + Test Class for list_ipsec_policy_connections """ @responses.activate - def test_list_vpn_servers_all_params(self): + def test_list_ipsec_policy_connections_all_params(self): """ - list_vpn_servers() + list_ipsec_policy_connections() """ # Set up mock - url = preprocess_url('/vpn_servers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}' + url = preprocess_url('/ipsec_policies/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -40014,19 +41638,15 @@ def test_list_vpn_servers_all_params(self): ) # Set up parameter values - name = 'my-name' + id = 'testString' start = 'testString' limit = 50 - resource_group_id = 'testString' - sort = 'name' # Invoke method - response = _service.list_vpn_servers( - name=name, + response = _service.list_ipsec_policy_connections( + id, start=start, limit=limit, - resource_group_id=resource_group_id, - sort=sort, headers={}, ) @@ -40036,29 +41656,26 @@ def test_list_vpn_servers_all_params(self): # Validate query params query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) - assert 'name={}'.format(name) in query_string assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string - assert 'resource_group.id={}'.format(resource_group_id) in query_string - assert 'sort={}'.format(sort) in query_string - def test_list_vpn_servers_all_params_with_retries(self): - # Enable retries and run test_list_vpn_servers_all_params. + def test_list_ipsec_policy_connections_all_params_with_retries(self): + # Enable retries and run test_list_ipsec_policy_connections_all_params. _service.enable_retries() - self.test_list_vpn_servers_all_params() + self.test_list_ipsec_policy_connections_all_params() - # Disable retries and run test_list_vpn_servers_all_params. + # Disable retries and run test_list_ipsec_policy_connections_all_params. _service.disable_retries() - self.test_list_vpn_servers_all_params() + self.test_list_ipsec_policy_connections_all_params() @responses.activate - def test_list_vpn_servers_required_params(self): + def test_list_ipsec_policy_connections_required_params(self): """ - test_list_vpn_servers_required_params() + test_list_ipsec_policy_connections_required_params() """ # Set up mock - url = preprocess_url('/vpn_servers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}' + url = preprocess_url('/ipsec_policies/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -40067,30 +41684,36 @@ def test_list_vpn_servers_required_params(self): status=200, ) + # Set up parameter values + id = 'testString' + # Invoke method - response = _service.list_vpn_servers() + response = _service.list_ipsec_policy_connections( + id, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_vpn_servers_required_params_with_retries(self): - # Enable retries and run test_list_vpn_servers_required_params. + def test_list_ipsec_policy_connections_required_params_with_retries(self): + # Enable retries and run test_list_ipsec_policy_connections_required_params. _service.enable_retries() - self.test_list_vpn_servers_required_params() + self.test_list_ipsec_policy_connections_required_params() - # Disable retries and run test_list_vpn_servers_required_params. + # Disable retries and run test_list_ipsec_policy_connections_required_params. _service.disable_retries() - self.test_list_vpn_servers_required_params() + self.test_list_ipsec_policy_connections_required_params() @responses.activate - def test_list_vpn_servers_value_error(self): + def test_list_ipsec_policy_connections_value_error(self): """ - test_list_vpn_servers_value_error() + test_list_ipsec_policy_connections_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}' + url = preprocess_url('/ipsec_policies/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -40099,32 +41722,36 @@ def test_list_vpn_servers_value_error(self): status=200, ) + # Set up parameter values + id = 'testString' + # Pass in all but one required param and check for a ValueError req_param_dict = { + "id": id, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_vpn_servers(**req_copy) + _service.list_ipsec_policy_connections(**req_copy) - def test_list_vpn_servers_value_error_with_retries(self): - # Enable retries and run test_list_vpn_servers_value_error. + def test_list_ipsec_policy_connections_value_error_with_retries(self): + # Enable retries and run test_list_ipsec_policy_connections_value_error. _service.enable_retries() - self.test_list_vpn_servers_value_error() + self.test_list_ipsec_policy_connections_value_error() - # Disable retries and run test_list_vpn_servers_value_error. + # Disable retries and run test_list_ipsec_policy_connections_value_error. _service.disable_retries() - self.test_list_vpn_servers_value_error() + self.test_list_ipsec_policy_connections_value_error() @responses.activate - def test_list_vpn_servers_with_pager_get_next(self): + def test_list_ipsec_policy_connections_with_pager_get_next(self): """ - test_list_vpn_servers_with_pager_get_next() + test_list_ipsec_policy_connections_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/vpn_servers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + url = preprocess_url('/ipsec_policies/testString/connections') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' responses.add( responses.GET, url, @@ -40142,12 +41769,10 @@ def test_list_vpn_servers_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = VpnServersPager( + pager = IpsecPolicyConnectionsPager( client=_service, - name='my-name', + id='testString', limit=10, - resource_group_id='testString', - sort='name', ) while pager.has_next(): next_page = pager.get_next() @@ -40156,14 +41781,14 @@ def test_list_vpn_servers_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_vpn_servers_with_pager_get_all(self): + def test_list_ipsec_policy_connections_with_pager_get_all(self): """ - test_list_vpn_servers_with_pager_get_all() + test_list_ipsec_policy_connections_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/vpn_servers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + url = preprocess_url('/ipsec_policies/testString/connections') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' responses.add( responses.GET, url, @@ -40180,256 +41805,342 @@ def test_list_vpn_servers_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = VpnServersPager( + pager = IpsecPolicyConnectionsPager( client=_service, - name='my-name', + id='testString', limit=10, - resource_group_id='testString', - sort='name', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateVpnServer: +class TestListVpnGateways: """ - Test Class for create_vpn_server + Test Class for list_vpn_gateways """ @responses.activate - def test_create_vpn_server_all_params(self): + def test_list_vpn_gateways_all_params(self): """ - create_vpn_server() + list_vpn_gateways() """ # Set up mock - url = preprocess_url('/vpn_servers') - mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/vpn_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model - vpn_server_authentication_by_username_id_provider_model = {} - vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' - - # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model - vpn_server_authentication_prototype_model = {} - vpn_server_authentication_prototype_model['method'] = 'username' - vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model - - # Construct a dict representation of a SubnetIdentityById model - subnet_identity_model = {} - subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - # Construct a dict representation of a IP model - ip_model = {} - ip_model['address'] = '192.168.3.4' - - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a SecurityGroupIdentityById model - security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - # Set up parameter values - certificate = certificate_instance_identity_model - client_authentication = [vpn_server_authentication_prototype_model] - client_ip_pool = '172.16.0.0/16' - subnets = [subnet_identity_model] - client_dns_server_ips = [ip_model] - client_idle_timeout = 600 - enable_split_tunneling = False - name = 'my-vpn-server' - port = 443 - protocol = 'udp' - resource_group = resource_group_identity_model - security_groups = [security_group_identity_model] + start = 'testString' + limit = 50 + resource_group_id = 'testString' + sort = 'name' + mode = 'policy' # Invoke method - response = _service.create_vpn_server( - certificate, - client_authentication, - client_ip_pool, - subnets, - client_dns_server_ips=client_dns_server_ips, - client_idle_timeout=client_idle_timeout, - enable_split_tunneling=enable_split_tunneling, - name=name, - port=port, - protocol=protocol, - resource_group=resource_group, - security_groups=security_groups, + response = _service.list_vpn_gateways( + start=start, + limit=limit, + resource_group_id=resource_group_id, + sort=sort, + mode=mode, 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['certificate'] == certificate_instance_identity_model - assert req_body['client_authentication'] == [vpn_server_authentication_prototype_model] - assert req_body['client_ip_pool'] == '172.16.0.0/16' - assert req_body['subnets'] == [subnet_identity_model] - assert req_body['client_dns_server_ips'] == [ip_model] - assert req_body['client_idle_timeout'] == 600 - assert req_body['enable_split_tunneling'] == False - assert req_body['name'] == 'my-vpn-server' - assert req_body['port'] == 443 - assert req_body['protocol'] == 'udp' - assert req_body['resource_group'] == resource_group_identity_model - assert req_body['security_groups'] == [security_group_identity_model] + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'sort={}'.format(sort) in query_string + assert 'mode={}'.format(mode) in query_string - def test_create_vpn_server_all_params_with_retries(self): - # Enable retries and run test_create_vpn_server_all_params. + def test_list_vpn_gateways_all_params_with_retries(self): + # Enable retries and run test_list_vpn_gateways_all_params. _service.enable_retries() - self.test_create_vpn_server_all_params() + self.test_list_vpn_gateways_all_params() - # Disable retries and run test_create_vpn_server_all_params. + # Disable retries and run test_list_vpn_gateways_all_params. _service.disable_retries() - self.test_create_vpn_server_all_params() + self.test_list_vpn_gateways_all_params() @responses.activate - def test_create_vpn_server_value_error(self): + def test_list_vpn_gateways_required_params(self): """ - test_create_vpn_server_value_error() + test_list_vpn_gateways_required_params() """ # Set up mock - url = preprocess_url('/vpn_servers') - mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/vpn_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model - vpn_server_authentication_by_username_id_provider_model = {} - vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' - - # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model - vpn_server_authentication_prototype_model = {} - vpn_server_authentication_prototype_model['method'] = 'username' - vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model - - # Construct a dict representation of a SubnetIdentityById model - subnet_identity_model = {} - subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + # Invoke method + response = _service.list_vpn_gateways() - # Construct a dict representation of a IP model - ip_model = {} - ip_model['address'] = '192.168.3.4' + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + def test_list_vpn_gateways_required_params_with_retries(self): + # Enable retries and run test_list_vpn_gateways_required_params. + _service.enable_retries() + self.test_list_vpn_gateways_required_params() - # Construct a dict representation of a SecurityGroupIdentityById model - security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + # Disable retries and run test_list_vpn_gateways_required_params. + _service.disable_retries() + self.test_list_vpn_gateways_required_params() - # Set up parameter values - certificate = certificate_instance_identity_model - client_authentication = [vpn_server_authentication_prototype_model] - client_ip_pool = '172.16.0.0/16' - subnets = [subnet_identity_model] - client_dns_server_ips = [ip_model] - client_idle_timeout = 600 - enable_split_tunneling = False - name = 'my-vpn-server' - port = 443 - protocol = 'udp' - resource_group = resource_group_identity_model - security_groups = [security_group_identity_model] + @responses.activate + def test_list_vpn_gateways_value_error(self): + """ + test_list_vpn_gateways_value_error() + """ + # Set up mock + url = preprocess_url('/vpn_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Pass in all but one required param and check for a ValueError req_param_dict = { - "certificate": certificate, - "client_authentication": client_authentication, - "client_ip_pool": client_ip_pool, - "subnets": subnets, } 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_vpn_server(**req_copy) + _service.list_vpn_gateways(**req_copy) - def test_create_vpn_server_value_error_with_retries(self): - # Enable retries and run test_create_vpn_server_value_error. + def test_list_vpn_gateways_value_error_with_retries(self): + # Enable retries and run test_list_vpn_gateways_value_error. _service.enable_retries() - self.test_create_vpn_server_value_error() + self.test_list_vpn_gateways_value_error() - # Disable retries and run test_create_vpn_server_value_error. + # Disable retries and run test_list_vpn_gateways_value_error. _service.disable_retries() - self.test_create_vpn_server_value_error() + self.test_list_vpn_gateways_value_error() + + @responses.activate + def test_list_vpn_gateways_with_pager_get_next(self): + """ + test_list_vpn_gateways_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}' + mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + # Exercise the pager class for this operation + all_results = [] + pager = VpnGatewaysPager( + client=_service, + limit=10, + resource_group_id='testString', + sort='name', + mode='policy', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 -class TestDeleteVpnServer: + @responses.activate + def test_list_vpn_gateways_with_pager_get_all(self): + """ + test_list_vpn_gateways_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}' + mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = VpnGatewaysPager( + client=_service, + limit=10, + resource_group_id='testString', + sort='name', + mode='policy', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateVpnGateway: """ - Test Class for delete_vpn_server + Test Class for create_vpn_gateway """ @responses.activate - def test_delete_vpn_server_all_params(self): + def test_create_vpn_gateway_all_params(self): """ - delete_vpn_server() + create_vpn_gateway() """ # Set up mock - url = preprocess_url('/vpn_servers/testString') + url = preprocess_url('/vpn_gateways') + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' responses.add( - responses.DELETE, + responses.POST, url, - status=202, + body=mock_response, + content_type='application/json', + status=201, ) + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model + vpn_gateway_prototype_model = {} + vpn_gateway_prototype_model['name'] = 'my-vpn-gateway' + vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model + vpn_gateway_prototype_model['subnet'] = subnet_identity_model + vpn_gateway_prototype_model['mode'] = 'route' + # Set up parameter values - id = 'testString' - if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' + vpn_gateway_prototype = vpn_gateway_prototype_model # Invoke method - response = _service.delete_vpn_server( - id, - if_match=if_match, + response = _service.create_vpn_gateway( + vpn_gateway_prototype, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 202 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == vpn_gateway_prototype - def test_delete_vpn_server_all_params_with_retries(self): - # Enable retries and run test_delete_vpn_server_all_params. + def test_create_vpn_gateway_all_params_with_retries(self): + # Enable retries and run test_create_vpn_gateway_all_params. _service.enable_retries() - self.test_delete_vpn_server_all_params() + self.test_create_vpn_gateway_all_params() - # Disable retries and run test_delete_vpn_server_all_params. + # Disable retries and run test_create_vpn_gateway_all_params. _service.disable_retries() - self.test_delete_vpn_server_all_params() + self.test_create_vpn_gateway_all_params() @responses.activate - def test_delete_vpn_server_required_params(self): + def test_create_vpn_gateway_value_error(self): """ - test_delete_vpn_server_required_params() + test_create_vpn_gateway_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString') + url = preprocess_url('/vpn_gateways') + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model + vpn_gateway_prototype_model = {} + vpn_gateway_prototype_model['name'] = 'my-vpn-gateway' + vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model + vpn_gateway_prototype_model['subnet'] = subnet_identity_model + vpn_gateway_prototype_model['mode'] = 'route' + + # Set up parameter values + vpn_gateway_prototype = vpn_gateway_prototype_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "vpn_gateway_prototype": vpn_gateway_prototype, + } + 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_vpn_gateway(**req_copy) + + def test_create_vpn_gateway_value_error_with_retries(self): + # Enable retries and run test_create_vpn_gateway_value_error. + _service.enable_retries() + self.test_create_vpn_gateway_value_error() + + # Disable retries and run test_create_vpn_gateway_value_error. + _service.disable_retries() + self.test_create_vpn_gateway_value_error() + + +class TestDeleteVpnGateway: + """ + Test Class for delete_vpn_gateway + """ + + @responses.activate + def test_delete_vpn_gateway_all_params(self): + """ + delete_vpn_gateway() + """ + # Set up mock + url = preprocess_url('/vpn_gateways/testString') responses.add( responses.DELETE, url, @@ -40440,7 +42151,7 @@ def test_delete_vpn_server_required_params(self): id = 'testString' # Invoke method - response = _service.delete_vpn_server( + response = _service.delete_vpn_gateway( id, headers={}, ) @@ -40449,22 +42160,22 @@ def test_delete_vpn_server_required_params(self): assert len(responses.calls) == 1 assert response.status_code == 202 - def test_delete_vpn_server_required_params_with_retries(self): - # Enable retries and run test_delete_vpn_server_required_params. + def test_delete_vpn_gateway_all_params_with_retries(self): + # Enable retries and run test_delete_vpn_gateway_all_params. _service.enable_retries() - self.test_delete_vpn_server_required_params() + self.test_delete_vpn_gateway_all_params() - # Disable retries and run test_delete_vpn_server_required_params. + # Disable retries and run test_delete_vpn_gateway_all_params. _service.disable_retries() - self.test_delete_vpn_server_required_params() + self.test_delete_vpn_gateway_all_params() @responses.activate - def test_delete_vpn_server_value_error(self): + def test_delete_vpn_gateway_value_error(self): """ - test_delete_vpn_server_value_error() + test_delete_vpn_gateway_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString') + url = preprocess_url('/vpn_gateways/testString') responses.add( responses.DELETE, url, @@ -40481,31 +42192,31 @@ def test_delete_vpn_server_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.delete_vpn_server(**req_copy) + _service.delete_vpn_gateway(**req_copy) - def test_delete_vpn_server_value_error_with_retries(self): - # Enable retries and run test_delete_vpn_server_value_error. + def test_delete_vpn_gateway_value_error_with_retries(self): + # Enable retries and run test_delete_vpn_gateway_value_error. _service.enable_retries() - self.test_delete_vpn_server_value_error() + self.test_delete_vpn_gateway_value_error() - # Disable retries and run test_delete_vpn_server_value_error. + # Disable retries and run test_delete_vpn_gateway_value_error. _service.disable_retries() - self.test_delete_vpn_server_value_error() + self.test_delete_vpn_gateway_value_error() -class TestGetVpnServer: +class TestGetVpnGateway: """ - Test Class for get_vpn_server + Test Class for get_vpn_gateway """ @responses.activate - def test_get_vpn_server_all_params(self): + def test_get_vpn_gateway_all_params(self): """ - get_vpn_server() + get_vpn_gateway() """ # Set up mock - url = preprocess_url('/vpn_servers/testString') - mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/vpn_gateways/testString') + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' responses.add( responses.GET, url, @@ -40518,7 +42229,7 @@ def test_get_vpn_server_all_params(self): id = 'testString' # Invoke method - response = _service.get_vpn_server( + response = _service.get_vpn_gateway( id, headers={}, ) @@ -40527,23 +42238,23 @@ def test_get_vpn_server_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_vpn_server_all_params_with_retries(self): - # Enable retries and run test_get_vpn_server_all_params. + def test_get_vpn_gateway_all_params_with_retries(self): + # Enable retries and run test_get_vpn_gateway_all_params. _service.enable_retries() - self.test_get_vpn_server_all_params() + self.test_get_vpn_gateway_all_params() - # Disable retries and run test_get_vpn_server_all_params. + # Disable retries and run test_get_vpn_gateway_all_params. _service.disable_retries() - self.test_get_vpn_server_all_params() + self.test_get_vpn_gateway_all_params() @responses.activate - def test_get_vpn_server_value_error(self): + def test_get_vpn_gateway_value_error(self): """ - test_get_vpn_server_value_error() + test_get_vpn_gateway_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString') - mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/vpn_gateways/testString') + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' responses.add( responses.GET, url, @@ -40562,31 +42273,31 @@ def test_get_vpn_server_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_vpn_server(**req_copy) + _service.get_vpn_gateway(**req_copy) - def test_get_vpn_server_value_error_with_retries(self): - # Enable retries and run test_get_vpn_server_value_error. + def test_get_vpn_gateway_value_error_with_retries(self): + # Enable retries and run test_get_vpn_gateway_value_error. _service.enable_retries() - self.test_get_vpn_server_value_error() + self.test_get_vpn_gateway_value_error() - # Disable retries and run test_get_vpn_server_value_error. + # Disable retries and run test_get_vpn_gateway_value_error. _service.disable_retries() - self.test_get_vpn_server_value_error() + self.test_get_vpn_gateway_value_error() -class TestUpdateVpnServer: +class TestUpdateVpnGateway: """ - Test Class for update_vpn_server + Test Class for update_vpn_gateway """ @responses.activate - def test_update_vpn_server_all_params(self): + def test_update_vpn_gateway_all_params(self): """ - update_vpn_server() + update_vpn_gateway() """ # Set up mock - url = preprocess_url('/vpn_servers/testString') - mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/vpn_gateways/testString') + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' responses.add( responses.PATCH, url, @@ -40595,154 +42306,45 @@ def test_update_vpn_server_all_params(self): status=200, ) - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model - vpn_server_authentication_by_username_id_provider_model = {} - vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' + # Construct a dict representation of a VPNGatewayPatch model + vpn_gateway_patch_model = {} + vpn_gateway_patch_model['name'] = 'my-vpn-gateway' - # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model - vpn_server_authentication_prototype_model = {} - vpn_server_authentication_prototype_model['method'] = 'username' - vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model + # Set up parameter values + id = 'testString' + vpn_gateway_patch = vpn_gateway_patch_model - # Construct a dict representation of a IP model - ip_model = {} - ip_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SubnetIdentityById model - subnet_identity_model = {} - subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - # Construct a dict representation of a VPNServerPatch model - vpn_server_patch_model = {} - vpn_server_patch_model['certificate'] = certificate_instance_identity_model - vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model] - vpn_server_patch_model['client_dns_server_ips'] = [ip_model] - vpn_server_patch_model['client_idle_timeout'] = 600 - vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16' - vpn_server_patch_model['enable_split_tunneling'] = True - vpn_server_patch_model['name'] = 'my-vpn-server' - vpn_server_patch_model['port'] = 443 - vpn_server_patch_model['protocol'] = 'tcp' - vpn_server_patch_model['subnets'] = [subnet_identity_model] - - # Set up parameter values - id = 'testString' - vpn_server_patch = vpn_server_patch_model - if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' - - # Invoke method - response = _service.update_vpn_server( - id, - vpn_server_patch, - if_match=if_match, - 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 == vpn_server_patch - - def test_update_vpn_server_all_params_with_retries(self): - # Enable retries and run test_update_vpn_server_all_params. - _service.enable_retries() - self.test_update_vpn_server_all_params() - - # Disable retries and run test_update_vpn_server_all_params. - _service.disable_retries() - self.test_update_vpn_server_all_params() - - @responses.activate - def test_update_vpn_server_required_params(self): - """ - test_update_vpn_server_required_params() - """ - # Set up mock - url = preprocess_url('/vpn_servers/testString') - mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' - responses.add( - responses.PATCH, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model - vpn_server_authentication_by_username_id_provider_model = {} - vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' - - # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model - vpn_server_authentication_prototype_model = {} - vpn_server_authentication_prototype_model['method'] = 'username' - vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model - - # Construct a dict representation of a IP model - ip_model = {} - ip_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SubnetIdentityById model - subnet_identity_model = {} - subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - # Construct a dict representation of a VPNServerPatch model - vpn_server_patch_model = {} - vpn_server_patch_model['certificate'] = certificate_instance_identity_model - vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model] - vpn_server_patch_model['client_dns_server_ips'] = [ip_model] - vpn_server_patch_model['client_idle_timeout'] = 600 - vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16' - vpn_server_patch_model['enable_split_tunneling'] = True - vpn_server_patch_model['name'] = 'my-vpn-server' - vpn_server_patch_model['port'] = 443 - vpn_server_patch_model['protocol'] = 'tcp' - vpn_server_patch_model['subnets'] = [subnet_identity_model] - - # Set up parameter values - id = 'testString' - vpn_server_patch = vpn_server_patch_model - - # Invoke method - response = _service.update_vpn_server( - id, - vpn_server_patch, - headers={}, - ) + # Invoke method + response = _service.update_vpn_gateway( + id, + vpn_gateway_patch, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == vpn_server_patch + assert req_body == vpn_gateway_patch - def test_update_vpn_server_required_params_with_retries(self): - # Enable retries and run test_update_vpn_server_required_params. + def test_update_vpn_gateway_all_params_with_retries(self): + # Enable retries and run test_update_vpn_gateway_all_params. _service.enable_retries() - self.test_update_vpn_server_required_params() + self.test_update_vpn_gateway_all_params() - # Disable retries and run test_update_vpn_server_required_params. + # Disable retries and run test_update_vpn_gateway_all_params. _service.disable_retries() - self.test_update_vpn_server_required_params() + self.test_update_vpn_gateway_all_params() @responses.activate - def test_update_vpn_server_value_error(self): + def test_update_vpn_gateway_value_error(self): """ - test_update_vpn_server_value_error() + test_update_vpn_gateway_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString') - mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/vpn_gateways/testString') + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}' responses.add( responses.PATCH, url, @@ -40751,158 +42353,47 @@ def test_update_vpn_server_value_error(self): status=200, ) - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model - vpn_server_authentication_by_username_id_provider_model = {} - vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' - - # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model - vpn_server_authentication_prototype_model = {} - vpn_server_authentication_prototype_model['method'] = 'username' - vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model - - # Construct a dict representation of a IP model - ip_model = {} - ip_model['address'] = '192.168.3.4' - - # Construct a dict representation of a SubnetIdentityById model - subnet_identity_model = {} - subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - # Construct a dict representation of a VPNServerPatch model - vpn_server_patch_model = {} - vpn_server_patch_model['certificate'] = certificate_instance_identity_model - vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model] - vpn_server_patch_model['client_dns_server_ips'] = [ip_model] - vpn_server_patch_model['client_idle_timeout'] = 600 - vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16' - vpn_server_patch_model['enable_split_tunneling'] = True - vpn_server_patch_model['name'] = 'my-vpn-server' - vpn_server_patch_model['port'] = 443 - vpn_server_patch_model['protocol'] = 'tcp' - vpn_server_patch_model['subnets'] = [subnet_identity_model] - - # Set up parameter values - id = 'testString' - vpn_server_patch = vpn_server_patch_model - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "id": id, - "vpn_server_patch": vpn_server_patch, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.update_vpn_server(**req_copy) - - def test_update_vpn_server_value_error_with_retries(self): - # Enable retries and run test_update_vpn_server_value_error. - _service.enable_retries() - self.test_update_vpn_server_value_error() - - # Disable retries and run test_update_vpn_server_value_error. - _service.disable_retries() - self.test_update_vpn_server_value_error() - - -class TestGetVpnServerClientConfiguration: - """ - Test Class for get_vpn_server_client_configuration - """ - - @responses.activate - def test_get_vpn_server_client_configuration_all_params(self): - """ - get_vpn_server_client_configuration() - """ - # Set up mock - url = preprocess_url('/vpn_servers/testString/client_configuration') - mock_response = '"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n"' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='text/plain', - status=200, - ) - - # Set up parameter values - id = 'testString' - - # Invoke method - response = _service.get_vpn_server_client_configuration( - id, - headers={}, - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_vpn_server_client_configuration_all_params_with_retries(self): - # Enable retries and run test_get_vpn_server_client_configuration_all_params. - _service.enable_retries() - self.test_get_vpn_server_client_configuration_all_params() - - # Disable retries and run test_get_vpn_server_client_configuration_all_params. - _service.disable_retries() - self.test_get_vpn_server_client_configuration_all_params() - - @responses.activate - def test_get_vpn_server_client_configuration_value_error(self): - """ - test_get_vpn_server_client_configuration_value_error() - """ - # Set up mock - url = preprocess_url('/vpn_servers/testString/client_configuration') - mock_response = '"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n"' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='text/plain', - status=200, - ) + # Construct a dict representation of a VPNGatewayPatch model + vpn_gateway_patch_model = {} + vpn_gateway_patch_model['name'] = 'my-vpn-gateway' # Set up parameter values id = 'testString' + vpn_gateway_patch = vpn_gateway_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { "id": id, + "vpn_gateway_patch": vpn_gateway_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_vpn_server_client_configuration(**req_copy) + _service.update_vpn_gateway(**req_copy) - def test_get_vpn_server_client_configuration_value_error_with_retries(self): - # Enable retries and run test_get_vpn_server_client_configuration_value_error. + def test_update_vpn_gateway_value_error_with_retries(self): + # Enable retries and run test_update_vpn_gateway_value_error. _service.enable_retries() - self.test_get_vpn_server_client_configuration_value_error() + self.test_update_vpn_gateway_value_error() - # Disable retries and run test_get_vpn_server_client_configuration_value_error. + # Disable retries and run test_update_vpn_gateway_value_error. _service.disable_retries() - self.test_get_vpn_server_client_configuration_value_error() + self.test_update_vpn_gateway_value_error() -class TestListVpnServerClients: +class TestListVpnGatewayConnections: """ - Test Class for list_vpn_server_clients + Test Class for list_vpn_gateway_connections """ @responses.activate - def test_list_vpn_server_clients_all_params(self): + def test_list_vpn_gateway_connections_all_params(self): """ - list_vpn_server_clients() + list_vpn_gateway_connections() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients') - mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -40912,17 +42403,17 @@ def test_list_vpn_server_clients_all_params(self): ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' start = 'testString' limit = 50 - sort = 'created_at' + status = 'down' # Invoke method - response = _service.list_vpn_server_clients( - vpn_server_id, + response = _service.list_vpn_gateway_connections( + vpn_gateway_id, start=start, limit=limit, - sort=sort, + status=status, headers={}, ) @@ -40934,25 +42425,25 @@ def test_list_vpn_server_clients_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string - assert 'sort={}'.format(sort) in query_string + assert 'status={}'.format(status) in query_string - def test_list_vpn_server_clients_all_params_with_retries(self): - # Enable retries and run test_list_vpn_server_clients_all_params. + def test_list_vpn_gateway_connections_all_params_with_retries(self): + # Enable retries and run test_list_vpn_gateway_connections_all_params. _service.enable_retries() - self.test_list_vpn_server_clients_all_params() + self.test_list_vpn_gateway_connections_all_params() - # Disable retries and run test_list_vpn_server_clients_all_params. + # Disable retries and run test_list_vpn_gateway_connections_all_params. _service.disable_retries() - self.test_list_vpn_server_clients_all_params() + self.test_list_vpn_gateway_connections_all_params() @responses.activate - def test_list_vpn_server_clients_required_params(self): + def test_list_vpn_gateway_connections_required_params(self): """ - test_list_vpn_server_clients_required_params() + test_list_vpn_gateway_connections_required_params() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients') - mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -40962,11 +42453,11 @@ def test_list_vpn_server_clients_required_params(self): ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' # Invoke method - response = _service.list_vpn_server_clients( - vpn_server_id, + response = _service.list_vpn_gateway_connections( + vpn_gateway_id, headers={}, ) @@ -40974,23 +42465,23 @@ def test_list_vpn_server_clients_required_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_vpn_server_clients_required_params_with_retries(self): - # Enable retries and run test_list_vpn_server_clients_required_params. + def test_list_vpn_gateway_connections_required_params_with_retries(self): + # Enable retries and run test_list_vpn_gateway_connections_required_params. _service.enable_retries() - self.test_list_vpn_server_clients_required_params() + self.test_list_vpn_gateway_connections_required_params() - # Disable retries and run test_list_vpn_server_clients_required_params. + # Disable retries and run test_list_vpn_gateway_connections_required_params. _service.disable_retries() - self.test_list_vpn_server_clients_required_params() + self.test_list_vpn_gateway_connections_required_params() @responses.activate - def test_list_vpn_server_clients_value_error(self): + def test_list_vpn_gateway_connections_value_error(self): """ - test_list_vpn_server_clients_value_error() + test_list_vpn_gateway_connections_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients') - mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections') + mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -41000,35 +42491,35 @@ def test_list_vpn_server_clients_value_error(self): ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_server_id": vpn_server_id, + "vpn_gateway_id": vpn_gateway_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.list_vpn_server_clients(**req_copy) + _service.list_vpn_gateway_connections(**req_copy) - def test_list_vpn_server_clients_value_error_with_retries(self): - # Enable retries and run test_list_vpn_server_clients_value_error. + def test_list_vpn_gateway_connections_value_error_with_retries(self): + # Enable retries and run test_list_vpn_gateway_connections_value_error. _service.enable_retries() - self.test_list_vpn_server_clients_value_error() + self.test_list_vpn_gateway_connections_value_error() - # Disable retries and run test_list_vpn_server_clients_value_error. + # Disable retries and run test_list_vpn_gateway_connections_value_error. _service.disable_retries() - self.test_list_vpn_server_clients_value_error() + self.test_list_vpn_gateway_connections_value_error() @responses.activate - def test_list_vpn_server_clients_with_pager_get_next(self): + def test_list_vpn_gateway_connections_with_pager_get_next(self): """ - test_list_vpn_server_clients_with_pager_get_next() + test_list_vpn_gateway_connections_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/vpn_servers/testString/clients') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' - mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + url = preprocess_url('/vpn_gateways/testString/connections') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' responses.add( responses.GET, url, @@ -41046,11 +42537,11 @@ def test_list_vpn_server_clients_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = VpnServerClientsPager( + pager = VpnGatewayConnectionsPager( client=_service, - vpn_server_id='testString', + vpn_gateway_id='testString', limit=10, - sort='created_at', + status='down', ) while pager.has_next(): next_page = pager.get_next() @@ -41059,14 +42550,14 @@ def test_list_vpn_server_clients_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_vpn_server_clients_with_pager_get_all(self): + def test_list_vpn_gateway_connections_with_pager_get_all(self): """ - test_list_vpn_server_clients_with_pager_get_all() + test_list_vpn_gateway_connections_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/vpn_servers/testString/clients') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' - mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + url = preprocess_url('/vpn_gateways/testString/connections') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"connections":[{"admin_state_up":true,"authentication_mode":"psk","created_at":"2019-01-01T12:00:00.000Z","dead_peer_detection":{"action":"restart","interval":30,"timeout":120},"establish_mode":"bidirectional","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","ike_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ike-policy","resource_type":"ike_policy"},"ipsec_policy":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-ipsec-policy","resource_type":"ipsec_policy"},"mode":"policy","name":"my-vpn-connection","psk":"lkj14b1oi0alcniejkso","resource_type":"vpn_gateway_connection","status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}],"distribute_traffic":true,"local":{"ike_identities":[{"type":"fqdn","value":"my-service.example.com"}]},"peer":{"ike_identity":{"type":"fqdn","value":"my-service.example.com"},"type":"address","address":"169.21.50.5"},"routing_protocol":"none","tunnels":[{"public_ip":{"address":"192.168.3.4"},"status":"down","status_reasons":[{"code":"cannot_authenticate_connection","message":"Failed to authenticate a connection because of mismatched IKE ID and PSK.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}' responses.add( responses.GET, url, @@ -41083,894 +42574,852 @@ def test_list_vpn_server_clients_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = VpnServerClientsPager( + pager = VpnGatewayConnectionsPager( client=_service, - vpn_server_id='testString', + vpn_gateway_id='testString', limit=10, - sort='created_at', + status='down', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestDeleteVpnServerClient: +class TestCreateVpnGatewayConnection: """ - Test Class for delete_vpn_server_client + Test Class for create_vpn_gateway_connection """ @responses.activate - def test_delete_vpn_server_client_all_params(self): + def test_create_vpn_gateway_connection_all_params(self): """ - delete_vpn_server_client() + create_vpn_gateway_connection() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients/testString') + url = preprocess_url('/vpn_gateways/testString/connections') + mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' responses.add( - responses.DELETE, + responses.POST, url, - status=202, + body=mock_response, + content_type='application/json', + status=201, ) + # Construct a dict representation of a VPNGatewayConnectionDPDPrototype model + vpn_gateway_connection_dpd_prototype_model = {} + vpn_gateway_connection_dpd_prototype_model['action'] = 'restart' + vpn_gateway_connection_dpd_prototype_model['interval'] = 30 + vpn_gateway_connection_dpd_prototype_model['timeout'] = 120 + + # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model + vpn_gateway_connection_ike_policy_prototype_model = {} + vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + + # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model + vpn_gateway_connection_i_psec_policy_prototype_model = {} + vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + + # Construct a dict representation of a VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN model + vpn_gateway_connection_ike_identity_prototype_model = {} + vpn_gateway_connection_ike_identity_prototype_model['type'] = 'fqdn' + vpn_gateway_connection_ike_identity_prototype_model['value'] = 'my-service.example.com' + + # Construct a dict representation of a VPNGatewayConnectionStaticRouteModeLocalPrototype model + vpn_gateway_connection_static_route_mode_local_prototype_model = {} + vpn_gateway_connection_static_route_mode_local_prototype_model['ike_identities'] = [vpn_gateway_connection_ike_identity_prototype_model] + + # Construct a dict representation of a VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model + vpn_gateway_connection_static_route_mode_peer_prototype_model = {} + vpn_gateway_connection_static_route_mode_peer_prototype_model['ike_identity'] = vpn_gateway_connection_ike_identity_prototype_model + vpn_gateway_connection_static_route_mode_peer_prototype_model['address'] = '169.21.50.5' + + # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model + vpn_gateway_connection_prototype_model = {} + vpn_gateway_connection_prototype_model['admin_state_up'] = True + vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_prototype_model['establish_mode'] = 'bidirectional' + vpn_gateway_connection_prototype_model['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model + vpn_gateway_connection_prototype_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model + vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection' + vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso' + vpn_gateway_connection_prototype_model['distribute_traffic'] = False + vpn_gateway_connection_prototype_model['local'] = vpn_gateway_connection_static_route_mode_local_prototype_model + vpn_gateway_connection_prototype_model['peer'] = vpn_gateway_connection_static_route_mode_peer_prototype_model + vpn_gateway_connection_prototype_model['routing_protocol'] = 'none' + # Set up parameter values - vpn_server_id = 'testString' - id = 'testString' + vpn_gateway_id = 'testString' + vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model # Invoke method - response = _service.delete_vpn_server_client( - vpn_server_id, - id, + response = _service.create_vpn_gateway_connection( + vpn_gateway_id, + vpn_gateway_connection_prototype, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 202 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == vpn_gateway_connection_prototype - def test_delete_vpn_server_client_all_params_with_retries(self): - # Enable retries and run test_delete_vpn_server_client_all_params. + def test_create_vpn_gateway_connection_all_params_with_retries(self): + # Enable retries and run test_create_vpn_gateway_connection_all_params. _service.enable_retries() - self.test_delete_vpn_server_client_all_params() + self.test_create_vpn_gateway_connection_all_params() - # Disable retries and run test_delete_vpn_server_client_all_params. + # Disable retries and run test_create_vpn_gateway_connection_all_params. _service.disable_retries() - self.test_delete_vpn_server_client_all_params() + self.test_create_vpn_gateway_connection_all_params() @responses.activate - def test_delete_vpn_server_client_value_error(self): + def test_create_vpn_gateway_connection_value_error(self): """ - test_delete_vpn_server_client_value_error() + test_create_vpn_gateway_connection_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients/testString') + url = preprocess_url('/vpn_gateways/testString/connections') + mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' responses.add( - responses.DELETE, + responses.POST, url, - status=202, + body=mock_response, + content_type='application/json', + status=201, ) - # Set up parameter values - vpn_server_id = 'testString' - id = 'testString' + # Construct a dict representation of a VPNGatewayConnectionDPDPrototype model + vpn_gateway_connection_dpd_prototype_model = {} + vpn_gateway_connection_dpd_prototype_model['action'] = 'restart' + vpn_gateway_connection_dpd_prototype_model['interval'] = 30 + vpn_gateway_connection_dpd_prototype_model['timeout'] = 120 - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "vpn_server_id": vpn_server_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.delete_vpn_server_client(**req_copy) + # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model + vpn_gateway_connection_ike_policy_prototype_model = {} + vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - def test_delete_vpn_server_client_value_error_with_retries(self): - # Enable retries and run test_delete_vpn_server_client_value_error. - _service.enable_retries() - self.test_delete_vpn_server_client_value_error() + # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model + vpn_gateway_connection_i_psec_policy_prototype_model = {} + vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - # Disable retries and run test_delete_vpn_server_client_value_error. - _service.disable_retries() - self.test_delete_vpn_server_client_value_error() + # Construct a dict representation of a VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN model + vpn_gateway_connection_ike_identity_prototype_model = {} + vpn_gateway_connection_ike_identity_prototype_model['type'] = 'fqdn' + vpn_gateway_connection_ike_identity_prototype_model['value'] = 'my-service.example.com' + # Construct a dict representation of a VPNGatewayConnectionStaticRouteModeLocalPrototype model + vpn_gateway_connection_static_route_mode_local_prototype_model = {} + vpn_gateway_connection_static_route_mode_local_prototype_model['ike_identities'] = [vpn_gateway_connection_ike_identity_prototype_model] -class TestGetVpnServerClient: - """ - Test Class for get_vpn_server_client - """ + # Construct a dict representation of a VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model + vpn_gateway_connection_static_route_mode_peer_prototype_model = {} + vpn_gateway_connection_static_route_mode_peer_prototype_model['ike_identity'] = vpn_gateway_connection_ike_identity_prototype_model + vpn_gateway_connection_static_route_mode_peer_prototype_model['address'] = '169.21.50.5' - @responses.activate - def test_get_vpn_server_client_all_params(self): - """ - get_vpn_server_client() + # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model + vpn_gateway_connection_prototype_model = {} + vpn_gateway_connection_prototype_model['admin_state_up'] = True + vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model + vpn_gateway_connection_prototype_model['establish_mode'] = 'bidirectional' + vpn_gateway_connection_prototype_model['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model + vpn_gateway_connection_prototype_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model + vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection' + vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso' + vpn_gateway_connection_prototype_model['distribute_traffic'] = False + vpn_gateway_connection_prototype_model['local'] = vpn_gateway_connection_static_route_mode_local_prototype_model + vpn_gateway_connection_prototype_model['peer'] = vpn_gateway_connection_static_route_mode_peer_prototype_model + vpn_gateway_connection_prototype_model['routing_protocol'] = 'none' + + # Set up parameter values + vpn_gateway_id = 'testString' + vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "vpn_gateway_id": vpn_gateway_id, + "vpn_gateway_connection_prototype": vpn_gateway_connection_prototype, + } + 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_vpn_gateway_connection(**req_copy) + + def test_create_vpn_gateway_connection_value_error_with_retries(self): + # Enable retries and run test_create_vpn_gateway_connection_value_error. + _service.enable_retries() + self.test_create_vpn_gateway_connection_value_error() + + # Disable retries and run test_create_vpn_gateway_connection_value_error. + _service.disable_retries() + self.test_create_vpn_gateway_connection_value_error() + + +class TestDeleteVpnGatewayConnection: + """ + Test Class for delete_vpn_gateway_connection + """ + + @responses.activate + def test_delete_vpn_gateway_connection_all_params(self): + """ + delete_vpn_gateway_connection() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients/testString') - mock_response = '{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}' + url = preprocess_url('/vpn_gateways/testString/connections/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=202, ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' # Invoke method - response = _service.get_vpn_server_client( - vpn_server_id, + response = _service.delete_vpn_gateway_connection( + vpn_gateway_id, id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 202 - def test_get_vpn_server_client_all_params_with_retries(self): - # Enable retries and run test_get_vpn_server_client_all_params. + def test_delete_vpn_gateway_connection_all_params_with_retries(self): + # Enable retries and run test_delete_vpn_gateway_connection_all_params. _service.enable_retries() - self.test_get_vpn_server_client_all_params() + self.test_delete_vpn_gateway_connection_all_params() - # Disable retries and run test_get_vpn_server_client_all_params. + # Disable retries and run test_delete_vpn_gateway_connection_all_params. _service.disable_retries() - self.test_get_vpn_server_client_all_params() + self.test_delete_vpn_gateway_connection_all_params() @responses.activate - def test_get_vpn_server_client_value_error(self): + def test_delete_vpn_gateway_connection_value_error(self): """ - test_get_vpn_server_client_value_error() + test_delete_vpn_gateway_connection_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients/testString') - mock_response = '{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}' + url = preprocess_url('/vpn_gateways/testString/connections/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=202, ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_server_id": vpn_server_id, + "vpn_gateway_id": vpn_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_vpn_server_client(**req_copy) + _service.delete_vpn_gateway_connection(**req_copy) - def test_get_vpn_server_client_value_error_with_retries(self): - # Enable retries and run test_get_vpn_server_client_value_error. + def test_delete_vpn_gateway_connection_value_error_with_retries(self): + # Enable retries and run test_delete_vpn_gateway_connection_value_error. _service.enable_retries() - self.test_get_vpn_server_client_value_error() + self.test_delete_vpn_gateway_connection_value_error() - # Disable retries and run test_get_vpn_server_client_value_error. + # Disable retries and run test_delete_vpn_gateway_connection_value_error. _service.disable_retries() - self.test_get_vpn_server_client_value_error() + self.test_delete_vpn_gateway_connection_value_error() -class TestDisconnectVpnClient: +class TestGetVpnGatewayConnection: """ - Test Class for disconnect_vpn_client + Test Class for get_vpn_gateway_connection """ @responses.activate - def test_disconnect_vpn_client_all_params(self): + def test_get_vpn_gateway_connection_all_params(self): """ - disconnect_vpn_client() + get_vpn_gateway_connection() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients/testString/disconnect') + url = preprocess_url('/vpn_gateways/testString/connections/testString') + mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' responses.add( - responses.POST, + responses.GET, url, - status=202, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' # Invoke method - response = _service.disconnect_vpn_client( - vpn_server_id, + response = _service.get_vpn_gateway_connection( + vpn_gateway_id, id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 202 + assert response.status_code == 200 - def test_disconnect_vpn_client_all_params_with_retries(self): - # Enable retries and run test_disconnect_vpn_client_all_params. + def test_get_vpn_gateway_connection_all_params_with_retries(self): + # Enable retries and run test_get_vpn_gateway_connection_all_params. _service.enable_retries() - self.test_disconnect_vpn_client_all_params() + self.test_get_vpn_gateway_connection_all_params() - # Disable retries and run test_disconnect_vpn_client_all_params. + # Disable retries and run test_get_vpn_gateway_connection_all_params. _service.disable_retries() - self.test_disconnect_vpn_client_all_params() + self.test_get_vpn_gateway_connection_all_params() @responses.activate - def test_disconnect_vpn_client_value_error(self): + def test_get_vpn_gateway_connection_value_error(self): """ - test_disconnect_vpn_client_value_error() + test_get_vpn_gateway_connection_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/clients/testString/disconnect') + url = preprocess_url('/vpn_gateways/testString/connections/testString') + mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' responses.add( - responses.POST, + responses.GET, url, - status=202, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_server_id": vpn_server_id, + "vpn_gateway_id": vpn_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.disconnect_vpn_client(**req_copy) + _service.get_vpn_gateway_connection(**req_copy) - def test_disconnect_vpn_client_value_error_with_retries(self): - # Enable retries and run test_disconnect_vpn_client_value_error. + def test_get_vpn_gateway_connection_value_error_with_retries(self): + # Enable retries and run test_get_vpn_gateway_connection_value_error. _service.enable_retries() - self.test_disconnect_vpn_client_value_error() + self.test_get_vpn_gateway_connection_value_error() - # Disable retries and run test_disconnect_vpn_client_value_error. + # Disable retries and run test_get_vpn_gateway_connection_value_error. _service.disable_retries() - self.test_disconnect_vpn_client_value_error() + self.test_get_vpn_gateway_connection_value_error() -class TestListVpnServerRoutes: +class TestUpdateVpnGatewayConnection: """ - Test Class for list_vpn_server_routes + Test Class for update_vpn_gateway_connection """ @responses.activate - def test_list_vpn_server_routes_all_params(self): + def test_update_vpn_gateway_connection_all_params(self): """ - list_vpn_server_routes() + update_vpn_gateway_connection() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections/testString') + mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' responses.add( - responses.GET, + responses.PATCH, url, body=mock_response, content_type='application/json', status=200, ) - # Set up parameter values - vpn_server_id = 'testString' - start = 'testString' - limit = 50 - sort = 'name' - - # Invoke method - response = _service.list_vpn_server_routes( - vpn_server_id, - start=start, - limit=limit, - sort=sort, - headers={}, - ) + # Construct a dict representation of a VPNGatewayConnectionDPDPatch model + vpn_gateway_connection_dpd_patch_model = {} + vpn_gateway_connection_dpd_patch_model['action'] = 'restart' + vpn_gateway_connection_dpd_patch_model['interval'] = 30 + vpn_gateway_connection_dpd_patch_model['timeout'] = 120 - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'sort={}'.format(sort) in query_string + # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model + vpn_gateway_connection_ike_policy_patch_model = {} + vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - def test_list_vpn_server_routes_all_params_with_retries(self): - # Enable retries and run test_list_vpn_server_routes_all_params. - _service.enable_retries() - self.test_list_vpn_server_routes_all_params() + # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model + vpn_gateway_connection_i_psec_policy_patch_model = {} + vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - # Disable retries and run test_list_vpn_server_routes_all_params. - _service.disable_retries() - self.test_list_vpn_server_routes_all_params() + # Construct a dict representation of a VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model + vpn_gateway_connection_peer_patch_model = {} + vpn_gateway_connection_peer_patch_model['address'] = '169.21.50.5' - @responses.activate - def test_list_vpn_server_routes_required_params(self): - """ - test_list_vpn_server_routes_required_params() - """ - # Set up mock - url = preprocess_url('/vpn_servers/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) + # Construct a dict representation of a VPNGatewayConnectionPatch model + vpn_gateway_connection_patch_model = {} + vpn_gateway_connection_patch_model['admin_state_up'] = True + vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model + vpn_gateway_connection_patch_model['distribute_traffic'] = True + vpn_gateway_connection_patch_model['establish_mode'] = 'bidirectional' + vpn_gateway_connection_patch_model['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model + vpn_gateway_connection_patch_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model + vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection' + vpn_gateway_connection_patch_model['peer'] = vpn_gateway_connection_peer_patch_model + vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso' # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' + id = 'testString' + vpn_gateway_connection_patch = vpn_gateway_connection_patch_model # Invoke method - response = _service.list_vpn_server_routes( - vpn_server_id, + response = _service.update_vpn_gateway_connection( + vpn_gateway_id, + id, + vpn_gateway_connection_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == vpn_gateway_connection_patch - def test_list_vpn_server_routes_required_params_with_retries(self): - # Enable retries and run test_list_vpn_server_routes_required_params. + def test_update_vpn_gateway_connection_all_params_with_retries(self): + # Enable retries and run test_update_vpn_gateway_connection_all_params. _service.enable_retries() - self.test_list_vpn_server_routes_required_params() + self.test_update_vpn_gateway_connection_all_params() - # Disable retries and run test_list_vpn_server_routes_required_params. + # Disable retries and run test_update_vpn_gateway_connection_all_params. _service.disable_retries() - self.test_list_vpn_server_routes_required_params() + self.test_update_vpn_gateway_connection_all_params() @responses.activate - def test_list_vpn_server_routes_value_error(self): + def test_update_vpn_gateway_connection_value_error(self): """ - test_list_vpn_server_routes_value_error() + test_update_vpn_gateway_connection_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections/testString') + mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "establish_mode": "bidirectional", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "policy", "name": "my-vpn-connection", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "distribute_traffic": true, "local": {"ike_identities": [{"type": "fqdn", "value": "my-service.example.com"}]}, "peer": {"ike_identity": {"type": "fqdn", "value": "my-service.example.com"}, "type": "address", "address": "169.21.50.5"}, "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}' responses.add( - responses.GET, + responses.PATCH, url, body=mock_response, content_type='application/json', status=200, ) + # Construct a dict representation of a VPNGatewayConnectionDPDPatch model + vpn_gateway_connection_dpd_patch_model = {} + vpn_gateway_connection_dpd_patch_model['action'] = 'restart' + vpn_gateway_connection_dpd_patch_model['interval'] = 30 + vpn_gateway_connection_dpd_patch_model['timeout'] = 120 + + # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model + vpn_gateway_connection_ike_policy_patch_model = {} + vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + + # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model + vpn_gateway_connection_i_psec_policy_patch_model = {} + vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + + # Construct a dict representation of a VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model + vpn_gateway_connection_peer_patch_model = {} + vpn_gateway_connection_peer_patch_model['address'] = '169.21.50.5' + + # Construct a dict representation of a VPNGatewayConnectionPatch model + vpn_gateway_connection_patch_model = {} + vpn_gateway_connection_patch_model['admin_state_up'] = True + vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model + vpn_gateway_connection_patch_model['distribute_traffic'] = True + vpn_gateway_connection_patch_model['establish_mode'] = 'bidirectional' + vpn_gateway_connection_patch_model['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model + vpn_gateway_connection_patch_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model + vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection' + vpn_gateway_connection_patch_model['peer'] = vpn_gateway_connection_peer_patch_model + vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso' + # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' + id = 'testString' + vpn_gateway_connection_patch = vpn_gateway_connection_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_server_id": vpn_server_id, + "vpn_gateway_id": vpn_gateway_id, + "id": id, + "vpn_gateway_connection_patch": vpn_gateway_connection_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_vpn_server_routes(**req_copy) + _service.update_vpn_gateway_connection(**req_copy) - def test_list_vpn_server_routes_value_error_with_retries(self): - # Enable retries and run test_list_vpn_server_routes_value_error. + def test_update_vpn_gateway_connection_value_error_with_retries(self): + # Enable retries and run test_update_vpn_gateway_connection_value_error. _service.enable_retries() - self.test_list_vpn_server_routes_value_error() + self.test_update_vpn_gateway_connection_value_error() - # Disable retries and run test_list_vpn_server_routes_value_error. + # Disable retries and run test_update_vpn_gateway_connection_value_error. _service.disable_retries() - self.test_list_vpn_server_routes_value_error() - - @responses.activate - def test_list_vpn_server_routes_with_pager_get_next(self): - """ - test_list_vpn_server_routes_with_pager_get_next() - """ - # Set up a two-page mock response - url = preprocess_url('/vpn_servers/testString/routes') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' - mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - all_results = [] - pager = VpnServerRoutesPager( - client=_service, - vpn_server_id='testString', - limit=10, - sort='name', - ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 - - @responses.activate - def test_list_vpn_server_routes_with_pager_get_all(self): - """ - test_list_vpn_server_routes_with_pager_get_all() - """ - # Set up a two-page mock response - url = preprocess_url('/vpn_servers/testString/routes') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' - mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - pager = VpnServerRoutesPager( - client=_service, - vpn_server_id='testString', - limit=10, - sort='name', - ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + self.test_update_vpn_gateway_connection_value_error() -class TestCreateVpnServerRoute: +class TestListVpnGatewayConnectionsLocalCidrs: """ - Test Class for create_vpn_server_route + Test Class for list_vpn_gateway_connections_local_cidrs """ @responses.activate - def test_create_vpn_server_route_all_params(self): + def test_list_vpn_gateway_connections_local_cidrs_all_params(self): """ - create_vpn_server_route() + list_vpn_gateway_connections_local_cidrs() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes') - mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs') + mock_response = '{"cidrs": ["192.168.1.0/24"]}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) # Set up parameter values - vpn_server_id = 'testString' - destination = '172.16.0.0/16' - action = 'deliver' - name = 'my-vpn-route-2' + vpn_gateway_id = 'testString' + id = 'testString' # Invoke method - response = _service.create_vpn_server_route( - vpn_server_id, - destination, - action=action, - name=name, + response = _service.list_vpn_gateway_connections_local_cidrs( + vpn_gateway_id, + id, 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['destination'] == '172.16.0.0/16' - assert req_body['action'] == 'deliver' - assert req_body['name'] == 'my-vpn-route-2' + assert response.status_code == 200 - def test_create_vpn_server_route_all_params_with_retries(self): - # Enable retries and run test_create_vpn_server_route_all_params. + def test_list_vpn_gateway_connections_local_cidrs_all_params_with_retries(self): + # Enable retries and run test_list_vpn_gateway_connections_local_cidrs_all_params. _service.enable_retries() - self.test_create_vpn_server_route_all_params() + self.test_list_vpn_gateway_connections_local_cidrs_all_params() - # Disable retries and run test_create_vpn_server_route_all_params. + # Disable retries and run test_list_vpn_gateway_connections_local_cidrs_all_params. _service.disable_retries() - self.test_create_vpn_server_route_all_params() + self.test_list_vpn_gateway_connections_local_cidrs_all_params() @responses.activate - def test_create_vpn_server_route_value_error(self): + def test_list_vpn_gateway_connections_local_cidrs_value_error(self): """ - test_create_vpn_server_route_value_error() + test_list_vpn_gateway_connections_local_cidrs_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes') - mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs') + mock_response = '{"cidrs": ["192.168.1.0/24"]}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) # Set up parameter values - vpn_server_id = 'testString' - destination = '172.16.0.0/16' - action = 'deliver' - name = 'my-vpn-route-2' + vpn_gateway_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_server_id": vpn_server_id, - "destination": destination, + "vpn_gateway_id": vpn_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.create_vpn_server_route(**req_copy) + _service.list_vpn_gateway_connections_local_cidrs(**req_copy) - def test_create_vpn_server_route_value_error_with_retries(self): - # Enable retries and run test_create_vpn_server_route_value_error. + def test_list_vpn_gateway_connections_local_cidrs_value_error_with_retries(self): + # Enable retries and run test_list_vpn_gateway_connections_local_cidrs_value_error. _service.enable_retries() - self.test_create_vpn_server_route_value_error() + self.test_list_vpn_gateway_connections_local_cidrs_value_error() - # Disable retries and run test_create_vpn_server_route_value_error. + # Disable retries and run test_list_vpn_gateway_connections_local_cidrs_value_error. _service.disable_retries() - self.test_create_vpn_server_route_value_error() + self.test_list_vpn_gateway_connections_local_cidrs_value_error() -class TestDeleteVpnServerRoute: +class TestRemoveVpnGatewayConnectionsLocalCidr: """ - Test Class for delete_vpn_server_route + Test Class for remove_vpn_gateway_connections_local_cidr """ @responses.activate - def test_delete_vpn_server_route_all_params(self): + def test_remove_vpn_gateway_connections_local_cidr_all_params(self): """ - delete_vpn_server_route() + remove_vpn_gateway_connections_local_cidr() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes/testString') + url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') responses.add( responses.DELETE, url, - status=202, + status=204, ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' + cidr = '192.168.1.0/24' # Invoke method - response = _service.delete_vpn_server_route( - vpn_server_id, + response = _service.remove_vpn_gateway_connections_local_cidr( + vpn_gateway_id, id, + cidr, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 202 + assert response.status_code == 204 - def test_delete_vpn_server_route_all_params_with_retries(self): - # Enable retries and run test_delete_vpn_server_route_all_params. + def test_remove_vpn_gateway_connections_local_cidr_all_params_with_retries(self): + # Enable retries and run test_remove_vpn_gateway_connections_local_cidr_all_params. _service.enable_retries() - self.test_delete_vpn_server_route_all_params() + self.test_remove_vpn_gateway_connections_local_cidr_all_params() - # Disable retries and run test_delete_vpn_server_route_all_params. + # Disable retries and run test_remove_vpn_gateway_connections_local_cidr_all_params. _service.disable_retries() - self.test_delete_vpn_server_route_all_params() + self.test_remove_vpn_gateway_connections_local_cidr_all_params() @responses.activate - def test_delete_vpn_server_route_value_error(self): + def test_remove_vpn_gateway_connections_local_cidr_value_error(self): """ - test_delete_vpn_server_route_value_error() + test_remove_vpn_gateway_connections_local_cidr_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes/testString') + url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') responses.add( responses.DELETE, url, - status=202, + status=204, ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' + cidr = '192.168.1.0/24' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_server_id": vpn_server_id, + "vpn_gateway_id": vpn_gateway_id, "id": id, + "cidr": cidr, } 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_vpn_server_route(**req_copy) + _service.remove_vpn_gateway_connections_local_cidr(**req_copy) - def test_delete_vpn_server_route_value_error_with_retries(self): - # Enable retries and run test_delete_vpn_server_route_value_error. + def test_remove_vpn_gateway_connections_local_cidr_value_error_with_retries(self): + # Enable retries and run test_remove_vpn_gateway_connections_local_cidr_value_error. _service.enable_retries() - self.test_delete_vpn_server_route_value_error() + self.test_remove_vpn_gateway_connections_local_cidr_value_error() - # Disable retries and run test_delete_vpn_server_route_value_error. + # Disable retries and run test_remove_vpn_gateway_connections_local_cidr_value_error. _service.disable_retries() - self.test_delete_vpn_server_route_value_error() + self.test_remove_vpn_gateway_connections_local_cidr_value_error() -class TestGetVpnServerRoute: +class TestCheckVpnGatewayConnectionsLocalCidr: """ - Test Class for get_vpn_server_route + Test Class for check_vpn_gateway_connections_local_cidr """ @responses.activate - def test_get_vpn_server_route_all_params(self): + def test_check_vpn_gateway_connections_local_cidr_all_params(self): """ - get_vpn_server_route() + check_vpn_gateway_connections_local_cidr() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes/testString') - mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') responses.add( responses.GET, url, - body=mock_response, - content_type='application/json', - status=200, + status=204, ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' + cidr = '192.168.1.0/24' # Invoke method - response = _service.get_vpn_server_route( - vpn_server_id, + response = _service.check_vpn_gateway_connections_local_cidr( + vpn_gateway_id, id, + cidr, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 204 - def test_get_vpn_server_route_all_params_with_retries(self): - # Enable retries and run test_get_vpn_server_route_all_params. + def test_check_vpn_gateway_connections_local_cidr_all_params_with_retries(self): + # Enable retries and run test_check_vpn_gateway_connections_local_cidr_all_params. _service.enable_retries() - self.test_get_vpn_server_route_all_params() + self.test_check_vpn_gateway_connections_local_cidr_all_params() - # Disable retries and run test_get_vpn_server_route_all_params. + # Disable retries and run test_check_vpn_gateway_connections_local_cidr_all_params. _service.disable_retries() - self.test_get_vpn_server_route_all_params() + self.test_check_vpn_gateway_connections_local_cidr_all_params() @responses.activate - def test_get_vpn_server_route_value_error(self): + def test_check_vpn_gateway_connections_local_cidr_value_error(self): """ - test_get_vpn_server_route_value_error() + test_check_vpn_gateway_connections_local_cidr_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes/testString') - mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') responses.add( responses.GET, url, - body=mock_response, - content_type='application/json', - status=200, + status=204, ) # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' + cidr = '192.168.1.0/24' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_server_id": vpn_server_id, + "vpn_gateway_id": vpn_gateway_id, "id": id, + "cidr": cidr, } 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_vpn_server_route(**req_copy) + _service.check_vpn_gateway_connections_local_cidr(**req_copy) - def test_get_vpn_server_route_value_error_with_retries(self): - # Enable retries and run test_get_vpn_server_route_value_error. + def test_check_vpn_gateway_connections_local_cidr_value_error_with_retries(self): + # Enable retries and run test_check_vpn_gateway_connections_local_cidr_value_error. _service.enable_retries() - self.test_get_vpn_server_route_value_error() + self.test_check_vpn_gateway_connections_local_cidr_value_error() - # Disable retries and run test_get_vpn_server_route_value_error. + # Disable retries and run test_check_vpn_gateway_connections_local_cidr_value_error. _service.disable_retries() - self.test_get_vpn_server_route_value_error() + self.test_check_vpn_gateway_connections_local_cidr_value_error() -class TestUpdateVpnServerRoute: +class TestAddVpnGatewayConnectionsLocalCidr: """ - Test Class for update_vpn_server_route + Test Class for add_vpn_gateway_connections_local_cidr """ @responses.activate - def test_update_vpn_server_route_all_params(self): + def test_add_vpn_gateway_connections_local_cidr_all_params(self): """ - update_vpn_server_route() + add_vpn_gateway_connections_local_cidr() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes/testString') - mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') responses.add( - responses.PATCH, + responses.PUT, url, - body=mock_response, - content_type='application/json', - status=200, + status=201, ) - # Construct a dict representation of a VPNServerRoutePatch model - vpn_server_route_patch_model = {} - vpn_server_route_patch_model['name'] = 'my-vpn-route-2' - # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' - vpn_server_route_patch = vpn_server_route_patch_model + cidr = '192.168.1.0/24' # Invoke method - response = _service.update_vpn_server_route( - vpn_server_id, + response = _service.add_vpn_gateway_connections_local_cidr( + vpn_gateway_id, id, - vpn_server_route_patch, + cidr, 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 == vpn_server_route_patch + assert response.status_code == 201 - def test_update_vpn_server_route_all_params_with_retries(self): - # Enable retries and run test_update_vpn_server_route_all_params. + def test_add_vpn_gateway_connections_local_cidr_all_params_with_retries(self): + # Enable retries and run test_add_vpn_gateway_connections_local_cidr_all_params. _service.enable_retries() - self.test_update_vpn_server_route_all_params() + self.test_add_vpn_gateway_connections_local_cidr_all_params() - # Disable retries and run test_update_vpn_server_route_all_params. + # Disable retries and run test_add_vpn_gateway_connections_local_cidr_all_params. _service.disable_retries() - self.test_update_vpn_server_route_all_params() + self.test_add_vpn_gateway_connections_local_cidr_all_params() @responses.activate - def test_update_vpn_server_route_value_error(self): + def test_add_vpn_gateway_connections_local_cidr_value_error(self): """ - test_update_vpn_server_route_value_error() + test_add_vpn_gateway_connections_local_cidr_value_error() """ # Set up mock - url = preprocess_url('/vpn_servers/testString/routes/testString') - mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24') responses.add( - responses.PATCH, + responses.PUT, url, - body=mock_response, - content_type='application/json', - status=200, + status=201, ) - # Construct a dict representation of a VPNServerRoutePatch model - vpn_server_route_patch_model = {} - vpn_server_route_patch_model['name'] = 'my-vpn-route-2' - # Set up parameter values - vpn_server_id = 'testString' + vpn_gateway_id = 'testString' id = 'testString' - vpn_server_route_patch = vpn_server_route_patch_model + cidr = '192.168.1.0/24' # Pass in all but one required param and check for a ValueError req_param_dict = { - "vpn_server_id": vpn_server_id, + "vpn_gateway_id": vpn_gateway_id, "id": id, - "vpn_server_route_patch": vpn_server_route_patch, + "cidr": cidr, } 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_vpn_server_route(**req_copy) + _service.add_vpn_gateway_connections_local_cidr(**req_copy) - def test_update_vpn_server_route_value_error_with_retries(self): - # Enable retries and run test_update_vpn_server_route_value_error. + def test_add_vpn_gateway_connections_local_cidr_value_error_with_retries(self): + # Enable retries and run test_add_vpn_gateway_connections_local_cidr_value_error. _service.enable_retries() - self.test_update_vpn_server_route_value_error() + self.test_add_vpn_gateway_connections_local_cidr_value_error() - # Disable retries and run test_update_vpn_server_route_value_error. + # Disable retries and run test_add_vpn_gateway_connections_local_cidr_value_error. _service.disable_retries() - self.test_update_vpn_server_route_value_error() - - -# endregion -############################################################################## -# End of Service: VPNServers -############################################################################## - -############################################################################## -# Start of Service: LoadBalancers -############################################################################## -# region - - -class TestNewInstance: - """ - Test Class for new_instance - """ - - def test_new_instance(self): - """ - new_instance() - """ - os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE', - ) - - assert service is not None - assert isinstance(service, VpcV1) - - def test_new_instance_without_authenticator(self): - """ - new_instance_without_authenticator() - """ - with pytest.raises(ValueError, match='authenticator must be provided'): - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE_NOT_FOUND', - ) - - def test_new_instance_without_required_params(self): - """ - new_instance_without_required_params() - """ - with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): - service = VpcV1.new_instance() - - def test_new_instance_required_param_none(self): - """ - new_instance_required_param_none() - """ - with pytest.raises(ValueError, match='version must be provided'): - service = VpcV1.new_instance( - version=None, - ) + self.test_add_vpn_gateway_connections_local_cidr_value_error() -class TestListLoadBalancerProfiles: +class TestListVpnGatewayConnectionsPeerCidrs: """ - Test Class for list_load_balancer_profiles + Test Class for list_vpn_gateway_connections_peer_cidrs """ @responses.activate - def test_list_load_balancer_profiles_all_params(self): + def test_list_vpn_gateway_connections_peer_cidrs_all_params(self): """ - list_load_balancer_profiles() + list_vpn_gateway_connections_peer_cidrs() """ # Set up mock - url = preprocess_url('/load_balancer/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs') + mock_response = '{"cidrs": ["192.168.1.0/24"]}' responses.add( responses.GET, url, @@ -41980,42 +43429,37 @@ def test_list_load_balancer_profiles_all_params(self): ) # Set up parameter values - start = 'testString' - limit = 50 + vpn_gateway_id = 'testString' + id = 'testString' # Invoke method - response = _service.list_load_balancer_profiles( - start=start, - limit=limit, + response = _service.list_vpn_gateway_connections_peer_cidrs( + vpn_gateway_id, + id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - def test_list_load_balancer_profiles_all_params_with_retries(self): - # Enable retries and run test_list_load_balancer_profiles_all_params. + def test_list_vpn_gateway_connections_peer_cidrs_all_params_with_retries(self): + # Enable retries and run test_list_vpn_gateway_connections_peer_cidrs_all_params. _service.enable_retries() - self.test_list_load_balancer_profiles_all_params() + self.test_list_vpn_gateway_connections_peer_cidrs_all_params() - # Disable retries and run test_list_load_balancer_profiles_all_params. + # Disable retries and run test_list_vpn_gateway_connections_peer_cidrs_all_params. _service.disable_retries() - self.test_list_load_balancer_profiles_all_params() + self.test_list_vpn_gateway_connections_peer_cidrs_all_params() @responses.activate - def test_list_load_balancer_profiles_required_params(self): + def test_list_vpn_gateway_connections_peer_cidrs_value_error(self): """ - test_list_load_balancer_profiles_required_params() + test_list_vpn_gateway_connections_peer_cidrs_value_error() """ # Set up mock - url = preprocess_url('/load_balancer/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs') + mock_response = '{"cidrs": ["192.168.1.0/24"]}' responses.add( responses.GET, url, @@ -42024,264 +43468,349 @@ def test_list_load_balancer_profiles_required_params(self): status=200, ) - # Invoke method - response = _service.list_load_balancer_profiles() - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_list_load_balancer_profiles_required_params_with_retries(self): - # Enable retries and run test_list_load_balancer_profiles_required_params. - _service.enable_retries() - self.test_list_load_balancer_profiles_required_params() - - # Disable retries and run test_list_load_balancer_profiles_required_params. - _service.disable_retries() - self.test_list_load_balancer_profiles_required_params() - - @responses.activate - def test_list_load_balancer_profiles_value_error(self): - """ - test_list_load_balancer_profiles_value_error() - """ - # Set up mock - url = preprocess_url('/load_balancer/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) + # Set up parameter values + vpn_gateway_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "vpn_gateway_id": vpn_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.list_load_balancer_profiles(**req_copy) + _service.list_vpn_gateway_connections_peer_cidrs(**req_copy) - def test_list_load_balancer_profiles_value_error_with_retries(self): - # Enable retries and run test_list_load_balancer_profiles_value_error. + def test_list_vpn_gateway_connections_peer_cidrs_value_error_with_retries(self): + # Enable retries and run test_list_vpn_gateway_connections_peer_cidrs_value_error. _service.enable_retries() - self.test_list_load_balancer_profiles_value_error() + self.test_list_vpn_gateway_connections_peer_cidrs_value_error() - # Disable retries and run test_list_load_balancer_profiles_value_error. + # Disable retries and run test_list_vpn_gateway_connections_peer_cidrs_value_error. _service.disable_retries() - self.test_list_load_balancer_profiles_value_error() - - @responses.activate - def test_list_load_balancer_profiles_with_pager_get_next(self): - """ - test_list_load_balancer_profiles_with_pager_get_next() - """ - # Set up a two-page mock response - url = preprocess_url('/load_balancer/profiles') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}' - mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - all_results = [] - pager = LoadBalancerProfilesPager( - client=_service, - limit=10, - ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 - - @responses.activate - def test_list_load_balancer_profiles_with_pager_get_all(self): - """ - test_list_load_balancer_profiles_with_pager_get_all() - """ - # Set up a two-page mock response - url = preprocess_url('/load_balancer/profiles') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}' - mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - pager = LoadBalancerProfilesPager( - client=_service, - limit=10, - ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + self.test_list_vpn_gateway_connections_peer_cidrs_value_error() -class TestGetLoadBalancerProfile: +class TestRemoveVpnGatewayConnectionsPeerCidr: """ - Test Class for get_load_balancer_profile + Test Class for remove_vpn_gateway_connections_peer_cidr """ @responses.activate - def test_get_load_balancer_profile_all_params(self): + def test_remove_vpn_gateway_connections_peer_cidr_all_params(self): """ - get_load_balancer_profile() + remove_vpn_gateway_connections_peer_cidr() """ # Set up mock - url = preprocess_url('/load_balancer/profiles/network-fixed') - mock_response = '{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=204, ) # Set up parameter values - name = 'network-fixed' + vpn_gateway_id = 'testString' + id = 'testString' + cidr = '192.168.1.0/24' # Invoke method - response = _service.get_load_balancer_profile( - name, + response = _service.remove_vpn_gateway_connections_peer_cidr( + vpn_gateway_id, + id, + cidr, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 204 - def test_get_load_balancer_profile_all_params_with_retries(self): - # Enable retries and run test_get_load_balancer_profile_all_params. + def test_remove_vpn_gateway_connections_peer_cidr_all_params_with_retries(self): + # Enable retries and run test_remove_vpn_gateway_connections_peer_cidr_all_params. _service.enable_retries() - self.test_get_load_balancer_profile_all_params() + self.test_remove_vpn_gateway_connections_peer_cidr_all_params() - # Disable retries and run test_get_load_balancer_profile_all_params. + # Disable retries and run test_remove_vpn_gateway_connections_peer_cidr_all_params. _service.disable_retries() - self.test_get_load_balancer_profile_all_params() + self.test_remove_vpn_gateway_connections_peer_cidr_all_params() @responses.activate - def test_get_load_balancer_profile_value_error(self): + def test_remove_vpn_gateway_connections_peer_cidr_value_error(self): """ - test_get_load_balancer_profile_value_error() + test_remove_vpn_gateway_connections_peer_cidr_value_error() """ # Set up mock - url = preprocess_url('/load_balancer/profiles/network-fixed') - mock_response = '{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=204, ) # Set up parameter values - name = 'network-fixed' + vpn_gateway_id = 'testString' + id = 'testString' + cidr = '192.168.1.0/24' # Pass in all but one required param and check for a ValueError req_param_dict = { - "name": name, + "vpn_gateway_id": vpn_gateway_id, + "id": id, + "cidr": cidr, } 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_load_balancer_profile(**req_copy) + _service.remove_vpn_gateway_connections_peer_cidr(**req_copy) - def test_get_load_balancer_profile_value_error_with_retries(self): - # Enable retries and run test_get_load_balancer_profile_value_error. + def test_remove_vpn_gateway_connections_peer_cidr_value_error_with_retries(self): + # Enable retries and run test_remove_vpn_gateway_connections_peer_cidr_value_error. _service.enable_retries() - self.test_get_load_balancer_profile_value_error() + self.test_remove_vpn_gateway_connections_peer_cidr_value_error() - # Disable retries and run test_get_load_balancer_profile_value_error. + # Disable retries and run test_remove_vpn_gateway_connections_peer_cidr_value_error. _service.disable_retries() - self.test_get_load_balancer_profile_value_error() + self.test_remove_vpn_gateway_connections_peer_cidr_value_error() -class TestListLoadBalancers: +class TestCheckVpnGatewayConnectionsPeerCidr: """ - Test Class for list_load_balancers + Test Class for check_vpn_gateway_connections_peer_cidr """ @responses.activate - def test_list_load_balancers_all_params(self): + def test_check_vpn_gateway_connections_peer_cidr_all_params(self): """ - list_load_balancers() + check_vpn_gateway_connections_peer_cidr() """ # Set up mock - url = preprocess_url('/load_balancers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') responses.add( responses.GET, url, - body=mock_response, - content_type='application/json', - status=200, + status=204, ) # Set up parameter values - start = 'testString' - limit = 50 + vpn_gateway_id = 'testString' + id = 'testString' + cidr = '192.168.1.0/24' # Invoke method - response = _service.list_load_balancers( - start=start, - limit=limit, + response = _service.check_vpn_gateway_connections_peer_cidr( + vpn_gateway_id, + id, + cidr, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string + assert response.status_code == 204 - def test_list_load_balancers_all_params_with_retries(self): - # Enable retries and run test_list_load_balancers_all_params. + def test_check_vpn_gateway_connections_peer_cidr_all_params_with_retries(self): + # Enable retries and run test_check_vpn_gateway_connections_peer_cidr_all_params. _service.enable_retries() - self.test_list_load_balancers_all_params() + self.test_check_vpn_gateway_connections_peer_cidr_all_params() - # Disable retries and run test_list_load_balancers_all_params. + # Disable retries and run test_check_vpn_gateway_connections_peer_cidr_all_params. _service.disable_retries() - self.test_list_load_balancers_all_params() + self.test_check_vpn_gateway_connections_peer_cidr_all_params() @responses.activate - def test_list_load_balancers_required_params(self): + def test_check_vpn_gateway_connections_peer_cidr_value_error(self): """ - test_list_load_balancers_required_params() + test_check_vpn_gateway_connections_peer_cidr_value_error() """ # Set up mock - url = preprocess_url('/load_balancers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + responses.add( + responses.GET, + url, + status=204, + ) + + # Set up parameter values + vpn_gateway_id = 'testString' + id = 'testString' + cidr = '192.168.1.0/24' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "vpn_gateway_id": vpn_gateway_id, + "id": id, + "cidr": cidr, + } + 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.check_vpn_gateway_connections_peer_cidr(**req_copy) + + def test_check_vpn_gateway_connections_peer_cidr_value_error_with_retries(self): + # Enable retries and run test_check_vpn_gateway_connections_peer_cidr_value_error. + _service.enable_retries() + self.test_check_vpn_gateway_connections_peer_cidr_value_error() + + # Disable retries and run test_check_vpn_gateway_connections_peer_cidr_value_error. + _service.disable_retries() + self.test_check_vpn_gateway_connections_peer_cidr_value_error() + + +class TestAddVpnGatewayConnectionsPeerCidr: + """ + Test Class for add_vpn_gateway_connections_peer_cidr + """ + + @responses.activate + def test_add_vpn_gateway_connections_peer_cidr_all_params(self): + """ + add_vpn_gateway_connections_peer_cidr() + """ + # Set up mock + url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + responses.add( + responses.PUT, + url, + status=201, + ) + + # Set up parameter values + vpn_gateway_id = 'testString' + id = 'testString' + cidr = '192.168.1.0/24' + + # Invoke method + response = _service.add_vpn_gateway_connections_peer_cidr( + vpn_gateway_id, + id, + cidr, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 201 + + def test_add_vpn_gateway_connections_peer_cidr_all_params_with_retries(self): + # Enable retries and run test_add_vpn_gateway_connections_peer_cidr_all_params. + _service.enable_retries() + self.test_add_vpn_gateway_connections_peer_cidr_all_params() + + # Disable retries and run test_add_vpn_gateway_connections_peer_cidr_all_params. + _service.disable_retries() + self.test_add_vpn_gateway_connections_peer_cidr_all_params() + + @responses.activate + def test_add_vpn_gateway_connections_peer_cidr_value_error(self): + """ + test_add_vpn_gateway_connections_peer_cidr_value_error() + """ + # Set up mock + url = preprocess_url('/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24') + responses.add( + responses.PUT, + url, + status=201, + ) + + # Set up parameter values + vpn_gateway_id = 'testString' + id = 'testString' + cidr = '192.168.1.0/24' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "vpn_gateway_id": vpn_gateway_id, + "id": id, + "cidr": cidr, + } + 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.add_vpn_gateway_connections_peer_cidr(**req_copy) + + def test_add_vpn_gateway_connections_peer_cidr_value_error_with_retries(self): + # Enable retries and run test_add_vpn_gateway_connections_peer_cidr_value_error. + _service.enable_retries() + self.test_add_vpn_gateway_connections_peer_cidr_value_error() + + # Disable retries and run test_add_vpn_gateway_connections_peer_cidr_value_error. + _service.disable_retries() + self.test_add_vpn_gateway_connections_peer_cidr_value_error() + + +# endregion +############################################################################## +# End of Service: VPNGateways +############################################################################## + +############################################################################## +# Start of Service: VPNServers +############################################################################## +# region + + +class TestNewInstance: + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, VpcV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) + + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) + + +class TestListVpnServers: + """ + Test Class for list_vpn_servers + """ + + @responses.activate + def test_list_vpn_servers_all_params(self): + """ + list_vpn_servers() + """ + # Set up mock + url = preprocess_url('/vpn_servers') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}' responses.add( responses.GET, url, @@ -42290,30 +43819,84 @@ def test_list_load_balancers_required_params(self): status=200, ) + # Set up parameter values + name = 'my-name' + start = 'testString' + limit = 50 + resource_group_id = 'testString' + sort = 'name' + # Invoke method - response = _service.list_load_balancers() + response = _service.list_vpn_servers( + name=name, + start=start, + limit=limit, + resource_group_id=resource_group_id, + sort=sort, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'name={}'.format(name) in query_string + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'sort={}'.format(sort) in query_string - def test_list_load_balancers_required_params_with_retries(self): - # Enable retries and run test_list_load_balancers_required_params. + def test_list_vpn_servers_all_params_with_retries(self): + # Enable retries and run test_list_vpn_servers_all_params. _service.enable_retries() - self.test_list_load_balancers_required_params() + self.test_list_vpn_servers_all_params() - # Disable retries and run test_list_load_balancers_required_params. + # Disable retries and run test_list_vpn_servers_all_params. _service.disable_retries() - self.test_list_load_balancers_required_params() + self.test_list_vpn_servers_all_params() @responses.activate - def test_list_load_balancers_value_error(self): + def test_list_vpn_servers_required_params(self): """ - test_list_load_balancers_value_error() + test_list_vpn_servers_required_params() """ # Set up mock - url = preprocess_url('/load_balancers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/vpn_servers') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.list_vpn_servers() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_vpn_servers_required_params_with_retries(self): + # Enable retries and run test_list_vpn_servers_required_params. + _service.enable_retries() + self.test_list_vpn_servers_required_params() + + # Disable retries and run test_list_vpn_servers_required_params. + _service.disable_retries() + self.test_list_vpn_servers_required_params() + + @responses.activate + def test_list_vpn_servers_value_error(self): + """ + test_list_vpn_servers_value_error() + """ + # Set up mock + url = preprocess_url('/vpn_servers') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}' responses.add( responses.GET, url, @@ -42328,26 +43911,26 @@ def test_list_load_balancers_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_load_balancers(**req_copy) + _service.list_vpn_servers(**req_copy) - def test_list_load_balancers_value_error_with_retries(self): - # Enable retries and run test_list_load_balancers_value_error. + def test_list_vpn_servers_value_error_with_retries(self): + # Enable retries and run test_list_vpn_servers_value_error. _service.enable_retries() - self.test_list_load_balancers_value_error() + self.test_list_vpn_servers_value_error() - # Disable retries and run test_list_load_balancers_value_error. + # Disable retries and run test_list_vpn_servers_value_error. _service.disable_retries() - self.test_list_load_balancers_value_error() + self.test_list_vpn_servers_value_error() @responses.activate - def test_list_load_balancers_with_pager_get_next(self): + def test_list_vpn_servers_with_pager_get_next(self): """ - test_list_load_balancers_with_pager_get_next() + test_list_vpn_servers_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/load_balancers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}' - mock_response2 = '{"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}' + url = preprocess_url('/vpn_servers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -42365,9 +43948,12 @@ def test_list_load_balancers_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = LoadBalancersPager( + pager = VpnServersPager( client=_service, + name='my-name', limit=10, + resource_group_id='testString', + sort='name', ) while pager.has_next(): next_page = pager.get_next() @@ -42376,14 +43962,14 @@ def test_list_load_balancers_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_load_balancers_with_pager_get_all(self): + def test_list_vpn_servers_with_pager_get_all(self): """ - test_list_load_balancers_with_pager_get_all() + test_list_vpn_servers_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/load_balancers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}' - mock_response2 = '{"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}' + url = preprocess_url('/vpn_servers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"tcp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -42400,28 +43986,31 @@ def test_list_load_balancers_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = LoadBalancersPager( + pager = VpnServersPager( client=_service, + name='my-name', limit=10, + resource_group_id='testString', + sort='name', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreateLoadBalancer: +class TestCreateVpnServer: """ - Test Class for create_load_balancer + Test Class for create_vpn_server """ @responses.activate - def test_create_load_balancer_all_params(self): + def test_create_vpn_server_all_params(self): """ - create_load_balancer() + create_vpn_server() """ # Set up mock - url = preprocess_url('/load_balancers') - mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' + url = preprocess_url('/vpn_servers') + mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -42430,99 +44019,26 @@ def test_create_load_balancer_all_params(self): status=201, ) - # Construct a dict representation of a SubnetIdentityById model - subnet_identity_model = {} - subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - # Construct a dict representation of a DNSInstanceIdentityByCRN model - dns_instance_identity_model = {} - dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' - - # Construct a dict representation of a DNSZoneIdentityById model - dns_zone_identity_model = {} - dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' - - # Construct a dict representation of a LoadBalancerDNSPrototype model - load_balancer_dns_prototype_model = {} - load_balancer_dns_prototype_model['instance'] = dns_instance_identity_model - load_balancer_dns_prototype_model['zone'] = dns_zone_identity_model - # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a dict representation of a LoadBalancerPoolIdentityByName model - load_balancer_pool_identity_by_name_model = {} - load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' - - # Construct a dict representation of a LoadBalancerListenerIdentityById model - load_balancer_listener_identity_model = {} - load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model - load_balancer_listener_https_redirect_prototype_model = {} - load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 - load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model - load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' - - # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model - load_balancer_listener_prototype_load_balancer_context_model = {} - load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True - load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model - load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000 - load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model - load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model - load_balancer_listener_prototype_load_balancer_context_model['idle_connection_timeout'] = 100 - load_balancer_listener_prototype_load_balancer_context_model['port'] = 443 - load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499 - load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443 - load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http' - - # Construct a dict representation of a LoadBalancerLoggingDatapathPrototype model - load_balancer_logging_datapath_prototype_model = {} - load_balancer_logging_datapath_prototype_model['active'] = True - - # Construct a dict representation of a LoadBalancerLoggingPrototype model - load_balancer_logging_prototype_model = {} - load_balancer_logging_prototype_model['datapath'] = load_balancer_logging_datapath_prototype_model - - # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model - load_balancer_pool_health_monitor_prototype_model = {} - load_balancer_pool_health_monitor_prototype_model['delay'] = 5 - load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2 - load_balancer_pool_health_monitor_prototype_model['port'] = 22 - load_balancer_pool_health_monitor_prototype_model['timeout'] = 2 - load_balancer_pool_health_monitor_prototype_model['type'] = 'http' - load_balancer_pool_health_monitor_prototype_model['url_path'] = '/' - - # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' - - # Construct a dict representation of a LoadBalancerPoolMemberPrototype model - load_balancer_pool_member_prototype_model = {} - load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model - load_balancer_pool_member_prototype_model['weight'] = 50 + # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model + vpn_server_authentication_by_username_id_provider_model = {} + vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' - # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model - load_balancer_pool_session_persistence_prototype_model = {} - load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name' - load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie' + # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model + vpn_server_authentication_prototype_model = {} + vpn_server_authentication_prototype_model['method'] = 'username' + vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model - # Construct a dict representation of a LoadBalancerPoolPrototype model - load_balancer_pool_prototype_model = {} - load_balancer_pool_prototype_model['algorithm'] = 'least_connections' - load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model - load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model] - load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool' - load_balancer_pool_prototype_model['protocol'] = 'http' - load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled' - load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - # Construct a dict representation of a LoadBalancerProfileIdentityByName model - load_balancer_profile_identity_model = {} - load_balancer_profile_identity_model['name'] = 'network-fixed' + # Construct a dict representation of a IP model + ip_model = {} + ip_model['address'] = '192.168.3.4' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -42530,35 +44046,35 @@ def test_create_load_balancer_all_params(self): # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Set up parameter values - is_public = True + certificate = certificate_instance_identity_model + client_authentication = [vpn_server_authentication_prototype_model] + client_ip_pool = '172.16.0.0/16' subnets = [subnet_identity_model] - dns = load_balancer_dns_prototype_model - is_private_path = True - listeners = [load_balancer_listener_prototype_load_balancer_context_model] - logging = load_balancer_logging_prototype_model - name = 'my-load-balancer' - pools = [load_balancer_pool_prototype_model] - profile = load_balancer_profile_identity_model + client_dns_server_ips = [ip_model] + client_idle_timeout = 600 + enable_split_tunneling = False + name = 'my-vpn-server' + port = 443 + protocol = 'udp' resource_group = resource_group_identity_model - route_mode = True security_groups = [security_group_identity_model] # Invoke method - response = _service.create_load_balancer( - is_public, + response = _service.create_vpn_server( + certificate, + client_authentication, + client_ip_pool, subnets, - dns=dns, - is_private_path=is_private_path, - listeners=listeners, - logging=logging, + client_dns_server_ips=client_dns_server_ips, + client_idle_timeout=client_idle_timeout, + enable_split_tunneling=enable_split_tunneling, name=name, - pools=pools, - profile=profile, + port=port, + protocol=protocol, resource_group=resource_group, - route_mode=route_mode, security_groups=security_groups, headers={}, ) @@ -42568,36 +44084,36 @@ def test_create_load_balancer_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['is_public'] == True + assert req_body['certificate'] == certificate_instance_identity_model + assert req_body['client_authentication'] == [vpn_server_authentication_prototype_model] + assert req_body['client_ip_pool'] == '172.16.0.0/16' assert req_body['subnets'] == [subnet_identity_model] - assert req_body['dns'] == load_balancer_dns_prototype_model - assert req_body['is_private_path'] == True - assert req_body['listeners'] == [load_balancer_listener_prototype_load_balancer_context_model] - assert req_body['logging'] == load_balancer_logging_prototype_model - assert req_body['name'] == 'my-load-balancer' - assert req_body['pools'] == [load_balancer_pool_prototype_model] - assert req_body['profile'] == load_balancer_profile_identity_model + assert req_body['client_dns_server_ips'] == [ip_model] + assert req_body['client_idle_timeout'] == 600 + assert req_body['enable_split_tunneling'] == False + assert req_body['name'] == 'my-vpn-server' + assert req_body['port'] == 443 + assert req_body['protocol'] == 'udp' assert req_body['resource_group'] == resource_group_identity_model - assert req_body['route_mode'] == True assert req_body['security_groups'] == [security_group_identity_model] - def test_create_load_balancer_all_params_with_retries(self): - # Enable retries and run test_create_load_balancer_all_params. + def test_create_vpn_server_all_params_with_retries(self): + # Enable retries and run test_create_vpn_server_all_params. _service.enable_retries() - self.test_create_load_balancer_all_params() + self.test_create_vpn_server_all_params() - # Disable retries and run test_create_load_balancer_all_params. + # Disable retries and run test_create_vpn_server_all_params. _service.disable_retries() - self.test_create_load_balancer_all_params() + self.test_create_vpn_server_all_params() @responses.activate - def test_create_load_balancer_value_error(self): + def test_create_vpn_server_value_error(self): """ - test_create_load_balancer_value_error() + test_create_vpn_server_value_error() """ # Set up mock - url = preprocess_url('/load_balancers') - mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' + url = preprocess_url('/vpn_servers') + mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -42606,154 +44122,83 @@ def test_create_load_balancer_value_error(self): status=201, ) + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' + + # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model + vpn_server_authentication_by_username_id_provider_model = {} + vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' + + # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model + vpn_server_authentication_prototype_model = {} + vpn_server_authentication_prototype_model['method'] = 'username' + vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model + # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - # Construct a dict representation of a DNSInstanceIdentityByCRN model - dns_instance_identity_model = {} - dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' + # Construct a dict representation of a IP model + ip_model = {} + ip_model['address'] = '192.168.3.4' - # Construct a dict representation of a DNSZoneIdentityById model - dns_zone_identity_model = {} - dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' - - # Construct a dict representation of a LoadBalancerDNSPrototype model - load_balancer_dns_prototype_model = {} - load_balancer_dns_prototype_model['instance'] = dns_instance_identity_model - load_balancer_dns_prototype_model['zone'] = dns_zone_identity_model - - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a LoadBalancerPoolIdentityByName model - load_balancer_pool_identity_by_name_model = {} - load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' - - # Construct a dict representation of a LoadBalancerListenerIdentityById model - load_balancer_listener_identity_model = {} - load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model - load_balancer_listener_https_redirect_prototype_model = {} - load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 - load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model - load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' - - # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model - load_balancer_listener_prototype_load_balancer_context_model = {} - load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True - load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model - load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000 - load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model - load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model - load_balancer_listener_prototype_load_balancer_context_model['idle_connection_timeout'] = 100 - load_balancer_listener_prototype_load_balancer_context_model['port'] = 443 - load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499 - load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443 - load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http' - - # Construct a dict representation of a LoadBalancerLoggingDatapathPrototype model - load_balancer_logging_datapath_prototype_model = {} - load_balancer_logging_datapath_prototype_model['active'] = True - - # Construct a dict representation of a LoadBalancerLoggingPrototype model - load_balancer_logging_prototype_model = {} - load_balancer_logging_prototype_model['datapath'] = load_balancer_logging_datapath_prototype_model - - # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model - load_balancer_pool_health_monitor_prototype_model = {} - load_balancer_pool_health_monitor_prototype_model['delay'] = 5 - load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2 - load_balancer_pool_health_monitor_prototype_model['port'] = 22 - load_balancer_pool_health_monitor_prototype_model['timeout'] = 2 - load_balancer_pool_health_monitor_prototype_model['type'] = 'http' - load_balancer_pool_health_monitor_prototype_model['url_path'] = '/' - - # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' - - # Construct a dict representation of a LoadBalancerPoolMemberPrototype model - load_balancer_pool_member_prototype_model = {} - load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model - load_balancer_pool_member_prototype_model['weight'] = 50 - - # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model - load_balancer_pool_session_persistence_prototype_model = {} - load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name' - load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie' - - # Construct a dict representation of a LoadBalancerPoolPrototype model - load_balancer_pool_prototype_model = {} - load_balancer_pool_prototype_model['algorithm'] = 'least_connections' - load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model - load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model] - load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool' - load_balancer_pool_prototype_model['protocol'] = 'http' - load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled' - load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model - - # Construct a dict representation of a LoadBalancerProfileIdentityByName model - load_balancer_profile_identity_model = {} - load_balancer_profile_identity_model['name'] = 'network-fixed' - - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' # Set up parameter values - is_public = True + certificate = certificate_instance_identity_model + client_authentication = [vpn_server_authentication_prototype_model] + client_ip_pool = '172.16.0.0/16' subnets = [subnet_identity_model] - dns = load_balancer_dns_prototype_model - is_private_path = True - listeners = [load_balancer_listener_prototype_load_balancer_context_model] - logging = load_balancer_logging_prototype_model - name = 'my-load-balancer' - pools = [load_balancer_pool_prototype_model] - profile = load_balancer_profile_identity_model + client_dns_server_ips = [ip_model] + client_idle_timeout = 600 + enable_split_tunneling = False + name = 'my-vpn-server' + port = 443 + protocol = 'udp' resource_group = resource_group_identity_model - route_mode = True security_groups = [security_group_identity_model] # Pass in all but one required param and check for a ValueError req_param_dict = { - "is_public": is_public, + "certificate": certificate, + "client_authentication": client_authentication, + "client_ip_pool": client_ip_pool, "subnets": subnets, } 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_load_balancer(**req_copy) + _service.create_vpn_server(**req_copy) - def test_create_load_balancer_value_error_with_retries(self): - # Enable retries and run test_create_load_balancer_value_error. + def test_create_vpn_server_value_error_with_retries(self): + # Enable retries and run test_create_vpn_server_value_error. _service.enable_retries() - self.test_create_load_balancer_value_error() + self.test_create_vpn_server_value_error() - # Disable retries and run test_create_load_balancer_value_error. + # Disable retries and run test_create_vpn_server_value_error. _service.disable_retries() - self.test_create_load_balancer_value_error() + self.test_create_vpn_server_value_error() -class TestDeleteLoadBalancer: +class TestDeleteVpnServer: """ - Test Class for delete_load_balancer + Test Class for delete_vpn_server """ @responses.activate - def test_delete_load_balancer_all_params(self): + def test_delete_vpn_server_all_params(self): """ - delete_load_balancer() + delete_vpn_server() """ # Set up mock - url = preprocess_url('/load_balancers/testString') + url = preprocess_url('/vpn_servers/testString') responses.add( responses.DELETE, url, @@ -42765,7 +44210,7 @@ def test_delete_load_balancer_all_params(self): if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method - response = _service.delete_load_balancer( + response = _service.delete_vpn_server( id, if_match=if_match, headers={}, @@ -42775,22 +44220,22 @@ def test_delete_load_balancer_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 202 - def test_delete_load_balancer_all_params_with_retries(self): - # Enable retries and run test_delete_load_balancer_all_params. + def test_delete_vpn_server_all_params_with_retries(self): + # Enable retries and run test_delete_vpn_server_all_params. _service.enable_retries() - self.test_delete_load_balancer_all_params() + self.test_delete_vpn_server_all_params() - # Disable retries and run test_delete_load_balancer_all_params. + # Disable retries and run test_delete_vpn_server_all_params. _service.disable_retries() - self.test_delete_load_balancer_all_params() + self.test_delete_vpn_server_all_params() @responses.activate - def test_delete_load_balancer_required_params(self): + def test_delete_vpn_server_required_params(self): """ - test_delete_load_balancer_required_params() + test_delete_vpn_server_required_params() """ # Set up mock - url = preprocess_url('/load_balancers/testString') + url = preprocess_url('/vpn_servers/testString') responses.add( responses.DELETE, url, @@ -42801,7 +44246,7 @@ def test_delete_load_balancer_required_params(self): id = 'testString' # Invoke method - response = _service.delete_load_balancer( + response = _service.delete_vpn_server( id, headers={}, ) @@ -42810,22 +44255,22 @@ def test_delete_load_balancer_required_params(self): assert len(responses.calls) == 1 assert response.status_code == 202 - def test_delete_load_balancer_required_params_with_retries(self): - # Enable retries and run test_delete_load_balancer_required_params. + def test_delete_vpn_server_required_params_with_retries(self): + # Enable retries and run test_delete_vpn_server_required_params. _service.enable_retries() - self.test_delete_load_balancer_required_params() + self.test_delete_vpn_server_required_params() - # Disable retries and run test_delete_load_balancer_required_params. + # Disable retries and run test_delete_vpn_server_required_params. _service.disable_retries() - self.test_delete_load_balancer_required_params() + self.test_delete_vpn_server_required_params() @responses.activate - def test_delete_load_balancer_value_error(self): + def test_delete_vpn_server_value_error(self): """ - test_delete_load_balancer_value_error() + test_delete_vpn_server_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString') + url = preprocess_url('/vpn_servers/testString') responses.add( responses.DELETE, url, @@ -42842,31 +44287,31 @@ def test_delete_load_balancer_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.delete_load_balancer(**req_copy) + _service.delete_vpn_server(**req_copy) - def test_delete_load_balancer_value_error_with_retries(self): - # Enable retries and run test_delete_load_balancer_value_error. + def test_delete_vpn_server_value_error_with_retries(self): + # Enable retries and run test_delete_vpn_server_value_error. _service.enable_retries() - self.test_delete_load_balancer_value_error() + self.test_delete_vpn_server_value_error() - # Disable retries and run test_delete_load_balancer_value_error. + # Disable retries and run test_delete_vpn_server_value_error. _service.disable_retries() - self.test_delete_load_balancer_value_error() + self.test_delete_vpn_server_value_error() -class TestGetLoadBalancer: +class TestGetVpnServer: """ - Test Class for get_load_balancer + Test Class for get_vpn_server """ @responses.activate - def test_get_load_balancer_all_params(self): + def test_get_vpn_server_all_params(self): """ - get_load_balancer() + get_vpn_server() """ # Set up mock - url = preprocess_url('/load_balancers/testString') - mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' + url = preprocess_url('/vpn_servers/testString') + mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -42879,7 +44324,7 @@ def test_get_load_balancer_all_params(self): id = 'testString' # Invoke method - response = _service.get_load_balancer( + response = _service.get_vpn_server( id, headers={}, ) @@ -42888,23 +44333,23 @@ def test_get_load_balancer_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_load_balancer_all_params_with_retries(self): - # Enable retries and run test_get_load_balancer_all_params. + def test_get_vpn_server_all_params_with_retries(self): + # Enable retries and run test_get_vpn_server_all_params. _service.enable_retries() - self.test_get_load_balancer_all_params() + self.test_get_vpn_server_all_params() - # Disable retries and run test_get_load_balancer_all_params. + # Disable retries and run test_get_vpn_server_all_params. _service.disable_retries() - self.test_get_load_balancer_all_params() + self.test_get_vpn_server_all_params() @responses.activate - def test_get_load_balancer_value_error(self): + def test_get_vpn_server_value_error(self): """ - test_get_load_balancer_value_error() + test_get_vpn_server_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString') - mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' + url = preprocess_url('/vpn_servers/testString') + mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -42923,31 +44368,31 @@ def test_get_load_balancer_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_load_balancer(**req_copy) + _service.get_vpn_server(**req_copy) - def test_get_load_balancer_value_error_with_retries(self): - # Enable retries and run test_get_load_balancer_value_error. + def test_get_vpn_server_value_error_with_retries(self): + # Enable retries and run test_get_vpn_server_value_error. _service.enable_retries() - self.test_get_load_balancer_value_error() + self.test_get_vpn_server_value_error() - # Disable retries and run test_get_load_balancer_value_error. + # Disable retries and run test_get_vpn_server_value_error. _service.disable_retries() - self.test_get_load_balancer_value_error() + self.test_get_vpn_server_value_error() -class TestUpdateLoadBalancer: +class TestUpdateVpnServer: """ - Test Class for update_load_balancer + Test Class for update_vpn_server """ @responses.activate - def test_update_load_balancer_all_params(self): + def test_update_vpn_server_all_params(self): """ - update_load_balancer() + update_vpn_server() """ # Set up mock - url = preprocess_url('/load_balancers/testString') - mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' + url = preprocess_url('/vpn_servers/testString') + mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -42956,47 +44401,49 @@ def test_update_load_balancer_all_params(self): status=200, ) - # Construct a dict representation of a DNSInstanceIdentityByCRN model - dns_instance_identity_model = {} - dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' - - # Construct a dict representation of a DNSZoneIdentityById model - dns_zone_identity_model = {} - dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a dict representation of a LoadBalancerDNSPatch model - load_balancer_dns_patch_model = {} - load_balancer_dns_patch_model['instance'] = dns_instance_identity_model - load_balancer_dns_patch_model['zone'] = dns_zone_identity_model + # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model + vpn_server_authentication_by_username_id_provider_model = {} + vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' - # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model - load_balancer_logging_datapath_patch_model = {} - load_balancer_logging_datapath_patch_model['active'] = True + # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model + vpn_server_authentication_prototype_model = {} + vpn_server_authentication_prototype_model['method'] = 'username' + vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model - # Construct a dict representation of a LoadBalancerLoggingPatch model - load_balancer_logging_patch_model = {} - load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model + # Construct a dict representation of a IP model + ip_model = {} + ip_model['address'] = '192.168.3.4' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - # Construct a dict representation of a LoadBalancerPatch model - load_balancer_patch_model = {} - load_balancer_patch_model['dns'] = load_balancer_dns_patch_model - load_balancer_patch_model['logging'] = load_balancer_logging_patch_model - load_balancer_patch_model['name'] = 'my-load-balancer' - load_balancer_patch_model['subnets'] = [subnet_identity_model] + # Construct a dict representation of a VPNServerPatch model + vpn_server_patch_model = {} + vpn_server_patch_model['certificate'] = certificate_instance_identity_model + vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model] + vpn_server_patch_model['client_dns_server_ips'] = [ip_model] + vpn_server_patch_model['client_idle_timeout'] = 600 + vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16' + vpn_server_patch_model['enable_split_tunneling'] = True + vpn_server_patch_model['name'] = 'my-vpn-server' + vpn_server_patch_model['port'] = 443 + vpn_server_patch_model['protocol'] = 'tcp' + vpn_server_patch_model['subnets'] = [subnet_identity_model] # Set up parameter values id = 'testString' - load_balancer_patch = load_balancer_patch_model + vpn_server_patch = vpn_server_patch_model if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method - response = _service.update_load_balancer( + response = _service.update_vpn_server( id, - load_balancer_patch, + vpn_server_patch, if_match=if_match, headers={}, ) @@ -43006,25 +44453,25 @@ def test_update_load_balancer_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == load_balancer_patch + assert req_body == vpn_server_patch - def test_update_load_balancer_all_params_with_retries(self): - # Enable retries and run test_update_load_balancer_all_params. + def test_update_vpn_server_all_params_with_retries(self): + # Enable retries and run test_update_vpn_server_all_params. _service.enable_retries() - self.test_update_load_balancer_all_params() + self.test_update_vpn_server_all_params() - # Disable retries and run test_update_load_balancer_all_params. + # Disable retries and run test_update_vpn_server_all_params. _service.disable_retries() - self.test_update_load_balancer_all_params() + self.test_update_vpn_server_all_params() @responses.activate - def test_update_load_balancer_required_params(self): + def test_update_vpn_server_required_params(self): """ - test_update_load_balancer_required_params() + test_update_vpn_server_required_params() """ # Set up mock - url = preprocess_url('/load_balancers/testString') - mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' + url = preprocess_url('/vpn_servers/testString') + mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -43033,46 +44480,48 @@ def test_update_load_balancer_required_params(self): status=200, ) - # Construct a dict representation of a DNSInstanceIdentityByCRN model - dns_instance_identity_model = {} - dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' - - # Construct a dict representation of a DNSZoneIdentityById model - dns_zone_identity_model = {} - dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a dict representation of a LoadBalancerDNSPatch model - load_balancer_dns_patch_model = {} - load_balancer_dns_patch_model['instance'] = dns_instance_identity_model - load_balancer_dns_patch_model['zone'] = dns_zone_identity_model + # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model + vpn_server_authentication_by_username_id_provider_model = {} + vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' - # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model - load_balancer_logging_datapath_patch_model = {} - load_balancer_logging_datapath_patch_model['active'] = True + # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model + vpn_server_authentication_prototype_model = {} + vpn_server_authentication_prototype_model['method'] = 'username' + vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model - # Construct a dict representation of a LoadBalancerLoggingPatch model - load_balancer_logging_patch_model = {} - load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model + # Construct a dict representation of a IP model + ip_model = {} + ip_model['address'] = '192.168.3.4' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - # Construct a dict representation of a LoadBalancerPatch model - load_balancer_patch_model = {} - load_balancer_patch_model['dns'] = load_balancer_dns_patch_model - load_balancer_patch_model['logging'] = load_balancer_logging_patch_model - load_balancer_patch_model['name'] = 'my-load-balancer' - load_balancer_patch_model['subnets'] = [subnet_identity_model] + # Construct a dict representation of a VPNServerPatch model + vpn_server_patch_model = {} + vpn_server_patch_model['certificate'] = certificate_instance_identity_model + vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model] + vpn_server_patch_model['client_dns_server_ips'] = [ip_model] + vpn_server_patch_model['client_idle_timeout'] = 600 + vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16' + vpn_server_patch_model['enable_split_tunneling'] = True + vpn_server_patch_model['name'] = 'my-vpn-server' + vpn_server_patch_model['port'] = 443 + vpn_server_patch_model['protocol'] = 'tcp' + vpn_server_patch_model['subnets'] = [subnet_identity_model] # Set up parameter values id = 'testString' - load_balancer_patch = load_balancer_patch_model + vpn_server_patch = vpn_server_patch_model # Invoke method - response = _service.update_load_balancer( + response = _service.update_vpn_server( id, - load_balancer_patch, + vpn_server_patch, headers={}, ) @@ -43081,25 +44530,25 @@ def test_update_load_balancer_required_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == load_balancer_patch + assert req_body == vpn_server_patch - def test_update_load_balancer_required_params_with_retries(self): - # Enable retries and run test_update_load_balancer_required_params. + def test_update_vpn_server_required_params_with_retries(self): + # Enable retries and run test_update_vpn_server_required_params. _service.enable_retries() - self.test_update_load_balancer_required_params() + self.test_update_vpn_server_required_params() - # Disable retries and run test_update_load_balancer_required_params. + # Disable retries and run test_update_vpn_server_required_params. _service.disable_retries() - self.test_update_load_balancer_required_params() + self.test_update_vpn_server_required_params() @responses.activate - def test_update_load_balancer_value_error(self): + def test_update_vpn_server_value_error(self): """ - test_update_load_balancer_value_error() + test_update_vpn_server_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString') - mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' + url = preprocess_url('/vpn_servers/testString') + mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "tcp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -43108,80 +44557,82 @@ def test_update_load_balancer_value_error(self): status=200, ) - # Construct a dict representation of a DNSInstanceIdentityByCRN model - dns_instance_identity_model = {} - dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' - - # Construct a dict representation of a DNSZoneIdentityById model - dns_zone_identity_model = {} - dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a dict representation of a LoadBalancerDNSPatch model - load_balancer_dns_patch_model = {} - load_balancer_dns_patch_model['instance'] = dns_instance_identity_model - load_balancer_dns_patch_model['zone'] = dns_zone_identity_model + # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model + vpn_server_authentication_by_username_id_provider_model = {} + vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam' - # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model - load_balancer_logging_datapath_patch_model = {} - load_balancer_logging_datapath_patch_model['active'] = True + # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model + vpn_server_authentication_prototype_model = {} + vpn_server_authentication_prototype_model['method'] = 'username' + vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model - # Construct a dict representation of a LoadBalancerLoggingPatch model - load_balancer_logging_patch_model = {} - load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model + # Construct a dict representation of a IP model + ip_model = {} + ip_model['address'] = '192.168.3.4' # Construct a dict representation of a SubnetIdentityById model subnet_identity_model = {} subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - # Construct a dict representation of a LoadBalancerPatch model - load_balancer_patch_model = {} - load_balancer_patch_model['dns'] = load_balancer_dns_patch_model - load_balancer_patch_model['logging'] = load_balancer_logging_patch_model - load_balancer_patch_model['name'] = 'my-load-balancer' - load_balancer_patch_model['subnets'] = [subnet_identity_model] + # Construct a dict representation of a VPNServerPatch model + vpn_server_patch_model = {} + vpn_server_patch_model['certificate'] = certificate_instance_identity_model + vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model] + vpn_server_patch_model['client_dns_server_ips'] = [ip_model] + vpn_server_patch_model['client_idle_timeout'] = 600 + vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16' + vpn_server_patch_model['enable_split_tunneling'] = True + vpn_server_patch_model['name'] = 'my-vpn-server' + vpn_server_patch_model['port'] = 443 + vpn_server_patch_model['protocol'] = 'tcp' + vpn_server_patch_model['subnets'] = [subnet_identity_model] # Set up parameter values id = 'testString' - load_balancer_patch = load_balancer_patch_model + vpn_server_patch = vpn_server_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { "id": id, - "load_balancer_patch": load_balancer_patch, + "vpn_server_patch": vpn_server_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_load_balancer(**req_copy) + _service.update_vpn_server(**req_copy) - def test_update_load_balancer_value_error_with_retries(self): - # Enable retries and run test_update_load_balancer_value_error. + def test_update_vpn_server_value_error_with_retries(self): + # Enable retries and run test_update_vpn_server_value_error. _service.enable_retries() - self.test_update_load_balancer_value_error() + self.test_update_vpn_server_value_error() - # Disable retries and run test_update_load_balancer_value_error. + # Disable retries and run test_update_vpn_server_value_error. _service.disable_retries() - self.test_update_load_balancer_value_error() + self.test_update_vpn_server_value_error() -class TestGetLoadBalancerStatistics: +class TestGetVpnServerClientConfiguration: """ - Test Class for get_load_balancer_statistics + Test Class for get_vpn_server_client_configuration """ @responses.activate - def test_get_load_balancer_statistics_all_params(self): + def test_get_vpn_server_client_configuration_all_params(self): """ - get_load_balancer_statistics() + get_vpn_server_client_configuration() """ # Set up mock - url = preprocess_url('/load_balancers/testString/statistics') - mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}' + url = preprocess_url('/vpn_servers/testString/client_configuration') + mock_response = '"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n"' responses.add( responses.GET, url, body=mock_response, - content_type='application/json', + content_type='text/plain', status=200, ) @@ -43189,7 +44640,7 @@ def test_get_load_balancer_statistics_all_params(self): id = 'testString' # Invoke method - response = _service.get_load_balancer_statistics( + response = _service.get_vpn_server_client_configuration( id, headers={}, ) @@ -43198,28 +44649,28 @@ def test_get_load_balancer_statistics_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_load_balancer_statistics_all_params_with_retries(self): - # Enable retries and run test_get_load_balancer_statistics_all_params. + def test_get_vpn_server_client_configuration_all_params_with_retries(self): + # Enable retries and run test_get_vpn_server_client_configuration_all_params. _service.enable_retries() - self.test_get_load_balancer_statistics_all_params() + self.test_get_vpn_server_client_configuration_all_params() - # Disable retries and run test_get_load_balancer_statistics_all_params. + # Disable retries and run test_get_vpn_server_client_configuration_all_params. _service.disable_retries() - self.test_get_load_balancer_statistics_all_params() + self.test_get_vpn_server_client_configuration_all_params() @responses.activate - def test_get_load_balancer_statistics_value_error(self): + def test_get_vpn_server_client_configuration_value_error(self): """ - test_get_load_balancer_statistics_value_error() + test_get_vpn_server_client_configuration_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/statistics') - mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}' + url = preprocess_url('/vpn_servers/testString/client_configuration') + mock_response = '"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n"' responses.add( responses.GET, url, body=mock_response, - content_type='application/json', + content_type='text/plain', status=200, ) @@ -43233,31 +44684,31 @@ def test_get_load_balancer_statistics_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_load_balancer_statistics(**req_copy) + _service.get_vpn_server_client_configuration(**req_copy) - def test_get_load_balancer_statistics_value_error_with_retries(self): - # Enable retries and run test_get_load_balancer_statistics_value_error. + def test_get_vpn_server_client_configuration_value_error_with_retries(self): + # Enable retries and run test_get_vpn_server_client_configuration_value_error. _service.enable_retries() - self.test_get_load_balancer_statistics_value_error() + self.test_get_vpn_server_client_configuration_value_error() - # Disable retries and run test_get_load_balancer_statistics_value_error. + # Disable retries and run test_get_vpn_server_client_configuration_value_error. _service.disable_retries() - self.test_get_load_balancer_statistics_value_error() + self.test_get_vpn_server_client_configuration_value_error() -class TestListLoadBalancerListeners: +class TestListVpnServerClients: """ - Test Class for list_load_balancer_listeners + Test Class for list_vpn_server_clients """ @responses.activate - def test_list_load_balancer_listeners_all_params(self): + def test_list_vpn_server_clients_all_params(self): """ - list_load_balancer_listeners() + list_vpn_server_clients() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' + url = preprocess_url('/vpn_servers/testString/clients') + mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -43267,35 +44718,47 @@ def test_list_load_balancer_listeners_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' + vpn_server_id = 'testString' + start = 'testString' + limit = 50 + sort = 'created_at' # Invoke method - response = _service.list_load_balancer_listeners( - load_balancer_id, - headers={}, - ) - + response = _service.list_vpn_server_clients( + vpn_server_id, + start=start, + limit=limit, + sort=sort, + headers={}, + ) + # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'sort={}'.format(sort) in query_string - def test_list_load_balancer_listeners_all_params_with_retries(self): - # Enable retries and run test_list_load_balancer_listeners_all_params. + def test_list_vpn_server_clients_all_params_with_retries(self): + # Enable retries and run test_list_vpn_server_clients_all_params. _service.enable_retries() - self.test_list_load_balancer_listeners_all_params() + self.test_list_vpn_server_clients_all_params() - # Disable retries and run test_list_load_balancer_listeners_all_params. + # Disable retries and run test_list_vpn_server_clients_all_params. _service.disable_retries() - self.test_list_load_balancer_listeners_all_params() + self.test_list_vpn_server_clients_all_params() @responses.activate - def test_list_load_balancer_listeners_value_error(self): + def test_list_vpn_server_clients_required_params(self): """ - test_list_load_balancer_listeners_value_error() + test_list_vpn_server_clients_required_params() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' + url = preprocess_url('/vpn_servers/testString/clients') + mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -43305,241 +44768,150 @@ def test_list_load_balancer_listeners_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "load_balancer_id": load_balancer_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.list_load_balancer_listeners(**req_copy) - - def test_list_load_balancer_listeners_value_error_with_retries(self): - # Enable retries and run test_list_load_balancer_listeners_value_error. - _service.enable_retries() - self.test_list_load_balancer_listeners_value_error() - - # Disable retries and run test_list_load_balancer_listeners_value_error. - _service.disable_retries() - self.test_list_load_balancer_listeners_value_error() - - -class TestCreateLoadBalancerListener: - """ - Test Class for create_load_balancer_listener - """ - - @responses.activate - def test_create_load_balancer_listener_all_params(self): - """ - create_load_balancer_listener() - """ - # Set up mock - url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' - responses.add( - responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201, - ) - - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a LoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerIdentityById model - load_balancer_listener_identity_model = {} - load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model - load_balancer_listener_https_redirect_prototype_model = {} - load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 - load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model - load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' - - # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model - load_balancer_listener_policy_rule_prototype_model = {} - load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_prototype_model['type'] = 'body' - load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' - - # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - load_balancer_listener_policy_target_prototype_model = {} - load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model - load_balancer_listener_policy_prototype_model = {} - load_balancer_listener_policy_prototype_model['action'] = 'forward' - load_balancer_listener_policy_prototype_model['name'] = 'my-policy' - load_balancer_listener_policy_prototype_model['priority'] = 5 - load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model] - load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model - - # Set up parameter values - load_balancer_id = 'testString' - protocol = 'http' - accept_proxy_protocol = True - certificate_instance = certificate_instance_identity_model - connection_limit = 2000 - default_pool = load_balancer_pool_identity_model - https_redirect = load_balancer_listener_https_redirect_prototype_model - idle_connection_timeout = 100 - policies = [load_balancer_listener_policy_prototype_model] - port = 443 - port_max = 499 - port_min = 443 + vpn_server_id = 'testString' # Invoke method - response = _service.create_load_balancer_listener( - load_balancer_id, - protocol, - accept_proxy_protocol=accept_proxy_protocol, - certificate_instance=certificate_instance, - connection_limit=connection_limit, - default_pool=default_pool, - https_redirect=https_redirect, - idle_connection_timeout=idle_connection_timeout, - policies=policies, - port=port, - port_max=port_max, - port_min=port_min, + response = _service.list_vpn_server_clients( + vpn_server_id, 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['protocol'] == 'http' - assert req_body['accept_proxy_protocol'] == True - assert req_body['certificate_instance'] == certificate_instance_identity_model - assert req_body['connection_limit'] == 2000 - assert req_body['default_pool'] == load_balancer_pool_identity_model - assert req_body['https_redirect'] == load_balancer_listener_https_redirect_prototype_model - assert req_body['idle_connection_timeout'] == 100 - assert req_body['policies'] == [load_balancer_listener_policy_prototype_model] - assert req_body['port'] == 443 - assert req_body['port_max'] == 499 - assert req_body['port_min'] == 443 + assert response.status_code == 200 - def test_create_load_balancer_listener_all_params_with_retries(self): - # Enable retries and run test_create_load_balancer_listener_all_params. + def test_list_vpn_server_clients_required_params_with_retries(self): + # Enable retries and run test_list_vpn_server_clients_required_params. _service.enable_retries() - self.test_create_load_balancer_listener_all_params() + self.test_list_vpn_server_clients_required_params() - # Disable retries and run test_create_load_balancer_listener_all_params. + # Disable retries and run test_list_vpn_server_clients_required_params. _service.disable_retries() - self.test_create_load_balancer_listener_all_params() + self.test_list_vpn_server_clients_required_params() @responses.activate - def test_create_load_balancer_listener_value_error(self): + def test_list_vpn_server_clients_value_error(self): """ - test_create_load_balancer_listener_value_error() + test_list_vpn_server_clients_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + url = preprocess_url('/vpn_servers/testString/clients') + mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a LoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - load_balancer_pool_identity_model = {} - load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerIdentityById model - load_balancer_listener_identity_model = {} - load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model - load_balancer_listener_https_redirect_prototype_model = {} - load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 - load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model - load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' - - # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model - load_balancer_listener_policy_rule_prototype_model = {} - load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_prototype_model['type'] = 'body' - load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' - - # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - load_balancer_listener_policy_target_prototype_model = {} - load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model - load_balancer_listener_policy_prototype_model = {} - load_balancer_listener_policy_prototype_model['action'] = 'forward' - load_balancer_listener_policy_prototype_model['name'] = 'my-policy' - load_balancer_listener_policy_prototype_model['priority'] = 5 - load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model] - load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model - # Set up parameter values - load_balancer_id = 'testString' - protocol = 'http' - accept_proxy_protocol = True - certificate_instance = certificate_instance_identity_model - connection_limit = 2000 - default_pool = load_balancer_pool_identity_model - https_redirect = load_balancer_listener_https_redirect_prototype_model - idle_connection_timeout = 100 - policies = [load_balancer_listener_policy_prototype_model] - port = 443 - port_max = 499 - port_min = 443 + vpn_server_id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "protocol": protocol, + "vpn_server_id": vpn_server_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.create_load_balancer_listener(**req_copy) + _service.list_vpn_server_clients(**req_copy) - def test_create_load_balancer_listener_value_error_with_retries(self): - # Enable retries and run test_create_load_balancer_listener_value_error. + def test_list_vpn_server_clients_value_error_with_retries(self): + # Enable retries and run test_list_vpn_server_clients_value_error. _service.enable_retries() - self.test_create_load_balancer_listener_value_error() + self.test_list_vpn_server_clients_value_error() - # Disable retries and run test_create_load_balancer_listener_value_error. + # Disable retries and run test_list_vpn_server_clients_value_error. _service.disable_retries() - self.test_create_load_balancer_listener_value_error() + self.test_list_vpn_server_clients_value_error() + + @responses.activate + def test_list_vpn_server_clients_with_pager_get_next(self): + """ + test_list_vpn_server_clients_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers/testString/clients') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + # Exercise the pager class for this operation + all_results = [] + pager = VpnServerClientsPager( + client=_service, + vpn_server_id='testString', + limit=10, + sort='created_at', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 -class TestDeleteLoadBalancerListener: + @responses.activate + def test_list_vpn_server_clients_with_pager_get_all(self): + """ + test_list_vpn_server_clients_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers/testString/clients') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = VpnServerClientsPager( + client=_service, + vpn_server_id='testString', + limit=10, + sort='created_at', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestDeleteVpnServerClient: """ - Test Class for delete_load_balancer_listener + Test Class for delete_vpn_server_client """ @responses.activate - def test_delete_load_balancer_listener_all_params(self): + def test_delete_vpn_server_client_all_params(self): """ - delete_load_balancer_listener() + delete_vpn_server_client() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString') + url = preprocess_url('/vpn_servers/testString/clients/testString') responses.add( responses.DELETE, url, @@ -43547,12 +44919,12 @@ def test_delete_load_balancer_listener_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' + vpn_server_id = 'testString' id = 'testString' # Invoke method - response = _service.delete_load_balancer_listener( - load_balancer_id, + response = _service.delete_vpn_server_client( + vpn_server_id, id, headers={}, ) @@ -43561,22 +44933,22 @@ def test_delete_load_balancer_listener_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 202 - def test_delete_load_balancer_listener_all_params_with_retries(self): - # Enable retries and run test_delete_load_balancer_listener_all_params. + def test_delete_vpn_server_client_all_params_with_retries(self): + # Enable retries and run test_delete_vpn_server_client_all_params. _service.enable_retries() - self.test_delete_load_balancer_listener_all_params() + self.test_delete_vpn_server_client_all_params() - # Disable retries and run test_delete_load_balancer_listener_all_params. + # Disable retries and run test_delete_vpn_server_client_all_params. _service.disable_retries() - self.test_delete_load_balancer_listener_all_params() + self.test_delete_vpn_server_client_all_params() @responses.activate - def test_delete_load_balancer_listener_value_error(self): + def test_delete_vpn_server_client_value_error(self): """ - test_delete_load_balancer_listener_value_error() + test_delete_vpn_server_client_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString') + url = preprocess_url('/vpn_servers/testString/clients/testString') responses.add( responses.DELETE, url, @@ -43584,42 +44956,42 @@ def test_delete_load_balancer_listener_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' + vpn_server_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, + "vpn_server_id": vpn_server_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.delete_load_balancer_listener(**req_copy) + _service.delete_vpn_server_client(**req_copy) - def test_delete_load_balancer_listener_value_error_with_retries(self): - # Enable retries and run test_delete_load_balancer_listener_value_error. + def test_delete_vpn_server_client_value_error_with_retries(self): + # Enable retries and run test_delete_vpn_server_client_value_error. _service.enable_retries() - self.test_delete_load_balancer_listener_value_error() + self.test_delete_vpn_server_client_value_error() - # Disable retries and run test_delete_load_balancer_listener_value_error. + # Disable retries and run test_delete_vpn_server_client_value_error. _service.disable_retries() - self.test_delete_load_balancer_listener_value_error() + self.test_delete_vpn_server_client_value_error() -class TestGetLoadBalancerListener: +class TestGetVpnServerClient: """ - Test Class for get_load_balancer_listener + Test Class for get_vpn_server_client """ @responses.activate - def test_get_load_balancer_listener_all_params(self): + def test_get_vpn_server_client_all_params(self): """ - get_load_balancer_listener() + get_vpn_server_client() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + url = preprocess_url('/vpn_servers/testString/clients/testString') + mock_response = '{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}' responses.add( responses.GET, url, @@ -43629,12 +45001,12 @@ def test_get_load_balancer_listener_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' + vpn_server_id = 'testString' id = 'testString' # Invoke method - response = _service.get_load_balancer_listener( - load_balancer_id, + response = _service.get_vpn_server_client( + vpn_server_id, id, headers={}, ) @@ -43643,23 +45015,23 @@ def test_get_load_balancer_listener_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_load_balancer_listener_all_params_with_retries(self): - # Enable retries and run test_get_load_balancer_listener_all_params. + def test_get_vpn_server_client_all_params_with_retries(self): + # Enable retries and run test_get_vpn_server_client_all_params. _service.enable_retries() - self.test_get_load_balancer_listener_all_params() + self.test_get_vpn_server_client_all_params() - # Disable retries and run test_get_load_balancer_listener_all_params. + # Disable retries and run test_get_vpn_server_client_all_params. _service.disable_retries() - self.test_get_load_balancer_listener_all_params() + self.test_get_vpn_server_client_all_params() @responses.activate - def test_get_load_balancer_listener_value_error(self): + def test_get_vpn_server_client_value_error(self): """ - test_get_load_balancer_listener_value_error() + test_get_vpn_server_client_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + url = preprocess_url('/vpn_servers/testString/clients/testString') + mock_response = '{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}' responses.add( responses.GET, url, @@ -43669,196 +45041,121 @@ def test_get_load_balancer_listener_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' + vpn_server_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, + "vpn_server_id": vpn_server_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_load_balancer_listener(**req_copy) + _service.get_vpn_server_client(**req_copy) - def test_get_load_balancer_listener_value_error_with_retries(self): - # Enable retries and run test_get_load_balancer_listener_value_error. + def test_get_vpn_server_client_value_error_with_retries(self): + # Enable retries and run test_get_vpn_server_client_value_error. _service.enable_retries() - self.test_get_load_balancer_listener_value_error() + self.test_get_vpn_server_client_value_error() - # Disable retries and run test_get_load_balancer_listener_value_error. + # Disable retries and run test_get_vpn_server_client_value_error. _service.disable_retries() - self.test_get_load_balancer_listener_value_error() + self.test_get_vpn_server_client_value_error() -class TestUpdateLoadBalancerListener: +class TestDisconnectVpnClient: """ - Test Class for update_load_balancer_listener + Test Class for disconnect_vpn_client """ @responses.activate - def test_update_load_balancer_listener_all_params(self): + def test_disconnect_vpn_client_all_params(self): """ - update_load_balancer_listener() + disconnect_vpn_client() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + url = preprocess_url('/vpn_servers/testString/clients/testString/disconnect') responses.add( - responses.PATCH, + responses.POST, url, - body=mock_response, - content_type='application/json', - status=200, + status=202, ) - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById model - load_balancer_listener_default_pool_patch_model = {} - load_balancer_listener_default_pool_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerIdentityById model - load_balancer_listener_identity_model = {} - load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model - load_balancer_listener_https_redirect_patch_model = {} - load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301 - load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model - load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get' - - # Construct a dict representation of a LoadBalancerListenerPatch model - load_balancer_listener_patch_model = {} - load_balancer_listener_patch_model['accept_proxy_protocol'] = True - load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model - load_balancer_listener_patch_model['connection_limit'] = 2000 - load_balancer_listener_patch_model['default_pool'] = load_balancer_listener_default_pool_patch_model - load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model - load_balancer_listener_patch_model['idle_connection_timeout'] = 100 - load_balancer_listener_patch_model['port'] = 443 - load_balancer_listener_patch_model['port_max'] = 499 - load_balancer_listener_patch_model['port_min'] = 443 - load_balancer_listener_patch_model['protocol'] = 'http' - # Set up parameter values - load_balancer_id = 'testString' + vpn_server_id = 'testString' id = 'testString' - load_balancer_listener_patch = load_balancer_listener_patch_model # Invoke method - response = _service.update_load_balancer_listener( - load_balancer_id, + response = _service.disconnect_vpn_client( + vpn_server_id, id, - load_balancer_listener_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate body params - req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == load_balancer_listener_patch + assert response.status_code == 202 - def test_update_load_balancer_listener_all_params_with_retries(self): - # Enable retries and run test_update_load_balancer_listener_all_params. + def test_disconnect_vpn_client_all_params_with_retries(self): + # Enable retries and run test_disconnect_vpn_client_all_params. _service.enable_retries() - self.test_update_load_balancer_listener_all_params() + self.test_disconnect_vpn_client_all_params() - # Disable retries and run test_update_load_balancer_listener_all_params. + # Disable retries and run test_disconnect_vpn_client_all_params. _service.disable_retries() - self.test_update_load_balancer_listener_all_params() + self.test_disconnect_vpn_client_all_params() @responses.activate - def test_update_load_balancer_listener_value_error(self): + def test_disconnect_vpn_client_value_error(self): """ - test_update_load_balancer_listener_value_error() + test_disconnect_vpn_client_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + url = preprocess_url('/vpn_servers/testString/clients/testString/disconnect') responses.add( - responses.PATCH, + responses.POST, url, - body=mock_response, - content_type='application/json', - status=200, + status=202, ) - # Construct a dict representation of a CertificateInstanceIdentityByCRN model - certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - - # Construct a dict representation of a LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById model - load_balancer_listener_default_pool_patch_model = {} - load_balancer_listener_default_pool_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerIdentityById model - load_balancer_listener_identity_model = {} - load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model - load_balancer_listener_https_redirect_patch_model = {} - load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301 - load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model - load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get' - - # Construct a dict representation of a LoadBalancerListenerPatch model - load_balancer_listener_patch_model = {} - load_balancer_listener_patch_model['accept_proxy_protocol'] = True - load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model - load_balancer_listener_patch_model['connection_limit'] = 2000 - load_balancer_listener_patch_model['default_pool'] = load_balancer_listener_default_pool_patch_model - load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model - load_balancer_listener_patch_model['idle_connection_timeout'] = 100 - load_balancer_listener_patch_model['port'] = 443 - load_balancer_listener_patch_model['port_max'] = 499 - load_balancer_listener_patch_model['port_min'] = 443 - load_balancer_listener_patch_model['protocol'] = 'http' - - # Set up parameter values - load_balancer_id = 'testString' - id = 'testString' - load_balancer_listener_patch = load_balancer_listener_patch_model + # Set up parameter values + vpn_server_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, + "vpn_server_id": vpn_server_id, "id": id, - "load_balancer_listener_patch": load_balancer_listener_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_load_balancer_listener(**req_copy) + _service.disconnect_vpn_client(**req_copy) - def test_update_load_balancer_listener_value_error_with_retries(self): - # Enable retries and run test_update_load_balancer_listener_value_error. + def test_disconnect_vpn_client_value_error_with_retries(self): + # Enable retries and run test_disconnect_vpn_client_value_error. _service.enable_retries() - self.test_update_load_balancer_listener_value_error() + self.test_disconnect_vpn_client_value_error() - # Disable retries and run test_update_load_balancer_listener_value_error. + # Disable retries and run test_disconnect_vpn_client_value_error. _service.disable_retries() - self.test_update_load_balancer_listener_value_error() + self.test_disconnect_vpn_client_value_error() -class TestListLoadBalancerListenerPolicies: +class TestListVpnServerRoutes: """ - Test Class for list_load_balancer_listener_policies + Test Class for list_vpn_server_routes """ @responses.activate - def test_list_load_balancer_listener_policies_all_params(self): + def test_list_vpn_server_routes_all_params(self): """ - list_load_balancer_listener_policies() + list_vpn_server_routes() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies') - mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}' + url = preprocess_url('/vpn_servers/testString/routes') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}' responses.add( responses.GET, url, @@ -43868,13 +45165,61 @@ def test_list_load_balancer_listener_policies_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' + vpn_server_id = 'testString' + start = 'testString' + limit = 50 + sort = 'name' # Invoke method - response = _service.list_load_balancer_listener_policies( - load_balancer_id, - listener_id, + response = _service.list_vpn_server_routes( + vpn_server_id, + start=start, + limit=limit, + sort=sort, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'sort={}'.format(sort) in query_string + + def test_list_vpn_server_routes_all_params_with_retries(self): + # Enable retries and run test_list_vpn_server_routes_all_params. + _service.enable_retries() + self.test_list_vpn_server_routes_all_params() + + # Disable retries and run test_list_vpn_server_routes_all_params. + _service.disable_retries() + self.test_list_vpn_server_routes_all_params() + + @responses.activate + def test_list_vpn_server_routes_required_params(self): + """ + test_list_vpn_server_routes_required_params() + """ + # Set up mock + url = preprocess_url('/vpn_servers/testString/routes') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + vpn_server_id = 'testString' + + # Invoke method + response = _service.list_vpn_server_routes( + vpn_server_id, headers={}, ) @@ -43882,23 +45227,23 @@ def test_list_load_balancer_listener_policies_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_load_balancer_listener_policies_all_params_with_retries(self): - # Enable retries and run test_list_load_balancer_listener_policies_all_params. + def test_list_vpn_server_routes_required_params_with_retries(self): + # Enable retries and run test_list_vpn_server_routes_required_params. _service.enable_retries() - self.test_list_load_balancer_listener_policies_all_params() + self.test_list_vpn_server_routes_required_params() - # Disable retries and run test_list_load_balancer_listener_policies_all_params. + # Disable retries and run test_list_vpn_server_routes_required_params. _service.disable_retries() - self.test_list_load_balancer_listener_policies_all_params() + self.test_list_vpn_server_routes_required_params() @responses.activate - def test_list_load_balancer_listener_policies_value_error(self): + def test_list_vpn_server_routes_value_error(self): """ - test_list_load_balancer_listener_policies_value_error() + test_list_vpn_server_routes_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies') - mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}' + url = preprocess_url('/vpn_servers/testString/routes') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}' responses.add( responses.GET, url, @@ -43908,42 +45253,113 @@ def test_list_load_balancer_listener_policies_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' + vpn_server_id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, + "vpn_server_id": vpn_server_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.list_load_balancer_listener_policies(**req_copy) + _service.list_vpn_server_routes(**req_copy) - def test_list_load_balancer_listener_policies_value_error_with_retries(self): - # Enable retries and run test_list_load_balancer_listener_policies_value_error. + def test_list_vpn_server_routes_value_error_with_retries(self): + # Enable retries and run test_list_vpn_server_routes_value_error. _service.enable_retries() - self.test_list_load_balancer_listener_policies_value_error() + self.test_list_vpn_server_routes_value_error() - # Disable retries and run test_list_load_balancer_listener_policies_value_error. + # Disable retries and run test_list_vpn_server_routes_value_error. _service.disable_retries() - self.test_list_load_balancer_listener_policies_value_error() + self.test_list_vpn_server_routes_value_error() + + @responses.activate + def test_list_vpn_server_routes_with_pager_get_next(self): + """ + test_list_vpn_server_routes_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers/testString/routes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + # Exercise the pager class for this operation + all_results = [] + pager = VpnServerRoutesPager( + client=_service, + vpn_server_id='testString', + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 -class TestCreateLoadBalancerListenerPolicy: + @responses.activate + def test_list_vpn_server_routes_with_pager_get_all(self): + """ + test_list_vpn_server_routes_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers/testString/routes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = VpnServerRoutesPager( + client=_service, + vpn_server_id='testString', + limit=10, + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateVpnServerRoute: """ - Test Class for create_load_balancer_listener_policy + Test Class for create_vpn_server_route """ @responses.activate - def test_create_load_balancer_listener_policy_all_params(self): + def test_create_vpn_server_route_all_params(self): """ - create_load_balancer_listener_policy() + create_vpn_server_route() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies') - mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' + url = preprocess_url('/vpn_servers/testString/routes') + mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' responses.add( responses.POST, url, @@ -43952,35 +45368,18 @@ def test_create_load_balancer_listener_policy_all_params(self): status=201, ) - # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model - load_balancer_listener_policy_rule_prototype_model = {} - load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_prototype_model['type'] = 'body' - load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' - - # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - load_balancer_listener_policy_target_prototype_model = {} - load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - action = 'forward' - priority = 5 - name = 'my-policy' - rules = [load_balancer_listener_policy_rule_prototype_model] - target = load_balancer_listener_policy_target_prototype_model + vpn_server_id = 'testString' + destination = '172.16.0.0/16' + action = 'deliver' + name = 'my-vpn-route-2' # Invoke method - response = _service.create_load_balancer_listener_policy( - load_balancer_id, - listener_id, - action, - priority, + response = _service.create_vpn_server_route( + vpn_server_id, + destination, + action=action, name=name, - rules=rules, - target=target, headers={}, ) @@ -43989,29 +45388,27 @@ def test_create_load_balancer_listener_policy_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['action'] == 'forward' - assert req_body['priority'] == 5 - assert req_body['name'] == 'my-policy' - assert req_body['rules'] == [load_balancer_listener_policy_rule_prototype_model] - assert req_body['target'] == load_balancer_listener_policy_target_prototype_model + assert req_body['destination'] == '172.16.0.0/16' + assert req_body['action'] == 'deliver' + assert req_body['name'] == 'my-vpn-route-2' - def test_create_load_balancer_listener_policy_all_params_with_retries(self): - # Enable retries and run test_create_load_balancer_listener_policy_all_params. + def test_create_vpn_server_route_all_params_with_retries(self): + # Enable retries and run test_create_vpn_server_route_all_params. _service.enable_retries() - self.test_create_load_balancer_listener_policy_all_params() + self.test_create_vpn_server_route_all_params() - # Disable retries and run test_create_load_balancer_listener_policy_all_params. + # Disable retries and run test_create_vpn_server_route_all_params. _service.disable_retries() - self.test_create_load_balancer_listener_policy_all_params() + self.test_create_vpn_server_route_all_params() @responses.activate - def test_create_load_balancer_listener_policy_value_error(self): + def test_create_vpn_server_route_value_error(self): """ - test_create_load_balancer_listener_policy_value_error() + test_create_vpn_server_route_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies') - mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' + url = preprocess_url('/vpn_servers/testString/routes') + mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' responses.add( responses.POST, url, @@ -44020,60 +45417,44 @@ def test_create_load_balancer_listener_policy_value_error(self): status=201, ) - # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model - load_balancer_listener_policy_rule_prototype_model = {} - load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' - load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_prototype_model['type'] = 'body' - load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' - - # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - load_balancer_listener_policy_target_prototype_model = {} - load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - action = 'forward' - priority = 5 - name = 'my-policy' - rules = [load_balancer_listener_policy_rule_prototype_model] - target = load_balancer_listener_policy_target_prototype_model + vpn_server_id = 'testString' + destination = '172.16.0.0/16' + action = 'deliver' + name = 'my-vpn-route-2' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, - "action": action, - "priority": priority, + "vpn_server_id": vpn_server_id, + "destination": destination, } 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_load_balancer_listener_policy(**req_copy) + _service.create_vpn_server_route(**req_copy) - def test_create_load_balancer_listener_policy_value_error_with_retries(self): - # Enable retries and run test_create_load_balancer_listener_policy_value_error. + def test_create_vpn_server_route_value_error_with_retries(self): + # Enable retries and run test_create_vpn_server_route_value_error. _service.enable_retries() - self.test_create_load_balancer_listener_policy_value_error() + self.test_create_vpn_server_route_value_error() - # Disable retries and run test_create_load_balancer_listener_policy_value_error. + # Disable retries and run test_create_vpn_server_route_value_error. _service.disable_retries() - self.test_create_load_balancer_listener_policy_value_error() + self.test_create_vpn_server_route_value_error() -class TestDeleteLoadBalancerListenerPolicy: +class TestDeleteVpnServerRoute: """ - Test Class for delete_load_balancer_listener_policy + Test Class for delete_vpn_server_route """ @responses.activate - def test_delete_load_balancer_listener_policy_all_params(self): + def test_delete_vpn_server_route_all_params(self): """ - delete_load_balancer_listener_policy() + delete_vpn_server_route() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') + url = preprocess_url('/vpn_servers/testString/routes/testString') responses.add( responses.DELETE, url, @@ -44081,14 +45462,12 @@ def test_delete_load_balancer_listener_policy_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' + vpn_server_id = 'testString' id = 'testString' # Invoke method - response = _service.delete_load_balancer_listener_policy( - load_balancer_id, - listener_id, + response = _service.delete_vpn_server_route( + vpn_server_id, id, headers={}, ) @@ -44097,22 +45476,22 @@ def test_delete_load_balancer_listener_policy_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 202 - def test_delete_load_balancer_listener_policy_all_params_with_retries(self): - # Enable retries and run test_delete_load_balancer_listener_policy_all_params. + def test_delete_vpn_server_route_all_params_with_retries(self): + # Enable retries and run test_delete_vpn_server_route_all_params. _service.enable_retries() - self.test_delete_load_balancer_listener_policy_all_params() + self.test_delete_vpn_server_route_all_params() - # Disable retries and run test_delete_load_balancer_listener_policy_all_params. + # Disable retries and run test_delete_vpn_server_route_all_params. _service.disable_retries() - self.test_delete_load_balancer_listener_policy_all_params() + self.test_delete_vpn_server_route_all_params() @responses.activate - def test_delete_load_balancer_listener_policy_value_error(self): + def test_delete_vpn_server_route_value_error(self): """ - test_delete_load_balancer_listener_policy_value_error() + test_delete_vpn_server_route_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') + url = preprocess_url('/vpn_servers/testString/routes/testString') responses.add( responses.DELETE, url, @@ -44120,44 +45499,42 @@ def test_delete_load_balancer_listener_policy_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' + vpn_server_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, + "vpn_server_id": vpn_server_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.delete_load_balancer_listener_policy(**req_copy) + _service.delete_vpn_server_route(**req_copy) - def test_delete_load_balancer_listener_policy_value_error_with_retries(self): - # Enable retries and run test_delete_load_balancer_listener_policy_value_error. + def test_delete_vpn_server_route_value_error_with_retries(self): + # Enable retries and run test_delete_vpn_server_route_value_error. _service.enable_retries() - self.test_delete_load_balancer_listener_policy_value_error() + self.test_delete_vpn_server_route_value_error() - # Disable retries and run test_delete_load_balancer_listener_policy_value_error. + # Disable retries and run test_delete_vpn_server_route_value_error. _service.disable_retries() - self.test_delete_load_balancer_listener_policy_value_error() + self.test_delete_vpn_server_route_value_error() -class TestGetLoadBalancerListenerPolicy: +class TestGetVpnServerRoute: """ - Test Class for get_load_balancer_listener_policy + Test Class for get_vpn_server_route """ @responses.activate - def test_get_load_balancer_listener_policy_all_params(self): + def test_get_vpn_server_route_all_params(self): """ - get_load_balancer_listener_policy() + get_vpn_server_route() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') - mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' + url = preprocess_url('/vpn_servers/testString/routes/testString') + mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' responses.add( responses.GET, url, @@ -44167,14 +45544,12 @@ def test_get_load_balancer_listener_policy_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' + vpn_server_id = 'testString' id = 'testString' # Invoke method - response = _service.get_load_balancer_listener_policy( - load_balancer_id, - listener_id, + response = _service.get_vpn_server_route( + vpn_server_id, id, headers={}, ) @@ -44183,23 +45558,23 @@ def test_get_load_balancer_listener_policy_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_load_balancer_listener_policy_all_params_with_retries(self): - # Enable retries and run test_get_load_balancer_listener_policy_all_params. + def test_get_vpn_server_route_all_params_with_retries(self): + # Enable retries and run test_get_vpn_server_route_all_params. _service.enable_retries() - self.test_get_load_balancer_listener_policy_all_params() + self.test_get_vpn_server_route_all_params() - # Disable retries and run test_get_load_balancer_listener_policy_all_params. + # Disable retries and run test_get_vpn_server_route_all_params. _service.disable_retries() - self.test_get_load_balancer_listener_policy_all_params() + self.test_get_vpn_server_route_all_params() @responses.activate - def test_get_load_balancer_listener_policy_value_error(self): + def test_get_vpn_server_route_value_error(self): """ - test_get_load_balancer_listener_policy_value_error() + test_get_vpn_server_route_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') - mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' + url = preprocess_url('/vpn_servers/testString/routes/testString') + mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' responses.add( responses.GET, url, @@ -44209,44 +45584,42 @@ def test_get_load_balancer_listener_policy_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' + vpn_server_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, + "vpn_server_id": vpn_server_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_load_balancer_listener_policy(**req_copy) + _service.get_vpn_server_route(**req_copy) - def test_get_load_balancer_listener_policy_value_error_with_retries(self): - # Enable retries and run test_get_load_balancer_listener_policy_value_error. + def test_get_vpn_server_route_value_error_with_retries(self): + # Enable retries and run test_get_vpn_server_route_value_error. _service.enable_retries() - self.test_get_load_balancer_listener_policy_value_error() + self.test_get_vpn_server_route_value_error() - # Disable retries and run test_get_load_balancer_listener_policy_value_error. + # Disable retries and run test_get_vpn_server_route_value_error. _service.disable_retries() - self.test_get_load_balancer_listener_policy_value_error() + self.test_get_vpn_server_route_value_error() -class TestUpdateLoadBalancerListenerPolicy: +class TestUpdateVpnServerRoute: """ - Test Class for update_load_balancer_listener_policy + Test Class for update_vpn_server_route """ @responses.activate - def test_update_load_balancer_listener_policy_all_params(self): + def test_update_vpn_server_route_all_params(self): """ - update_load_balancer_listener_policy() + update_vpn_server_route() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') - mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' + url = preprocess_url('/vpn_servers/testString/routes/testString') + mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' responses.add( responses.PATCH, url, @@ -44255,28 +45628,20 @@ def test_update_load_balancer_listener_policy_all_params(self): status=200, ) - # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - load_balancer_listener_policy_target_patch_model = {} - load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerPolicyPatch model - load_balancer_listener_policy_patch_model = {} - load_balancer_listener_policy_patch_model['name'] = 'my-policy' - load_balancer_listener_policy_patch_model['priority'] = 5 - load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model + # Construct a dict representation of a VPNServerRoutePatch model + vpn_server_route_patch_model = {} + vpn_server_route_patch_model['name'] = 'my-vpn-route-2' # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' + vpn_server_id = 'testString' id = 'testString' - load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model + vpn_server_route_patch = vpn_server_route_patch_model # Invoke method - response = _service.update_load_balancer_listener_policy( - load_balancer_id, - listener_id, + response = _service.update_vpn_server_route( + vpn_server_id, id, - load_balancer_listener_policy_patch, + vpn_server_route_patch, headers={}, ) @@ -44285,25 +45650,25 @@ def test_update_load_balancer_listener_policy_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == load_balancer_listener_policy_patch + assert req_body == vpn_server_route_patch - def test_update_load_balancer_listener_policy_all_params_with_retries(self): - # Enable retries and run test_update_load_balancer_listener_policy_all_params. + def test_update_vpn_server_route_all_params_with_retries(self): + # Enable retries and run test_update_vpn_server_route_all_params. _service.enable_retries() - self.test_update_load_balancer_listener_policy_all_params() + self.test_update_vpn_server_route_all_params() - # Disable retries and run test_update_load_balancer_listener_policy_all_params. + # Disable retries and run test_update_vpn_server_route_all_params. _service.disable_retries() - self.test_update_load_balancer_listener_policy_all_params() + self.test_update_vpn_server_route_all_params() @responses.activate - def test_update_load_balancer_listener_policy_value_error(self): + def test_update_vpn_server_route_value_error(self): """ - test_update_load_balancer_listener_policy_value_error() + test_update_vpn_server_route_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') - mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' + url = preprocess_url('/vpn_servers/testString/routes/testString') + mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}' responses.add( responses.PATCH, url, @@ -44312,99 +45677,106 @@ def test_update_load_balancer_listener_policy_value_error(self): status=200, ) - # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - load_balancer_listener_policy_target_patch_model = {} - load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - - # Construct a dict representation of a LoadBalancerListenerPolicyPatch model - load_balancer_listener_policy_patch_model = {} - load_balancer_listener_policy_patch_model['name'] = 'my-policy' - load_balancer_listener_policy_patch_model['priority'] = 5 - load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model + # Construct a dict representation of a VPNServerRoutePatch model + vpn_server_route_patch_model = {} + vpn_server_route_patch_model['name'] = 'my-vpn-route-2' # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' + vpn_server_id = 'testString' id = 'testString' - load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model + vpn_server_route_patch = vpn_server_route_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, + "vpn_server_id": vpn_server_id, "id": id, - "load_balancer_listener_policy_patch": load_balancer_listener_policy_patch, + "vpn_server_route_patch": vpn_server_route_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_load_balancer_listener_policy(**req_copy) + _service.update_vpn_server_route(**req_copy) - def test_update_load_balancer_listener_policy_value_error_with_retries(self): - # Enable retries and run test_update_load_balancer_listener_policy_value_error. + def test_update_vpn_server_route_value_error_with_retries(self): + # Enable retries and run test_update_vpn_server_route_value_error. _service.enable_retries() - self.test_update_load_balancer_listener_policy_value_error() + self.test_update_vpn_server_route_value_error() - # Disable retries and run test_update_load_balancer_listener_policy_value_error. + # Disable retries and run test_update_vpn_server_route_value_error. _service.disable_retries() - self.test_update_load_balancer_listener_policy_value_error() + self.test_update_vpn_server_route_value_error() -class TestListLoadBalancerListenerPolicyRules: +# endregion +############################################################################## +# End of Service: VPNServers +############################################################################## + +############################################################################## +# Start of Service: LoadBalancers +############################################################################## +# region + + +class TestNewInstance: """ - Test Class for list_load_balancer_listener_policy_rules + Test Class for new_instance """ - @responses.activate - def test_list_load_balancer_listener_policy_rules_all_params(self): + def test_new_instance(self): """ - list_load_balancer_listener_policy_rules() + new_instance() """ - # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules') - mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}]}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', ) - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' + assert service is not None + assert isinstance(service, VpcV1) - # Invoke method - response = _service.list_load_balancer_listener_policy_rules( - load_balancer_id, - listener_id, - policy_id, - headers={}, - ) + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() - def test_list_load_balancer_listener_policy_rules_all_params_with_retries(self): - # Enable retries and run test_list_load_balancer_listener_policy_rules_all_params. - _service.enable_retries() - self.test_list_load_balancer_listener_policy_rules_all_params() + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) - # Disable retries and run test_list_load_balancer_listener_policy_rules_all_params. - _service.disable_retries() - self.test_list_load_balancer_listener_policy_rules_all_params() + +class TestListLoadBalancerProfiles: + """ + Test Class for list_load_balancer_profiles + """ @responses.activate - def test_list_load_balancer_listener_policy_rules_value_error(self): + def test_list_load_balancer_profiles_all_params(self): """ - test_list_load_balancer_listener_policy_rules_value_error() + list_load_balancer_profiles() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules') - mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}]}' + url = preprocess_url('/load_balancer/profiles') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add( responses.GET, url, @@ -44414,241 +45786,182 @@ def test_list_load_balancer_listener_policy_rules_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' + start = 'testString' + limit = 50 - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, - "policy_id": policy_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.list_load_balancer_listener_policy_rules(**req_copy) + # Invoke method + response = _service.list_load_balancer_profiles( + start=start, + limit=limit, + headers={}, + ) - def test_list_load_balancer_listener_policy_rules_value_error_with_retries(self): - # Enable retries and run test_list_load_balancer_listener_policy_rules_value_error. + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + + def test_list_load_balancer_profiles_all_params_with_retries(self): + # Enable retries and run test_list_load_balancer_profiles_all_params. _service.enable_retries() - self.test_list_load_balancer_listener_policy_rules_value_error() + self.test_list_load_balancer_profiles_all_params() - # Disable retries and run test_list_load_balancer_listener_policy_rules_value_error. + # Disable retries and run test_list_load_balancer_profiles_all_params. _service.disable_retries() - self.test_list_load_balancer_listener_policy_rules_value_error() - - -class TestCreateLoadBalancerListenerPolicyRule: - """ - Test Class for create_load_balancer_listener_policy_rule - """ + self.test_list_load_balancer_profiles_all_params() @responses.activate - def test_create_load_balancer_listener_policy_rule_all_params(self): + def test_list_load_balancer_profiles_required_params(self): """ - create_load_balancer_listener_policy_rule() + test_list_load_balancer_profiles_required_params() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules') - mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' + url = preprocess_url('/load_balancer/profiles') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' - condition = 'contains' - type = 'body' - value = 'testString' - field = 'MY-APP-HEADER' - # Invoke method - response = _service.create_load_balancer_listener_policy_rule( - load_balancer_id, - listener_id, - policy_id, - condition, - type, - value, - field=field, - headers={}, - ) + response = _service.list_load_balancer_profiles() # 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['condition'] == 'contains' - assert req_body['type'] == 'body' - assert req_body['value'] == 'testString' - assert req_body['field'] == 'MY-APP-HEADER' + assert response.status_code == 200 - def test_create_load_balancer_listener_policy_rule_all_params_with_retries(self): - # Enable retries and run test_create_load_balancer_listener_policy_rule_all_params. + def test_list_load_balancer_profiles_required_params_with_retries(self): + # Enable retries and run test_list_load_balancer_profiles_required_params. _service.enable_retries() - self.test_create_load_balancer_listener_policy_rule_all_params() + self.test_list_load_balancer_profiles_required_params() - # Disable retries and run test_create_load_balancer_listener_policy_rule_all_params. + # Disable retries and run test_list_load_balancer_profiles_required_params. _service.disable_retries() - self.test_create_load_balancer_listener_policy_rule_all_params() + self.test_list_load_balancer_profiles_required_params() @responses.activate - def test_create_load_balancer_listener_policy_rule_value_error(self): + def test_list_load_balancer_profiles_value_error(self): """ - test_create_load_balancer_listener_policy_rule_value_error() + test_list_load_balancer_profiles_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules') - mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' + url = preprocess_url('/load_balancer/profiles') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "profiles": [{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' - condition = 'contains' - type = 'body' - value = 'testString' - field = 'MY-APP-HEADER' - # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, - "policy_id": policy_id, - "condition": condition, - "type": type, - "value": value, } 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_load_balancer_listener_policy_rule(**req_copy) + _service.list_load_balancer_profiles(**req_copy) - def test_create_load_balancer_listener_policy_rule_value_error_with_retries(self): - # Enable retries and run test_create_load_balancer_listener_policy_rule_value_error. + def test_list_load_balancer_profiles_value_error_with_retries(self): + # Enable retries and run test_list_load_balancer_profiles_value_error. _service.enable_retries() - self.test_create_load_balancer_listener_policy_rule_value_error() + self.test_list_load_balancer_profiles_value_error() - # Disable retries and run test_create_load_balancer_listener_policy_rule_value_error. + # Disable retries and run test_list_load_balancer_profiles_value_error. _service.disable_retries() - self.test_create_load_balancer_listener_policy_rule_value_error() - - -class TestDeleteLoadBalancerListenerPolicyRule: - """ - Test Class for delete_load_balancer_listener_policy_rule - """ + self.test_list_load_balancer_profiles_value_error() @responses.activate - def test_delete_load_balancer_listener_policy_rule_all_params(self): + def test_list_load_balancer_profiles_with_pager_get_next(self): """ - delete_load_balancer_listener_policy_rule() + test_list_load_balancer_profiles_with_pager_get_next() """ - # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') + # Set up a two-page mock response + url = preprocess_url('/load_balancer/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}' responses.add( - responses.DELETE, + responses.GET, url, - status=202, + body=mock_response1, + content_type='application/json', + status=200, ) - - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' - id = 'testString' - - # Invoke method - response = _service.delete_load_balancer_listener_policy_rule( - load_balancer_id, - listener_id, - policy_id, - id, - headers={}, + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, ) - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 202 - - def test_delete_load_balancer_listener_policy_rule_all_params_with_retries(self): - # Enable retries and run test_delete_load_balancer_listener_policy_rule_all_params. - _service.enable_retries() - self.test_delete_load_balancer_listener_policy_rule_all_params() - - # Disable retries and run test_delete_load_balancer_listener_policy_rule_all_params. - _service.disable_retries() - self.test_delete_load_balancer_listener_policy_rule_all_params() + # Exercise the pager class for this operation + all_results = [] + pager = LoadBalancerProfilesPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 @responses.activate - def test_delete_load_balancer_listener_policy_rule_value_error(self): + def test_list_load_balancer_profiles_with_pager_get_all(self): """ - test_delete_load_balancer_listener_policy_rule_value_error() + test_list_load_balancer_profiles_with_pager_get_all() """ - # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') + # Set up a two-page mock response + url = preprocess_url('/load_balancer/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"access_modes":{"type":"enum","values":["private"]},"availability":{"type":"fixed","value":"region"},"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"source_ip_session_persistence_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}' responses.add( - responses.DELETE, + responses.GET, url, - status=202, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, ) - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' - id = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, - "policy_id": policy_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.delete_load_balancer_listener_policy_rule(**req_copy) - - def test_delete_load_balancer_listener_policy_rule_value_error_with_retries(self): - # Enable retries and run test_delete_load_balancer_listener_policy_rule_value_error. - _service.enable_retries() - self.test_delete_load_balancer_listener_policy_rule_value_error() - - # Disable retries and run test_delete_load_balancer_listener_policy_rule_value_error. - _service.disable_retries() - self.test_delete_load_balancer_listener_policy_rule_value_error() + # Exercise the pager class for this operation + pager = LoadBalancerProfilesPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 -class TestGetLoadBalancerListenerPolicyRule: +class TestGetLoadBalancerProfile: """ - Test Class for get_load_balancer_listener_policy_rule + Test Class for get_load_balancer_profile """ @responses.activate - def test_get_load_balancer_listener_policy_rule_all_params(self): + def test_get_load_balancer_profile_all_params(self): """ - get_load_balancer_listener_policy_rule() + get_load_balancer_profile() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') - mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' + url = preprocess_url('/load_balancer/profiles/network-fixed') + mock_response = '{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}' responses.add( responses.GET, url, @@ -44658,17 +45971,11 @@ def test_get_load_balancer_listener_policy_rule_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' - id = 'testString' + name = 'network-fixed' # Invoke method - response = _service.get_load_balancer_listener_policy_rule( - load_balancer_id, - listener_id, - policy_id, - id, + response = _service.get_load_balancer_profile( + name, headers={}, ) @@ -44676,23 +45983,23 @@ def test_get_load_balancer_listener_policy_rule_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_load_balancer_listener_policy_rule_all_params_with_retries(self): - # Enable retries and run test_get_load_balancer_listener_policy_rule_all_params. + def test_get_load_balancer_profile_all_params_with_retries(self): + # Enable retries and run test_get_load_balancer_profile_all_params. _service.enable_retries() - self.test_get_load_balancer_listener_policy_rule_all_params() + self.test_get_load_balancer_profile_all_params() - # Disable retries and run test_get_load_balancer_listener_policy_rule_all_params. + # Disable retries and run test_get_load_balancer_profile_all_params. _service.disable_retries() - self.test_get_load_balancer_listener_policy_rule_all_params() + self.test_get_load_balancer_profile_all_params() @responses.activate - def test_get_load_balancer_listener_policy_rule_value_error(self): + def test_get_load_balancer_profile_value_error(self): """ - test_get_load_balancer_listener_policy_rule_value_error() + test_get_load_balancer_profile_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') - mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' + url = preprocess_url('/load_balancer/profiles/network-fixed') + mock_response = '{"access_modes": {"type": "enum", "values": ["private"]}, "availability": {"type": "fixed", "value": "region"}, "family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "source_ip_session_persistence_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}' responses.add( responses.GET, url, @@ -44702,160 +46009,117 @@ def test_get_load_balancer_listener_policy_rule_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' - id = 'testString' + name = 'network-fixed' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, - "policy_id": policy_id, - "id": id, + "name": name, } 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_load_balancer_listener_policy_rule(**req_copy) + _service.get_load_balancer_profile(**req_copy) - def test_get_load_balancer_listener_policy_rule_value_error_with_retries(self): - # Enable retries and run test_get_load_balancer_listener_policy_rule_value_error. + def test_get_load_balancer_profile_value_error_with_retries(self): + # Enable retries and run test_get_load_balancer_profile_value_error. _service.enable_retries() - self.test_get_load_balancer_listener_policy_rule_value_error() + self.test_get_load_balancer_profile_value_error() - # Disable retries and run test_get_load_balancer_listener_policy_rule_value_error. + # Disable retries and run test_get_load_balancer_profile_value_error. _service.disable_retries() - self.test_get_load_balancer_listener_policy_rule_value_error() + self.test_get_load_balancer_profile_value_error() -class TestUpdateLoadBalancerListenerPolicyRule: +class TestListLoadBalancers: """ - Test Class for update_load_balancer_listener_policy_rule + Test Class for list_load_balancers """ @responses.activate - def test_update_load_balancer_listener_policy_rule_all_params(self): + def test_list_load_balancers_all_params(self): """ - update_load_balancer_listener_policy_rule() + list_load_balancers() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') - mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' + url = preprocess_url('/load_balancers') + mock_response = '{"first": {"href": "href"}, "limit": 20, "load_balancers": [{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "href"}, "total_count": 132}' responses.add( - responses.PATCH, + responses.GET, url, body=mock_response, content_type='application/json', status=200, ) - # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model - load_balancer_listener_policy_rule_patch_model = {} - load_balancer_listener_policy_rule_patch_model['condition'] = 'contains' - load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_patch_model['type'] = 'body' - load_balancer_listener_policy_rule_patch_model['value'] = 'testString' - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' - id = 'testString' - load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model + start = 'testString' + limit = 50 # Invoke method - response = _service.update_load_balancer_listener_policy_rule( - load_balancer_id, - listener_id, - policy_id, - id, - load_balancer_listener_policy_rule_patch, + response = _service.list_load_balancers( + start=start, + limit=limit, 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 == load_balancer_listener_policy_rule_patch + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string - def test_update_load_balancer_listener_policy_rule_all_params_with_retries(self): - # Enable retries and run test_update_load_balancer_listener_policy_rule_all_params. + def test_list_load_balancers_all_params_with_retries(self): + # Enable retries and run test_list_load_balancers_all_params. _service.enable_retries() - self.test_update_load_balancer_listener_policy_rule_all_params() + self.test_list_load_balancers_all_params() - # Disable retries and run test_update_load_balancer_listener_policy_rule_all_params. + # Disable retries and run test_list_load_balancers_all_params. _service.disable_retries() - self.test_update_load_balancer_listener_policy_rule_all_params() + self.test_list_load_balancers_all_params() @responses.activate - def test_update_load_balancer_listener_policy_rule_value_error(self): + def test_list_load_balancers_required_params(self): """ - test_update_load_balancer_listener_policy_rule_value_error() + test_list_load_balancers_required_params() """ # Set up mock - url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') - mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' + url = preprocess_url('/load_balancers') + mock_response = '{"first": {"href": "href"}, "limit": 20, "load_balancers": [{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "href"}, "total_count": 132}' responses.add( - responses.PATCH, + responses.GET, url, body=mock_response, content_type='application/json', status=200, ) - # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model - load_balancer_listener_policy_rule_patch_model = {} - load_balancer_listener_policy_rule_patch_model['condition'] = 'contains' - load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER' - load_balancer_listener_policy_rule_patch_model['type'] = 'body' - load_balancer_listener_policy_rule_patch_model['value'] = 'testString' + # Invoke method + response = _service.list_load_balancers() - # Set up parameter values - load_balancer_id = 'testString' - listener_id = 'testString' - policy_id = 'testString' - id = 'testString' - load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "load_balancer_id": load_balancer_id, - "listener_id": listener_id, - "policy_id": policy_id, - "id": id, - "load_balancer_listener_policy_rule_patch": load_balancer_listener_policy_rule_patch, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.update_load_balancer_listener_policy_rule(**req_copy) - - def test_update_load_balancer_listener_policy_rule_value_error_with_retries(self): - # Enable retries and run test_update_load_balancer_listener_policy_rule_value_error. + def test_list_load_balancers_required_params_with_retries(self): + # Enable retries and run test_list_load_balancers_required_params. _service.enable_retries() - self.test_update_load_balancer_listener_policy_rule_value_error() + self.test_list_load_balancers_required_params() - # Disable retries and run test_update_load_balancer_listener_policy_rule_value_error. + # Disable retries and run test_list_load_balancers_required_params. _service.disable_retries() - self.test_update_load_balancer_listener_policy_rule_value_error() - - -class TestListLoadBalancerPools: - """ - Test Class for list_load_balancer_pools - """ + self.test_list_load_balancers_required_params() @responses.activate - def test_list_load_balancer_pools_all_params(self): + def test_list_load_balancers_value_error(self): """ - list_load_balancer_pools() + test_list_load_balancers_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools') - mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url": "anyValue", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}' + url = preprocess_url('/load_balancers') + mock_response = '{"first": {"href": "href"}, "limit": 20, "load_balancers": [{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -44864,79 +46128,106 @@ def test_list_load_balancer_pools_all_params(self): status=200, ) - # Set up parameter values - load_balancer_id = 'testString' - - # Invoke method - response = _service.list_load_balancer_pools( - load_balancer_id, - headers={}, - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 + # Pass in all but one required param and check for a ValueError + req_param_dict = { + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_load_balancers(**req_copy) - def test_list_load_balancer_pools_all_params_with_retries(self): - # Enable retries and run test_list_load_balancer_pools_all_params. + def test_list_load_balancers_value_error_with_retries(self): + # Enable retries and run test_list_load_balancers_value_error. _service.enable_retries() - self.test_list_load_balancer_pools_all_params() + self.test_list_load_balancers_value_error() - # Disable retries and run test_list_load_balancer_pools_all_params. + # Disable retries and run test_list_load_balancers_value_error. _service.disable_retries() - self.test_list_load_balancer_pools_all_params() + self.test_list_load_balancers_value_error() @responses.activate - def test_list_load_balancer_pools_value_error(self): + def test_list_load_balancers_with_pager_get_next(self): """ - test_list_load_balancer_pools_value_error() + test_list_load_balancers_with_pager_get_next() """ - # Set up mock - url = preprocess_url('/load_balancers/testString/pools') - mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url": "anyValue", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}' + # Set up a two-page mock response + url = preprocess_url('/load_balancers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}' + mock_response2 = '{"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}' responses.add( responses.GET, url, - body=mock_response, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, content_type='application/json', status=200, ) - # Set up parameter values - load_balancer_id = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "load_balancer_id": load_balancer_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.list_load_balancer_pools(**req_copy) + # Exercise the pager class for this operation + all_results = [] + pager = LoadBalancersPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 - def test_list_load_balancer_pools_value_error_with_retries(self): - # Enable retries and run test_list_load_balancer_pools_value_error. - _service.enable_retries() - self.test_list_load_balancer_pools_value_error() + @responses.activate + def test_list_load_balancers_with_pager_get_all(self): + """ + test_list_load_balancers_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/load_balancers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}' + mock_response2 = '{"total_count":2,"limit":1,"load_balancers":[{"access_mode":"private","availability":"region","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":true,"is_private_path":true,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"source_ip_session_persistence_supported":true,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) - # Disable retries and run test_list_load_balancer_pools_value_error. - _service.disable_retries() - self.test_list_load_balancer_pools_value_error() + # Exercise the pager class for this operation + pager = LoadBalancersPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 -class TestCreateLoadBalancerPool: +class TestCreateLoadBalancer: """ - Test Class for create_load_balancer_pool + Test Class for create_load_balancer """ @responses.activate - def test_create_load_balancer_pool_all_params(self): + def test_create_load_balancer_all_params(self): """ - create_load_balancer_pool() + create_load_balancer() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools') - mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url": "anyValue", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' + url = preprocess_url('/load_balancers') + mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' responses.add( responses.POST, url, @@ -44945,6 +46236,62 @@ def test_create_load_balancer_pool_all_params(self): status=201, ) + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a DNSInstanceIdentityByCRN model + dns_instance_identity_model = {} + dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' + + # Construct a dict representation of a DNSZoneIdentityById model + dns_zone_identity_model = {} + dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' + + # Construct a dict representation of a LoadBalancerDNSPrototype model + load_balancer_dns_prototype_model = {} + load_balancer_dns_prototype_model['instance'] = dns_instance_identity_model + load_balancer_dns_prototype_model['zone'] = dns_zone_identity_model + + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' + + # Construct a dict representation of a LoadBalancerPoolIdentityByName model + load_balancer_pool_identity_by_name_model = {} + load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' + + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model + load_balancer_listener_https_redirect_prototype_model = {} + load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' + + # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model + load_balancer_listener_prototype_load_balancer_context_model = {} + load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True + load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model + load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000 + load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model + load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model + load_balancer_listener_prototype_load_balancer_context_model['idle_connection_timeout'] = 100 + load_balancer_listener_prototype_load_balancer_context_model['port'] = 443 + load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499 + load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443 + load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http' + + # Construct a dict representation of a LoadBalancerLoggingDatapathPrototype model + load_balancer_logging_datapath_prototype_model = {} + load_balancer_logging_datapath_prototype_model['active'] = True + + # Construct a dict representation of a LoadBalancerLoggingPrototype model + load_balancer_logging_prototype_model = {} + load_balancer_logging_prototype_model['datapath'] = load_balancer_logging_datapath_prototype_model + # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model load_balancer_pool_health_monitor_prototype_model = {} load_balancer_pool_health_monitor_prototype_model['delay'] = 5 @@ -44956,7 +46303,7 @@ def test_create_load_balancer_pool_all_params(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a dict representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model = {} @@ -44969,26 +46316,56 @@ def test_create_load_balancer_pool_all_params(self): load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name' load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie' + # Construct a dict representation of a LoadBalancerPoolPrototype model + load_balancer_pool_prototype_model = {} + load_balancer_pool_prototype_model['algorithm'] = 'least_connections' + load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model + load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model] + load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool' + load_balancer_pool_prototype_model['protocol'] = 'http' + load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled' + load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model + + # Construct a dict representation of a LoadBalancerProfileIdentityByName model + load_balancer_profile_identity_model = {} + load_balancer_profile_identity_model['name'] = 'network-fixed' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a SecurityGroupIdentityById model + security_group_identity_model = {} + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + # Set up parameter values - load_balancer_id = 'testString' - algorithm = 'least_connections' - health_monitor = load_balancer_pool_health_monitor_prototype_model - protocol = 'http' - members = [load_balancer_pool_member_prototype_model] - name = 'my-load-balancer-pool' - proxy_protocol = 'disabled' - session_persistence = load_balancer_pool_session_persistence_prototype_model + is_public = True + subnets = [subnet_identity_model] + dns = load_balancer_dns_prototype_model + is_private_path = True + listeners = [load_balancer_listener_prototype_load_balancer_context_model] + logging = load_balancer_logging_prototype_model + name = 'my-load-balancer' + pools = [load_balancer_pool_prototype_model] + profile = load_balancer_profile_identity_model + resource_group = resource_group_identity_model + route_mode = True + security_groups = [security_group_identity_model] # Invoke method - response = _service.create_load_balancer_pool( - load_balancer_id, - algorithm, - health_monitor, - protocol, - members=members, + response = _service.create_load_balancer( + is_public, + subnets, + dns=dns, + is_private_path=is_private_path, + listeners=listeners, + logging=logging, name=name, - proxy_protocol=proxy_protocol, - session_persistence=session_persistence, + pools=pools, + profile=profile, + resource_group=resource_group, + route_mode=route_mode, + security_groups=security_groups, headers={}, ) @@ -44997,31 +46374,36 @@ def test_create_load_balancer_pool_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['algorithm'] == 'least_connections' - assert req_body['health_monitor'] == load_balancer_pool_health_monitor_prototype_model - assert req_body['protocol'] == 'http' - assert req_body['members'] == [load_balancer_pool_member_prototype_model] - assert req_body['name'] == 'my-load-balancer-pool' - assert req_body['proxy_protocol'] == 'disabled' - assert req_body['session_persistence'] == load_balancer_pool_session_persistence_prototype_model + assert req_body['is_public'] == True + assert req_body['subnets'] == [subnet_identity_model] + assert req_body['dns'] == load_balancer_dns_prototype_model + assert req_body['is_private_path'] == True + assert req_body['listeners'] == [load_balancer_listener_prototype_load_balancer_context_model] + assert req_body['logging'] == load_balancer_logging_prototype_model + assert req_body['name'] == 'my-load-balancer' + assert req_body['pools'] == [load_balancer_pool_prototype_model] + assert req_body['profile'] == load_balancer_profile_identity_model + assert req_body['resource_group'] == resource_group_identity_model + assert req_body['route_mode'] == True + assert req_body['security_groups'] == [security_group_identity_model] - def test_create_load_balancer_pool_all_params_with_retries(self): - # Enable retries and run test_create_load_balancer_pool_all_params. + def test_create_load_balancer_all_params_with_retries(self): + # Enable retries and run test_create_load_balancer_all_params. _service.enable_retries() - self.test_create_load_balancer_pool_all_params() + self.test_create_load_balancer_all_params() - # Disable retries and run test_create_load_balancer_pool_all_params. + # Disable retries and run test_create_load_balancer_all_params. _service.disable_retries() - self.test_create_load_balancer_pool_all_params() + self.test_create_load_balancer_all_params() @responses.activate - def test_create_load_balancer_pool_value_error(self): + def test_create_load_balancer_value_error(self): """ - test_create_load_balancer_pool_value_error() + test_create_load_balancer_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools') - mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url": "anyValue", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' + url = preprocess_url('/load_balancers') + mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' responses.add( responses.POST, url, @@ -45030,6 +46412,62 @@ def test_create_load_balancer_pool_value_error(self): status=201, ) + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a DNSInstanceIdentityByCRN model + dns_instance_identity_model = {} + dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' + + # Construct a dict representation of a DNSZoneIdentityById model + dns_zone_identity_model = {} + dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' + + # Construct a dict representation of a LoadBalancerDNSPrototype model + load_balancer_dns_prototype_model = {} + load_balancer_dns_prototype_model['instance'] = dns_instance_identity_model + load_balancer_dns_prototype_model['zone'] = dns_zone_identity_model + + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' + + # Construct a dict representation of a LoadBalancerPoolIdentityByName model + load_balancer_pool_identity_by_name_model = {} + load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' + + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model + load_balancer_listener_https_redirect_prototype_model = {} + load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' + + # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model + load_balancer_listener_prototype_load_balancer_context_model = {} + load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True + load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model + load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000 + load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model + load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model + load_balancer_listener_prototype_load_balancer_context_model['idle_connection_timeout'] = 100 + load_balancer_listener_prototype_load_balancer_context_model['port'] = 443 + load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499 + load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443 + load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http' + + # Construct a dict representation of a LoadBalancerLoggingDatapathPrototype model + load_balancer_logging_datapath_prototype_model = {} + load_balancer_logging_datapath_prototype_model['active'] = True + + # Construct a dict representation of a LoadBalancerLoggingPrototype model + load_balancer_logging_prototype_model = {} + load_balancer_logging_prototype_model['datapath'] = load_balancer_logging_datapath_prototype_model + # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model load_balancer_pool_health_monitor_prototype_model = {} load_balancer_pool_health_monitor_prototype_model['delay'] = 5 @@ -45041,7 +46479,7 @@ def test_create_load_balancer_pool_value_error(self): # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a dict representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model = {} @@ -45054,50 +46492,74 @@ def test_create_load_balancer_pool_value_error(self): load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name' load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie' + # Construct a dict representation of a LoadBalancerPoolPrototype model + load_balancer_pool_prototype_model = {} + load_balancer_pool_prototype_model['algorithm'] = 'least_connections' + load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model + load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model] + load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool' + load_balancer_pool_prototype_model['protocol'] = 'http' + load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled' + load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model + + # Construct a dict representation of a LoadBalancerProfileIdentityByName model + load_balancer_profile_identity_model = {} + load_balancer_profile_identity_model['name'] = 'network-fixed' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a SecurityGroupIdentityById model + security_group_identity_model = {} + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + # Set up parameter values - load_balancer_id = 'testString' - algorithm = 'least_connections' - health_monitor = load_balancer_pool_health_monitor_prototype_model - protocol = 'http' - members = [load_balancer_pool_member_prototype_model] - name = 'my-load-balancer-pool' - proxy_protocol = 'disabled' - session_persistence = load_balancer_pool_session_persistence_prototype_model + is_public = True + subnets = [subnet_identity_model] + dns = load_balancer_dns_prototype_model + is_private_path = True + listeners = [load_balancer_listener_prototype_load_balancer_context_model] + logging = load_balancer_logging_prototype_model + name = 'my-load-balancer' + pools = [load_balancer_pool_prototype_model] + profile = load_balancer_profile_identity_model + resource_group = resource_group_identity_model + route_mode = True + security_groups = [security_group_identity_model] # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "algorithm": algorithm, - "health_monitor": health_monitor, - "protocol": protocol, + "is_public": is_public, + "subnets": subnets, } 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_load_balancer_pool(**req_copy) + _service.create_load_balancer(**req_copy) - def test_create_load_balancer_pool_value_error_with_retries(self): - # Enable retries and run test_create_load_balancer_pool_value_error. + def test_create_load_balancer_value_error_with_retries(self): + # Enable retries and run test_create_load_balancer_value_error. _service.enable_retries() - self.test_create_load_balancer_pool_value_error() + self.test_create_load_balancer_value_error() - # Disable retries and run test_create_load_balancer_pool_value_error. + # Disable retries and run test_create_load_balancer_value_error. _service.disable_retries() - self.test_create_load_balancer_pool_value_error() + self.test_create_load_balancer_value_error() -class TestDeleteLoadBalancerPool: +class TestDeleteLoadBalancer: """ - Test Class for delete_load_balancer_pool + Test Class for delete_load_balancer """ @responses.activate - def test_delete_load_balancer_pool_all_params(self): + def test_delete_load_balancer_all_params(self): """ - delete_load_balancer_pool() + delete_load_balancer() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString') + url = preprocess_url('/load_balancers/testString') responses.add( responses.DELETE, url, @@ -45105,13 +46567,13 @@ def test_delete_load_balancer_pool_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' id = 'testString' + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method - response = _service.delete_load_balancer_pool( - load_balancer_id, + response = _service.delete_load_balancer( id, + if_match=if_match, headers={}, ) @@ -45119,22 +46581,57 @@ def test_delete_load_balancer_pool_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 202 - def test_delete_load_balancer_pool_all_params_with_retries(self): - # Enable retries and run test_delete_load_balancer_pool_all_params. + def test_delete_load_balancer_all_params_with_retries(self): + # Enable retries and run test_delete_load_balancer_all_params. _service.enable_retries() - self.test_delete_load_balancer_pool_all_params() + self.test_delete_load_balancer_all_params() - # Disable retries and run test_delete_load_balancer_pool_all_params. + # Disable retries and run test_delete_load_balancer_all_params. _service.disable_retries() - self.test_delete_load_balancer_pool_all_params() + self.test_delete_load_balancer_all_params() @responses.activate - def test_delete_load_balancer_pool_value_error(self): + def test_delete_load_balancer_required_params(self): """ - test_delete_load_balancer_pool_value_error() + test_delete_load_balancer_required_params() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString') + url = preprocess_url('/load_balancers/testString') + responses.add( + responses.DELETE, + url, + status=202, + ) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.delete_load_balancer( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_load_balancer_required_params_with_retries(self): + # Enable retries and run test_delete_load_balancer_required_params. + _service.enable_retries() + self.test_delete_load_balancer_required_params() + + # Disable retries and run test_delete_load_balancer_required_params. + _service.disable_retries() + self.test_delete_load_balancer_required_params() + + @responses.activate + def test_delete_load_balancer_value_error(self): + """ + test_delete_load_balancer_value_error() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString') responses.add( responses.DELETE, url, @@ -45142,42 +46639,40 @@ def test_delete_load_balancer_pool_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_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.delete_load_balancer_pool(**req_copy) + _service.delete_load_balancer(**req_copy) - def test_delete_load_balancer_pool_value_error_with_retries(self): - # Enable retries and run test_delete_load_balancer_pool_value_error. + def test_delete_load_balancer_value_error_with_retries(self): + # Enable retries and run test_delete_load_balancer_value_error. _service.enable_retries() - self.test_delete_load_balancer_pool_value_error() + self.test_delete_load_balancer_value_error() - # Disable retries and run test_delete_load_balancer_pool_value_error. + # Disable retries and run test_delete_load_balancer_value_error. _service.disable_retries() - self.test_delete_load_balancer_pool_value_error() + self.test_delete_load_balancer_value_error() -class TestGetLoadBalancerPool: +class TestGetLoadBalancer: """ - Test Class for get_load_balancer_pool + Test Class for get_load_balancer """ @responses.activate - def test_get_load_balancer_pool_all_params(self): + def test_get_load_balancer_all_params(self): """ - get_load_balancer_pool() + get_load_balancer() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString') - mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url": "anyValue", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' + url = preprocess_url('/load_balancers/testString') + mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' responses.add( responses.GET, url, @@ -45187,12 +46682,10 @@ def test_get_load_balancer_pool_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' id = 'testString' # Invoke method - response = _service.get_load_balancer_pool( - load_balancer_id, + response = _service.get_load_balancer( id, headers={}, ) @@ -45201,23 +46694,23 @@ def test_get_load_balancer_pool_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_load_balancer_pool_all_params_with_retries(self): - # Enable retries and run test_get_load_balancer_pool_all_params. + def test_get_load_balancer_all_params_with_retries(self): + # Enable retries and run test_get_load_balancer_all_params. _service.enable_retries() - self.test_get_load_balancer_pool_all_params() + self.test_get_load_balancer_all_params() - # Disable retries and run test_get_load_balancer_pool_all_params. + # Disable retries and run test_get_load_balancer_all_params. _service.disable_retries() - self.test_get_load_balancer_pool_all_params() + self.test_get_load_balancer_all_params() @responses.activate - def test_get_load_balancer_pool_value_error(self): + def test_get_load_balancer_value_error(self): """ - test_get_load_balancer_pool_value_error() + test_get_load_balancer_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString') - mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url": "anyValue", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' + url = preprocess_url('/load_balancers/testString') + mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' responses.add( responses.GET, url, @@ -45227,42 +46720,40 @@ def test_get_load_balancer_pool_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_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_load_balancer_pool(**req_copy) + _service.get_load_balancer(**req_copy) - def test_get_load_balancer_pool_value_error_with_retries(self): - # Enable retries and run test_get_load_balancer_pool_value_error. + def test_get_load_balancer_value_error_with_retries(self): + # Enable retries and run test_get_load_balancer_value_error. _service.enable_retries() - self.test_get_load_balancer_pool_value_error() + self.test_get_load_balancer_value_error() - # Disable retries and run test_get_load_balancer_pool_value_error. + # Disable retries and run test_get_load_balancer_value_error. _service.disable_retries() - self.test_get_load_balancer_pool_value_error() + self.test_get_load_balancer_value_error() -class TestUpdateLoadBalancerPool: +class TestUpdateLoadBalancer: """ - Test Class for update_load_balancer_pool + Test Class for update_load_balancer """ @responses.activate - def test_update_load_balancer_pool_all_params(self): + def test_update_load_balancer_all_params(self): """ - update_load_balancer_pool() + update_load_balancer() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString') - mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url": "anyValue", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' + url = preprocess_url('/load_balancers/testString') + mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' responses.add( responses.PATCH, url, @@ -45271,39 +46762,48 @@ def test_update_load_balancer_pool_all_params(self): status=200, ) - # Construct a dict representation of a LoadBalancerPoolHealthMonitorPatch model - load_balancer_pool_health_monitor_patch_model = {} - load_balancer_pool_health_monitor_patch_model['delay'] = 5 - load_balancer_pool_health_monitor_patch_model['max_retries'] = 2 - load_balancer_pool_health_monitor_patch_model['port'] = 22 - load_balancer_pool_health_monitor_patch_model['timeout'] = 2 - load_balancer_pool_health_monitor_patch_model['type'] = 'http' - load_balancer_pool_health_monitor_patch_model['url_path'] = '/' + # Construct a dict representation of a DNSInstanceIdentityByCRN model + dns_instance_identity_model = {} + dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' - # Construct a dict representation of a LoadBalancerPoolSessionPersistencePatch model - load_balancer_pool_session_persistence_patch_model = {} - load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name' - load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie' + # Construct a dict representation of a DNSZoneIdentityById model + dns_zone_identity_model = {} + dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' - # Construct a dict representation of a LoadBalancerPoolPatch model - load_balancer_pool_patch_model = {} - load_balancer_pool_patch_model['algorithm'] = 'least_connections' - load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model - load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool' - load_balancer_pool_patch_model['protocol'] = 'http' - load_balancer_pool_patch_model['proxy_protocol'] = 'disabled' - load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model + # Construct a dict representation of a LoadBalancerDNSPatch model + load_balancer_dns_patch_model = {} + load_balancer_dns_patch_model['instance'] = dns_instance_identity_model + load_balancer_dns_patch_model['zone'] = dns_zone_identity_model + + # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model + load_balancer_logging_datapath_patch_model = {} + load_balancer_logging_datapath_patch_model['active'] = True + + # Construct a dict representation of a LoadBalancerLoggingPatch model + load_balancer_logging_patch_model = {} + load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a LoadBalancerPatch model + load_balancer_patch_model = {} + load_balancer_patch_model['dns'] = load_balancer_dns_patch_model + load_balancer_patch_model['logging'] = load_balancer_logging_patch_model + load_balancer_patch_model['name'] = 'my-load-balancer' + load_balancer_patch_model['subnets'] = [subnet_identity_model] # Set up parameter values - load_balancer_id = 'testString' id = 'testString' - load_balancer_pool_patch = load_balancer_pool_patch_model + load_balancer_patch = load_balancer_patch_model + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method - response = _service.update_load_balancer_pool( - load_balancer_id, + response = _service.update_load_balancer( id, - load_balancer_pool_patch, + load_balancer_patch, + if_match=if_match, headers={}, ) @@ -45312,25 +46812,25 @@ def test_update_load_balancer_pool_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == load_balancer_pool_patch + assert req_body == load_balancer_patch - def test_update_load_balancer_pool_all_params_with_retries(self): - # Enable retries and run test_update_load_balancer_pool_all_params. + def test_update_load_balancer_all_params_with_retries(self): + # Enable retries and run test_update_load_balancer_all_params. _service.enable_retries() - self.test_update_load_balancer_pool_all_params() + self.test_update_load_balancer_all_params() - # Disable retries and run test_update_load_balancer_pool_all_params. + # Disable retries and run test_update_load_balancer_all_params. _service.disable_retries() - self.test_update_load_balancer_pool_all_params() + self.test_update_load_balancer_all_params() @responses.activate - def test_update_load_balancer_pool_value_error(self): + def test_update_load_balancer_required_params(self): """ - test_update_load_balancer_pool_value_error() + test_update_load_balancer_required_params() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString') - mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url": "anyValue", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' + url = preprocess_url('/load_balancers/testString') + mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' responses.add( responses.PATCH, url, @@ -45339,68 +46839,150 @@ def test_update_load_balancer_pool_value_error(self): status=200, ) - # Construct a dict representation of a LoadBalancerPoolHealthMonitorPatch model - load_balancer_pool_health_monitor_patch_model = {} - load_balancer_pool_health_monitor_patch_model['delay'] = 5 - load_balancer_pool_health_monitor_patch_model['max_retries'] = 2 - load_balancer_pool_health_monitor_patch_model['port'] = 22 - load_balancer_pool_health_monitor_patch_model['timeout'] = 2 - load_balancer_pool_health_monitor_patch_model['type'] = 'http' - load_balancer_pool_health_monitor_patch_model['url_path'] = '/' + # Construct a dict representation of a DNSInstanceIdentityByCRN model + dns_instance_identity_model = {} + dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' - # Construct a dict representation of a LoadBalancerPoolSessionPersistencePatch model - load_balancer_pool_session_persistence_patch_model = {} - load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name' - load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie' + # Construct a dict representation of a DNSZoneIdentityById model + dns_zone_identity_model = {} + dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' - # Construct a dict representation of a LoadBalancerPoolPatch model - load_balancer_pool_patch_model = {} - load_balancer_pool_patch_model['algorithm'] = 'least_connections' - load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model - load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool' - load_balancer_pool_patch_model['protocol'] = 'http' - load_balancer_pool_patch_model['proxy_protocol'] = 'disabled' - load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model + # Construct a dict representation of a LoadBalancerDNSPatch model + load_balancer_dns_patch_model = {} + load_balancer_dns_patch_model['instance'] = dns_instance_identity_model + load_balancer_dns_patch_model['zone'] = dns_zone_identity_model + + # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model + load_balancer_logging_datapath_patch_model = {} + load_balancer_logging_datapath_patch_model['active'] = True + + # Construct a dict representation of a LoadBalancerLoggingPatch model + load_balancer_logging_patch_model = {} + load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a LoadBalancerPatch model + load_balancer_patch_model = {} + load_balancer_patch_model['dns'] = load_balancer_dns_patch_model + load_balancer_patch_model['logging'] = load_balancer_logging_patch_model + load_balancer_patch_model['name'] = 'my-load-balancer' + load_balancer_patch_model['subnets'] = [subnet_identity_model] # Set up parameter values - load_balancer_id = 'testString' id = 'testString' - load_balancer_pool_patch = load_balancer_pool_patch_model + load_balancer_patch = load_balancer_patch_model + + # Invoke method + response = _service.update_load_balancer( + id, + load_balancer_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == load_balancer_patch + + def test_update_load_balancer_required_params_with_retries(self): + # Enable retries and run test_update_load_balancer_required_params. + _service.enable_retries() + self.test_update_load_balancer_required_params() + + # Disable retries and run test_update_load_balancer_required_params. + _service.disable_retries() + self.test_update_load_balancer_required_params() + + @responses.activate + def test_update_load_balancer_value_error(self): + """ + test_update_load_balancer_value_error() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString') + mock_response = '{"access_mode": "private", "availability": "region", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": true, "is_private_path": true, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "source_ip_session_persistence_supported": true, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a DNSInstanceIdentityByCRN model + dns_instance_identity_model = {} + dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' + + # Construct a dict representation of a DNSZoneIdentityById model + dns_zone_identity_model = {} + dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45' + + # Construct a dict representation of a LoadBalancerDNSPatch model + load_balancer_dns_patch_model = {} + load_balancer_dns_patch_model['instance'] = dns_instance_identity_model + load_balancer_dns_patch_model['zone'] = dns_zone_identity_model + + # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model + load_balancer_logging_datapath_patch_model = {} + load_balancer_logging_datapath_patch_model['active'] = True + + # Construct a dict representation of a LoadBalancerLoggingPatch model + load_balancer_logging_patch_model = {} + load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a LoadBalancerPatch model + load_balancer_patch_model = {} + load_balancer_patch_model['dns'] = load_balancer_dns_patch_model + load_balancer_patch_model['logging'] = load_balancer_logging_patch_model + load_balancer_patch_model['name'] = 'my-load-balancer' + load_balancer_patch_model['subnets'] = [subnet_identity_model] + + # Set up parameter values + id = 'testString' + load_balancer_patch = load_balancer_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, "id": id, - "load_balancer_pool_patch": load_balancer_pool_patch, + "load_balancer_patch": load_balancer_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_load_balancer_pool(**req_copy) + _service.update_load_balancer(**req_copy) - def test_update_load_balancer_pool_value_error_with_retries(self): - # Enable retries and run test_update_load_balancer_pool_value_error. + def test_update_load_balancer_value_error_with_retries(self): + # Enable retries and run test_update_load_balancer_value_error. _service.enable_retries() - self.test_update_load_balancer_pool_value_error() + self.test_update_load_balancer_value_error() - # Disable retries and run test_update_load_balancer_pool_value_error. + # Disable retries and run test_update_load_balancer_value_error. _service.disable_retries() - self.test_update_load_balancer_pool_value_error() + self.test_update_load_balancer_value_error() -class TestListLoadBalancerPoolMembers: +class TestGetLoadBalancerStatistics: """ - Test Class for list_load_balancer_pool_members + Test Class for get_load_balancer_statistics """ @responses.activate - def test_list_load_balancer_pool_members_all_params(self): + def test_get_load_balancer_statistics_all_params(self): """ - list_load_balancer_pool_members() + get_load_balancer_statistics() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members') - mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}' + url = preprocess_url('/load_balancers/testString/statistics') + mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}' responses.add( responses.GET, url, @@ -45410,13 +46992,11 @@ def test_list_load_balancer_pool_members_all_params(self): ) # Set up parameter values - load_balancer_id = 'testString' - pool_id = 'testString' + id = 'testString' # Invoke method - response = _service.list_load_balancer_pool_members( - load_balancer_id, - pool_id, + response = _service.get_load_balancer_statistics( + id, headers={}, ) @@ -45424,23 +47004,23 @@ def test_list_load_balancer_pool_members_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_load_balancer_pool_members_all_params_with_retries(self): - # Enable retries and run test_list_load_balancer_pool_members_all_params. + def test_get_load_balancer_statistics_all_params_with_retries(self): + # Enable retries and run test_get_load_balancer_statistics_all_params. _service.enable_retries() - self.test_list_load_balancer_pool_members_all_params() + self.test_get_load_balancer_statistics_all_params() - # Disable retries and run test_list_load_balancer_pool_members_all_params. + # Disable retries and run test_get_load_balancer_statistics_all_params. _service.disable_retries() - self.test_list_load_balancer_pool_members_all_params() + self.test_get_load_balancer_statistics_all_params() @responses.activate - def test_list_load_balancer_pool_members_value_error(self): + def test_get_load_balancer_statistics_value_error(self): """ - test_list_load_balancer_pool_members_value_error() + test_get_load_balancer_statistics_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members') - mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}' + url = preprocess_url('/load_balancers/testString/statistics') + mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}' responses.add( responses.GET, url, @@ -45450,262 +47030,322 @@ def test_list_load_balancer_pool_members_value_error(self): ) # Set up parameter values - load_balancer_id = 'testString' - pool_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer_id": load_balancer_id, - "pool_id": pool_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.list_load_balancer_pool_members(**req_copy) + _service.get_load_balancer_statistics(**req_copy) - def test_list_load_balancer_pool_members_value_error_with_retries(self): - # Enable retries and run test_list_load_balancer_pool_members_value_error. + def test_get_load_balancer_statistics_value_error_with_retries(self): + # Enable retries and run test_get_load_balancer_statistics_value_error. _service.enable_retries() - self.test_list_load_balancer_pool_members_value_error() + self.test_get_load_balancer_statistics_value_error() - # Disable retries and run test_list_load_balancer_pool_members_value_error. + # Disable retries and run test_get_load_balancer_statistics_value_error. _service.disable_retries() - self.test_list_load_balancer_pool_members_value_error() + self.test_get_load_balancer_statistics_value_error() -class TestCreateLoadBalancerPoolMember: +class TestListLoadBalancerListeners: """ - Test Class for create_load_balancer_pool_member + Test Class for list_load_balancer_listeners """ @responses.activate - def test_create_load_balancer_pool_member_all_params(self): + def test_list_load_balancer_listeners_all_params(self): """ - create_load_balancer_pool_member() + list_load_balancer_listeners() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' + url = preprocess_url('/load_balancers/testString/listeners') + mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' - # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' - port = 80 - target = load_balancer_pool_member_target_prototype_model - weight = 50 # Invoke method - response = _service.create_load_balancer_pool_member( + response = _service.list_load_balancer_listeners( load_balancer_id, - pool_id, - port, - target, - weight=weight, 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['port'] == 80 - assert req_body['target'] == load_balancer_pool_member_target_prototype_model - assert req_body['weight'] == 50 + assert response.status_code == 200 - def test_create_load_balancer_pool_member_all_params_with_retries(self): - # Enable retries and run test_create_load_balancer_pool_member_all_params. + def test_list_load_balancer_listeners_all_params_with_retries(self): + # Enable retries and run test_list_load_balancer_listeners_all_params. _service.enable_retries() - self.test_create_load_balancer_pool_member_all_params() + self.test_list_load_balancer_listeners_all_params() - # Disable retries and run test_create_load_balancer_pool_member_all_params. + # Disable retries and run test_list_load_balancer_listeners_all_params. _service.disable_retries() - self.test_create_load_balancer_pool_member_all_params() + self.test_list_load_balancer_listeners_all_params() @responses.activate - def test_create_load_balancer_pool_member_value_error(self): + def test_list_load_balancer_listeners_value_error(self): """ - test_create_load_balancer_pool_member_value_error() + test_list_load_balancer_listeners_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' + url = preprocess_url('/load_balancers/testString/listeners') + mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' - # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' - port = 80 - target = load_balancer_pool_member_target_prototype_model - weight = 50 # Pass in all but one required param and check for a ValueError req_param_dict = { "load_balancer_id": load_balancer_id, - "pool_id": pool_id, - "port": port, - "target": target, } 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_load_balancer_pool_member(**req_copy) + _service.list_load_balancer_listeners(**req_copy) - def test_create_load_balancer_pool_member_value_error_with_retries(self): - # Enable retries and run test_create_load_balancer_pool_member_value_error. + def test_list_load_balancer_listeners_value_error_with_retries(self): + # Enable retries and run test_list_load_balancer_listeners_value_error. _service.enable_retries() - self.test_create_load_balancer_pool_member_value_error() + self.test_list_load_balancer_listeners_value_error() - # Disable retries and run test_create_load_balancer_pool_member_value_error. + # Disable retries and run test_list_load_balancer_listeners_value_error. _service.disable_retries() - self.test_create_load_balancer_pool_member_value_error() + self.test_list_load_balancer_listeners_value_error() -class TestReplaceLoadBalancerPoolMembers: +class TestCreateLoadBalancerListener: """ - Test Class for replace_load_balancer_pool_members + Test Class for create_load_balancer_listener """ @responses.activate - def test_replace_load_balancer_pool_members_all_params(self): + def test_create_load_balancer_listener_all_params(self): """ - replace_load_balancer_pool_members() + create_load_balancer_listener() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members') - mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}' + url = preprocess_url('/load_balancers/testString/listeners') + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add( - responses.PUT, + responses.POST, url, body=mock_response, content_type='application/json', - status=202, + status=201, ) - # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a dict representation of a LoadBalancerPoolMemberPrototype model - load_balancer_pool_member_prototype_model = {} - load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model - load_balancer_pool_member_prototype_model['weight'] = 50 + # Construct a dict representation of a LoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + load_balancer_pool_identity_model = {} + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model + load_balancer_listener_https_redirect_prototype_model = {} + load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' + + # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model + load_balancer_listener_policy_rule_prototype_model = {} + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model['type'] = 'body' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' + + # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + load_balancer_listener_policy_target_prototype_model = {} + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model + load_balancer_listener_policy_prototype_model = {} + load_balancer_listener_policy_prototype_model['action'] = 'forward' + load_balancer_listener_policy_prototype_model['name'] = 'my-policy' + load_balancer_listener_policy_prototype_model['priority'] = 5 + load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model] + load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' - members = [load_balancer_pool_member_prototype_model] + protocol = 'http' + accept_proxy_protocol = True + certificate_instance = certificate_instance_identity_model + connection_limit = 2000 + default_pool = load_balancer_pool_identity_model + https_redirect = load_balancer_listener_https_redirect_prototype_model + idle_connection_timeout = 100 + policies = [load_balancer_listener_policy_prototype_model] + port = 443 + port_max = 499 + port_min = 443 # Invoke method - response = _service.replace_load_balancer_pool_members( + response = _service.create_load_balancer_listener( load_balancer_id, - pool_id, - members, + protocol, + accept_proxy_protocol=accept_proxy_protocol, + certificate_instance=certificate_instance, + connection_limit=connection_limit, + default_pool=default_pool, + https_redirect=https_redirect, + idle_connection_timeout=idle_connection_timeout, + policies=policies, + port=port, + port_max=port_max, + port_min=port_min, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 202 + assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['members'] == [load_balancer_pool_member_prototype_model] + assert req_body['protocol'] == 'http' + assert req_body['accept_proxy_protocol'] == True + assert req_body['certificate_instance'] == certificate_instance_identity_model + assert req_body['connection_limit'] == 2000 + assert req_body['default_pool'] == load_balancer_pool_identity_model + assert req_body['https_redirect'] == load_balancer_listener_https_redirect_prototype_model + assert req_body['idle_connection_timeout'] == 100 + assert req_body['policies'] == [load_balancer_listener_policy_prototype_model] + assert req_body['port'] == 443 + assert req_body['port_max'] == 499 + assert req_body['port_min'] == 443 - def test_replace_load_balancer_pool_members_all_params_with_retries(self): - # Enable retries and run test_replace_load_balancer_pool_members_all_params. + def test_create_load_balancer_listener_all_params_with_retries(self): + # Enable retries and run test_create_load_balancer_listener_all_params. _service.enable_retries() - self.test_replace_load_balancer_pool_members_all_params() + self.test_create_load_balancer_listener_all_params() - # Disable retries and run test_replace_load_balancer_pool_members_all_params. + # Disable retries and run test_create_load_balancer_listener_all_params. _service.disable_retries() - self.test_replace_load_balancer_pool_members_all_params() + self.test_create_load_balancer_listener_all_params() @responses.activate - def test_replace_load_balancer_pool_members_value_error(self): + def test_create_load_balancer_listener_value_error(self): """ - test_replace_load_balancer_pool_members_value_error() + test_create_load_balancer_listener_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members') - mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}' + url = preprocess_url('/load_balancers/testString/listeners') + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add( - responses.PUT, + responses.POST, url, body=mock_response, content_type='application/json', - status=202, + status=201, ) - # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a dict representation of a LoadBalancerPoolMemberPrototype model - load_balancer_pool_member_prototype_model = {} - load_balancer_pool_member_prototype_model['port'] = 80 - load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model - load_balancer_pool_member_prototype_model['weight'] = 50 + # Construct a dict representation of a LoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + load_balancer_pool_identity_model = {} + load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model + load_balancer_listener_https_redirect_prototype_model = {} + load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' + + # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model + load_balancer_listener_policy_rule_prototype_model = {} + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model['type'] = 'body' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' + + # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + load_balancer_listener_policy_target_prototype_model = {} + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model + load_balancer_listener_policy_prototype_model = {} + load_balancer_listener_policy_prototype_model['action'] = 'forward' + load_balancer_listener_policy_prototype_model['name'] = 'my-policy' + load_balancer_listener_policy_prototype_model['priority'] = 5 + load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model] + load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' - members = [load_balancer_pool_member_prototype_model] + protocol = 'http' + accept_proxy_protocol = True + certificate_instance = certificate_instance_identity_model + connection_limit = 2000 + default_pool = load_balancer_pool_identity_model + https_redirect = load_balancer_listener_https_redirect_prototype_model + idle_connection_timeout = 100 + policies = [load_balancer_listener_policy_prototype_model] + port = 443 + port_max = 499 + port_min = 443 # Pass in all but one required param and check for a ValueError req_param_dict = { "load_balancer_id": load_balancer_id, - "pool_id": pool_id, - "members": members, + "protocol": protocol, } 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.replace_load_balancer_pool_members(**req_copy) + _service.create_load_balancer_listener(**req_copy) - def test_replace_load_balancer_pool_members_value_error_with_retries(self): - # Enable retries and run test_replace_load_balancer_pool_members_value_error. + def test_create_load_balancer_listener_value_error_with_retries(self): + # Enable retries and run test_create_load_balancer_listener_value_error. _service.enable_retries() - self.test_replace_load_balancer_pool_members_value_error() + self.test_create_load_balancer_listener_value_error() - # Disable retries and run test_replace_load_balancer_pool_members_value_error. + # Disable retries and run test_create_load_balancer_listener_value_error. _service.disable_retries() - self.test_replace_load_balancer_pool_members_value_error() + self.test_create_load_balancer_listener_value_error() -class TestDeleteLoadBalancerPoolMember: +class TestDeleteLoadBalancerListener: """ - Test Class for delete_load_balancer_pool_member + Test Class for delete_load_balancer_listener """ @responses.activate - def test_delete_load_balancer_pool_member_all_params(self): + def test_delete_load_balancer_listener_all_params(self): """ - delete_load_balancer_pool_member() + delete_load_balancer_listener() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') + url = preprocess_url('/load_balancers/testString/listeners/testString') responses.add( responses.DELETE, url, @@ -45714,13 +47354,11 @@ def test_delete_load_balancer_pool_member_all_params(self): # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' id = 'testString' # Invoke method - response = _service.delete_load_balancer_pool_member( + response = _service.delete_load_balancer_listener( load_balancer_id, - pool_id, id, headers={}, ) @@ -45729,22 +47367,22 @@ def test_delete_load_balancer_pool_member_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 202 - def test_delete_load_balancer_pool_member_all_params_with_retries(self): - # Enable retries and run test_delete_load_balancer_pool_member_all_params. + def test_delete_load_balancer_listener_all_params_with_retries(self): + # Enable retries and run test_delete_load_balancer_listener_all_params. _service.enable_retries() - self.test_delete_load_balancer_pool_member_all_params() + self.test_delete_load_balancer_listener_all_params() - # Disable retries and run test_delete_load_balancer_pool_member_all_params. + # Disable retries and run test_delete_load_balancer_listener_all_params. _service.disable_retries() - self.test_delete_load_balancer_pool_member_all_params() + self.test_delete_load_balancer_listener_all_params() @responses.activate - def test_delete_load_balancer_pool_member_value_error(self): + def test_delete_load_balancer_listener_value_error(self): """ - test_delete_load_balancer_pool_member_value_error() + test_delete_load_balancer_listener_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') + url = preprocess_url('/load_balancers/testString/listeners/testString') responses.add( responses.DELETE, url, @@ -45753,43 +47391,41 @@ def test_delete_load_balancer_pool_member_value_error(self): # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { "load_balancer_id": load_balancer_id, - "pool_id": pool_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.delete_load_balancer_pool_member(**req_copy) + _service.delete_load_balancer_listener(**req_copy) - def test_delete_load_balancer_pool_member_value_error_with_retries(self): - # Enable retries and run test_delete_load_balancer_pool_member_value_error. + def test_delete_load_balancer_listener_value_error_with_retries(self): + # Enable retries and run test_delete_load_balancer_listener_value_error. _service.enable_retries() - self.test_delete_load_balancer_pool_member_value_error() + self.test_delete_load_balancer_listener_value_error() - # Disable retries and run test_delete_load_balancer_pool_member_value_error. + # Disable retries and run test_delete_load_balancer_listener_value_error. _service.disable_retries() - self.test_delete_load_balancer_pool_member_value_error() + self.test_delete_load_balancer_listener_value_error() -class TestGetLoadBalancerPoolMember: +class TestGetLoadBalancerListener: """ - Test Class for get_load_balancer_pool_member + Test Class for get_load_balancer_listener """ @responses.activate - def test_get_load_balancer_pool_member_all_params(self): + def test_get_load_balancer_listener_all_params(self): """ - get_load_balancer_pool_member() + get_load_balancer_listener() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' + url = preprocess_url('/load_balancers/testString/listeners/testString') + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add( responses.GET, url, @@ -45800,13 +47436,11 @@ def test_get_load_balancer_pool_member_all_params(self): # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' id = 'testString' # Invoke method - response = _service.get_load_balancer_pool_member( + response = _service.get_load_balancer_listener( load_balancer_id, - pool_id, id, headers={}, ) @@ -45815,23 +47449,23 @@ def test_get_load_balancer_pool_member_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_load_balancer_pool_member_all_params_with_retries(self): - # Enable retries and run test_get_load_balancer_pool_member_all_params. + def test_get_load_balancer_listener_all_params_with_retries(self): + # Enable retries and run test_get_load_balancer_listener_all_params. _service.enable_retries() - self.test_get_load_balancer_pool_member_all_params() + self.test_get_load_balancer_listener_all_params() - # Disable retries and run test_get_load_balancer_pool_member_all_params. + # Disable retries and run test_get_load_balancer_listener_all_params. _service.disable_retries() - self.test_get_load_balancer_pool_member_all_params() + self.test_get_load_balancer_listener_all_params() @responses.activate - def test_get_load_balancer_pool_member_value_error(self): + def test_get_load_balancer_listener_value_error(self): """ - test_get_load_balancer_pool_member_value_error() + test_get_load_balancer_listener_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' + url = preprocess_url('/load_balancers/testString/listeners/testString') + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add( responses.GET, url, @@ -45842,43 +47476,41 @@ def test_get_load_balancer_pool_member_value_error(self): # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { "load_balancer_id": load_balancer_id, - "pool_id": pool_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_load_balancer_pool_member(**req_copy) + _service.get_load_balancer_listener(**req_copy) - def test_get_load_balancer_pool_member_value_error_with_retries(self): - # Enable retries and run test_get_load_balancer_pool_member_value_error. + def test_get_load_balancer_listener_value_error_with_retries(self): + # Enable retries and run test_get_load_balancer_listener_value_error. _service.enable_retries() - self.test_get_load_balancer_pool_member_value_error() + self.test_get_load_balancer_listener_value_error() - # Disable retries and run test_get_load_balancer_pool_member_value_error. + # Disable retries and run test_get_load_balancer_listener_value_error. _service.disable_retries() - self.test_get_load_balancer_pool_member_value_error() + self.test_get_load_balancer_listener_value_error() -class TestUpdateLoadBalancerPoolMember: +class TestUpdateLoadBalancerListener: """ - Test Class for update_load_balancer_pool_member + Test Class for update_load_balancer_listener """ @responses.activate - def test_update_load_balancer_pool_member_all_params(self): + def test_update_load_balancer_listener_all_params(self): """ - update_load_balancer_pool_member() + update_load_balancer_listener() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' + url = preprocess_url('/load_balancers/testString/listeners/testString') + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add( responses.PATCH, url, @@ -45887,28 +47519,47 @@ def test_update_load_balancer_pool_member_all_params(self): status=200, ) - # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a dict representation of a LoadBalancerPoolMemberPatch model - load_balancer_pool_member_patch_model = {} - load_balancer_pool_member_patch_model['port'] = 80 - load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model - load_balancer_pool_member_patch_model['weight'] = 50 + # Construct a dict representation of a LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById model + load_balancer_listener_default_pool_patch_model = {} + load_balancer_listener_default_pool_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model + load_balancer_listener_https_redirect_patch_model = {} + load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get' + + # Construct a dict representation of a LoadBalancerListenerPatch model + load_balancer_listener_patch_model = {} + load_balancer_listener_patch_model['accept_proxy_protocol'] = True + load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model + load_balancer_listener_patch_model['connection_limit'] = 2000 + load_balancer_listener_patch_model['default_pool'] = load_balancer_listener_default_pool_patch_model + load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model + load_balancer_listener_patch_model['idle_connection_timeout'] = 100 + load_balancer_listener_patch_model['port'] = 443 + load_balancer_listener_patch_model['port_max'] = 499 + load_balancer_listener_patch_model['port_min'] = 443 + load_balancer_listener_patch_model['protocol'] = 'http' # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' id = 'testString' - load_balancer_pool_member_patch = load_balancer_pool_member_patch_model + load_balancer_listener_patch = load_balancer_listener_patch_model # Invoke method - response = _service.update_load_balancer_pool_member( + response = _service.update_load_balancer_listener( load_balancer_id, - pool_id, id, - load_balancer_pool_member_patch, + load_balancer_listener_patch, headers={}, ) @@ -45917,25 +47568,25 @@ def test_update_load_balancer_pool_member_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == load_balancer_pool_member_patch + assert req_body == load_balancer_listener_patch - def test_update_load_balancer_pool_member_all_params_with_retries(self): - # Enable retries and run test_update_load_balancer_pool_member_all_params. + def test_update_load_balancer_listener_all_params_with_retries(self): + # Enable retries and run test_update_load_balancer_listener_all_params. _service.enable_retries() - self.test_update_load_balancer_pool_member_all_params() + self.test_update_load_balancer_listener_all_params() - # Disable retries and run test_update_load_balancer_pool_member_all_params. + # Disable retries and run test_update_load_balancer_listener_all_params. _service.disable_retries() - self.test_update_load_balancer_pool_member_all_params() + self.test_update_load_balancer_listener_all_params() @responses.activate - def test_update_load_balancer_pool_member_value_error(self): + def test_update_load_balancer_listener_value_error(self): """ - test_update_load_balancer_pool_member_value_error() + test_update_load_balancer_listener_value_error() """ # Set up mock - url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a", "id": "0717_1e09281b-f177-46f2-b1f1-bc152b2e391a", "name": "my-instance"}, "weight": 50}' + url = preprocess_url('/load_balancers/testString/listeners/testString') + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add( responses.PATCH, url, @@ -45944,114 +47595,76 @@ def test_update_load_balancer_pool_member_value_error(self): status=200, ) - # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - load_balancer_pool_member_target_prototype_model = {} - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a dict representation of a LoadBalancerPoolMemberPatch model - load_balancer_pool_member_patch_model = {} - load_balancer_pool_member_patch_model['port'] = 80 - load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model - load_balancer_pool_member_patch_model['weight'] = 50 + # Construct a dict representation of a LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById model + load_balancer_listener_default_pool_patch_model = {} + load_balancer_listener_default_pool_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model + load_balancer_listener_https_redirect_patch_model = {} + load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get' + + # Construct a dict representation of a LoadBalancerListenerPatch model + load_balancer_listener_patch_model = {} + load_balancer_listener_patch_model['accept_proxy_protocol'] = True + load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model + load_balancer_listener_patch_model['connection_limit'] = 2000 + load_balancer_listener_patch_model['default_pool'] = load_balancer_listener_default_pool_patch_model + load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model + load_balancer_listener_patch_model['idle_connection_timeout'] = 100 + load_balancer_listener_patch_model['port'] = 443 + load_balancer_listener_patch_model['port_max'] = 499 + load_balancer_listener_patch_model['port_min'] = 443 + load_balancer_listener_patch_model['protocol'] = 'http' # Set up parameter values load_balancer_id = 'testString' - pool_id = 'testString' id = 'testString' - load_balancer_pool_member_patch = load_balancer_pool_member_patch_model + load_balancer_listener_patch = load_balancer_listener_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { "load_balancer_id": load_balancer_id, - "pool_id": pool_id, "id": id, - "load_balancer_pool_member_patch": load_balancer_pool_member_patch, + "load_balancer_listener_patch": load_balancer_listener_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_load_balancer_pool_member(**req_copy) + _service.update_load_balancer_listener(**req_copy) - def test_update_load_balancer_pool_member_value_error_with_retries(self): - # Enable retries and run test_update_load_balancer_pool_member_value_error. + def test_update_load_balancer_listener_value_error_with_retries(self): + # Enable retries and run test_update_load_balancer_listener_value_error. _service.enable_retries() - self.test_update_load_balancer_pool_member_value_error() + self.test_update_load_balancer_listener_value_error() - # Disable retries and run test_update_load_balancer_pool_member_value_error. + # Disable retries and run test_update_load_balancer_listener_value_error. _service.disable_retries() - self.test_update_load_balancer_pool_member_value_error() - - -# endregion -############################################################################## -# End of Service: LoadBalancers -############################################################################## - -############################################################################## -# Start of Service: EndpointGateways -############################################################################## -# region - - -class TestNewInstance: - """ - Test Class for new_instance - """ - - def test_new_instance(self): - """ - new_instance() - """ - os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE', - ) - - assert service is not None - assert isinstance(service, VpcV1) - - def test_new_instance_without_authenticator(self): - """ - new_instance_without_authenticator() - """ - with pytest.raises(ValueError, match='authenticator must be provided'): - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE_NOT_FOUND', - ) - - def test_new_instance_without_required_params(self): - """ - new_instance_without_required_params() - """ - with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): - service = VpcV1.new_instance() - - def test_new_instance_required_param_none(self): - """ - new_instance_required_param_none() - """ - with pytest.raises(ValueError, match='version must be provided'): - service = VpcV1.new_instance( - version=None, - ) + self.test_update_load_balancer_listener_value_error() -class TestListEndpointGateways: +class TestListLoadBalancerListenerPolicies: """ - Test Class for list_endpoint_gateways + Test Class for list_load_balancer_listener_policies """ @responses.activate - def test_list_endpoint_gateways_all_params(self): + def test_list_load_balancer_listener_policies_all_params(self): """ - list_endpoint_gateways() + list_load_balancer_listener_policies() """ # Set up mock - url = preprocess_url('/endpoint_gateways') - mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies') + mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}' responses.add( responses.GET, url, @@ -46061,63 +47674,37 @@ def test_list_endpoint_gateways_all_params(self): ) # Set up parameter values - name = 'my-name' - start = 'testString' - limit = 50 - resource_group_id = 'testString' - lifecycle_state = ['stable'] - vpc_id = 'testString' - vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' - vpc_name = 'my-vpc' - allow_dns_resolution_binding = True + load_balancer_id = 'testString' + listener_id = 'testString' # Invoke method - response = _service.list_endpoint_gateways( - name=name, - start=start, - limit=limit, - resource_group_id=resource_group_id, - lifecycle_state=lifecycle_state, - vpc_id=vpc_id, - vpc_crn=vpc_crn, - vpc_name=vpc_name, - allow_dns_resolution_binding=allow_dns_resolution_binding, + response = _service.list_load_balancer_listener_policies( + load_balancer_id, + listener_id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'name={}'.format(name) in query_string - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'resource_group.id={}'.format(resource_group_id) in query_string - assert 'lifecycle_state={}'.format(','.join(lifecycle_state)) in query_string - assert 'vpc.id={}'.format(vpc_id) in query_string - assert 'vpc.crn={}'.format(vpc_crn) in query_string - assert 'vpc.name={}'.format(vpc_name) in query_string - assert 'allow_dns_resolution_binding={}'.format('true' if allow_dns_resolution_binding else 'false') in query_string - def test_list_endpoint_gateways_all_params_with_retries(self): - # Enable retries and run test_list_endpoint_gateways_all_params. + def test_list_load_balancer_listener_policies_all_params_with_retries(self): + # Enable retries and run test_list_load_balancer_listener_policies_all_params. _service.enable_retries() - self.test_list_endpoint_gateways_all_params() + self.test_list_load_balancer_listener_policies_all_params() - # Disable retries and run test_list_endpoint_gateways_all_params. + # Disable retries and run test_list_load_balancer_listener_policies_all_params. _service.disable_retries() - self.test_list_endpoint_gateways_all_params() + self.test_list_load_balancer_listener_policies_all_params() @responses.activate - def test_list_endpoint_gateways_required_params(self): + def test_list_load_balancer_listener_policies_value_error(self): """ - test_list_endpoint_gateways_required_params() + test_list_load_balancer_listener_policies_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways') - mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies') + mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}' responses.add( responses.GET, url, @@ -46126,303 +47713,257 @@ def test_list_endpoint_gateways_required_params(self): status=200, ) - # Invoke method - response = _service.list_endpoint_gateways() + # Set up parameter values + load_balancer_id = 'testString' + listener_id = 'testString' - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "load_balancer_id": load_balancer_id, + "listener_id": listener_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.list_load_balancer_listener_policies(**req_copy) - def test_list_endpoint_gateways_required_params_with_retries(self): - # Enable retries and run test_list_endpoint_gateways_required_params. + def test_list_load_balancer_listener_policies_value_error_with_retries(self): + # Enable retries and run test_list_load_balancer_listener_policies_value_error. _service.enable_retries() - self.test_list_endpoint_gateways_required_params() + self.test_list_load_balancer_listener_policies_value_error() - # Disable retries and run test_list_endpoint_gateways_required_params. + # Disable retries and run test_list_load_balancer_listener_policies_value_error. _service.disable_retries() - self.test_list_endpoint_gateways_required_params() + self.test_list_load_balancer_listener_policies_value_error() + + +class TestCreateLoadBalancerListenerPolicy: + """ + Test Class for create_load_balancer_listener_policy + """ @responses.activate - def test_list_endpoint_gateways_value_error(self): + def test_create_load_balancer_listener_policy_all_params(self): """ - test_list_endpoint_gateways_value_error() + create_load_balancer_listener_policy() """ # Set up mock - url = preprocess_url('/endpoint_gateways') - mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies') + mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add( - responses.GET, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Pass in all but one required param and check for a ValueError - req_param_dict = { - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.list_endpoint_gateways(**req_copy) + # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model + load_balancer_listener_policy_rule_prototype_model = {} + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model['type'] = 'body' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' - def test_list_endpoint_gateways_value_error_with_retries(self): - # Enable retries and run test_list_endpoint_gateways_value_error. + # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + load_balancer_listener_policy_target_prototype_model = {} + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Set up parameter values + load_balancer_id = 'testString' + listener_id = 'testString' + action = 'forward' + priority = 5 + name = 'my-policy' + rules = [load_balancer_listener_policy_rule_prototype_model] + target = load_balancer_listener_policy_target_prototype_model + + # Invoke method + response = _service.create_load_balancer_listener_policy( + load_balancer_id, + listener_id, + action, + priority, + name=name, + rules=rules, + target=target, + 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['action'] == 'forward' + assert req_body['priority'] == 5 + assert req_body['name'] == 'my-policy' + assert req_body['rules'] == [load_balancer_listener_policy_rule_prototype_model] + assert req_body['target'] == load_balancer_listener_policy_target_prototype_model + + def test_create_load_balancer_listener_policy_all_params_with_retries(self): + # Enable retries and run test_create_load_balancer_listener_policy_all_params. _service.enable_retries() - self.test_list_endpoint_gateways_value_error() + self.test_create_load_balancer_listener_policy_all_params() - # Disable retries and run test_list_endpoint_gateways_value_error. + # Disable retries and run test_create_load_balancer_listener_policy_all_params. _service.disable_retries() - self.test_list_endpoint_gateways_value_error() + self.test_create_load_balancer_listener_policy_all_params() @responses.activate - def test_list_endpoint_gateways_with_pager_get_next(self): + def test_create_load_balancer_listener_policy_value_error(self): """ - test_list_endpoint_gateways_with_pager_get_next() + test_create_load_balancer_listener_policy_value_error() """ - # Set up a two-page mock response - url = preprocess_url('/endpoint_gateways') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) + # Set up mock + url = preprocess_url('/load_balancers/testString/listeners/testString/policies') + mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add( - responses.GET, + responses.POST, url, - body=mock_response2, + body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Exercise the pager class for this operation - all_results = [] - pager = EndpointGatewaysPager( - client=_service, - name='my-name', - limit=10, - resource_group_id='testString', - lifecycle_state=['stable'], - vpc_id='testString', - vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', - vpc_name='my-vpc', - allow_dns_resolution_binding=True, - ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 + # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model + load_balancer_listener_policy_rule_prototype_model = {} + load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains' + load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_prototype_model['type'] = 'body' + load_balancer_listener_policy_rule_prototype_model['value'] = 'testString' - @responses.activate - def test_list_endpoint_gateways_with_pager_get_all(self): - """ - test_list_endpoint_gateways_with_pager_get_all() - """ - # Set up a two-page mock response - url = preprocess_url('/endpoint_gateways') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) + # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + load_balancer_listener_policy_target_prototype_model = {} + load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' - # Exercise the pager class for this operation - pager = EndpointGatewaysPager( - client=_service, - name='my-name', - limit=10, - resource_group_id='testString', - lifecycle_state=['stable'], - vpc_id='testString', - vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', - vpc_name='my-vpc', - allow_dns_resolution_binding=True, - ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + # Set up parameter values + load_balancer_id = 'testString' + listener_id = 'testString' + action = 'forward' + priority = 5 + name = 'my-policy' + rules = [load_balancer_listener_policy_rule_prototype_model] + target = load_balancer_listener_policy_target_prototype_model + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "action": action, + "priority": priority, + } + 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_load_balancer_listener_policy(**req_copy) -class TestCreateEndpointGateway: + def test_create_load_balancer_listener_policy_value_error_with_retries(self): + # Enable retries and run test_create_load_balancer_listener_policy_value_error. + _service.enable_retries() + self.test_create_load_balancer_listener_policy_value_error() + + # Disable retries and run test_create_load_balancer_listener_policy_value_error. + _service.disable_retries() + self.test_create_load_balancer_listener_policy_value_error() + + +class TestDeleteLoadBalancerListenerPolicy: """ - Test Class for create_endpoint_gateway + Test Class for delete_load_balancer_listener_policy """ @responses.activate - def test_create_endpoint_gateway_all_params(self): + def test_delete_load_balancer_listener_policy_all_params(self): """ - create_endpoint_gateway() + delete_load_balancer_listener_policy() """ # Set up mock - url = preprocess_url('/endpoint_gateways') - mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') responses.add( - responses.POST, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=201, + status=202, ) - # Construct a dict representation of a EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model - endpoint_gateway_target_prototype_model = {} - endpoint_gateway_target_prototype_model['name'] = 'ibm-ntp-server' - endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service' - - # Construct a dict representation of a VPCIdentityById model - vpc_identity_model = {} - vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf' - - # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityById model - endpoint_gateway_reserved_ip_model = {} - endpoint_gateway_reserved_ip_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a SecurityGroupIdentityById model - security_group_identity_model = {} - security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' - # Set up parameter values - target = endpoint_gateway_target_prototype_model - vpc = vpc_identity_model - allow_dns_resolution_binding = True - ips = [endpoint_gateway_reserved_ip_model] - name = 'testString' - resource_group = resource_group_identity_model - security_groups = [security_group_identity_model] + load_balancer_id = 'testString' + listener_id = 'testString' + id = 'testString' # Invoke method - response = _service.create_endpoint_gateway( - target, - vpc, - allow_dns_resolution_binding=allow_dns_resolution_binding, - ips=ips, - name=name, - resource_group=resource_group, - security_groups=security_groups, + response = _service.delete_load_balancer_listener_policy( + load_balancer_id, + listener_id, + id, 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['target'] == endpoint_gateway_target_prototype_model - assert req_body['vpc'] == vpc_identity_model - assert req_body['allow_dns_resolution_binding'] == True - assert req_body['ips'] == [endpoint_gateway_reserved_ip_model] - assert req_body['name'] == 'testString' - assert req_body['resource_group'] == resource_group_identity_model - assert req_body['security_groups'] == [security_group_identity_model] + assert response.status_code == 202 - def test_create_endpoint_gateway_all_params_with_retries(self): - # Enable retries and run test_create_endpoint_gateway_all_params. + def test_delete_load_balancer_listener_policy_all_params_with_retries(self): + # Enable retries and run test_delete_load_balancer_listener_policy_all_params. _service.enable_retries() - self.test_create_endpoint_gateway_all_params() + self.test_delete_load_balancer_listener_policy_all_params() - # Disable retries and run test_create_endpoint_gateway_all_params. + # Disable retries and run test_delete_load_balancer_listener_policy_all_params. _service.disable_retries() - self.test_create_endpoint_gateway_all_params() + self.test_delete_load_balancer_listener_policy_all_params() @responses.activate - def test_create_endpoint_gateway_value_error(self): + def test_delete_load_balancer_listener_policy_value_error(self): """ - test_create_endpoint_gateway_value_error() + test_delete_load_balancer_listener_policy_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways') - mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') responses.add( - responses.POST, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=201, + status=202, ) - # Construct a dict representation of a EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model - endpoint_gateway_target_prototype_model = {} - endpoint_gateway_target_prototype_model['name'] = 'ibm-ntp-server' - endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service' - - # Construct a dict representation of a VPCIdentityById model - vpc_identity_model = {} - vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf' - - # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityById model - endpoint_gateway_reserved_ip_model = {} - endpoint_gateway_reserved_ip_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - # Construct a dict representation of a SecurityGroupIdentityById model - security_group_identity_model = {} - security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' - # Set up parameter values - target = endpoint_gateway_target_prototype_model - vpc = vpc_identity_model - allow_dns_resolution_binding = True - ips = [endpoint_gateway_reserved_ip_model] - name = 'testString' - resource_group = resource_group_identity_model - security_groups = [security_group_identity_model] + load_balancer_id = 'testString' + listener_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "target": target, - "vpc": vpc, + "load_balancer_id": load_balancer_id, + "listener_id": listener_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.create_endpoint_gateway(**req_copy) + _service.delete_load_balancer_listener_policy(**req_copy) - def test_create_endpoint_gateway_value_error_with_retries(self): - # Enable retries and run test_create_endpoint_gateway_value_error. + def test_delete_load_balancer_listener_policy_value_error_with_retries(self): + # Enable retries and run test_delete_load_balancer_listener_policy_value_error. _service.enable_retries() - self.test_create_endpoint_gateway_value_error() + self.test_delete_load_balancer_listener_policy_value_error() - # Disable retries and run test_create_endpoint_gateway_value_error. + # Disable retries and run test_delete_load_balancer_listener_policy_value_error. _service.disable_retries() - self.test_create_endpoint_gateway_value_error() + self.test_delete_load_balancer_listener_policy_value_error() -class TestListEndpointGatewayIps: +class TestGetLoadBalancerListenerPolicy: """ - Test Class for list_endpoint_gateway_ips + Test Class for get_load_balancer_listener_policy """ @responses.activate - def test_list_endpoint_gateway_ips_all_params(self): + def test_get_load_balancer_listener_policy_all_params(self): """ - list_endpoint_gateway_ips() + get_load_balancer_listener_policy() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') + mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add( responses.GET, url, @@ -46432,47 +47973,39 @@ def test_list_endpoint_gateway_ips_all_params(self): ) # Set up parameter values - endpoint_gateway_id = 'testString' - start = 'testString' - limit = 50 - sort = 'name' + load_balancer_id = 'testString' + listener_id = 'testString' + id = 'testString' # Invoke method - response = _service.list_endpoint_gateway_ips( - endpoint_gateway_id, - start=start, - limit=limit, - sort=sort, + response = _service.get_load_balancer_listener_policy( + load_balancer_id, + listener_id, + id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'sort={}'.format(sort) in query_string - def test_list_endpoint_gateway_ips_all_params_with_retries(self): - # Enable retries and run test_list_endpoint_gateway_ips_all_params. + def test_get_load_balancer_listener_policy_all_params_with_retries(self): + # Enable retries and run test_get_load_balancer_listener_policy_all_params. _service.enable_retries() - self.test_list_endpoint_gateway_ips_all_params() + self.test_get_load_balancer_listener_policy_all_params() - # Disable retries and run test_list_endpoint_gateway_ips_all_params. + # Disable retries and run test_get_load_balancer_listener_policy_all_params. _service.disable_retries() - self.test_list_endpoint_gateway_ips_all_params() + self.test_get_load_balancer_listener_policy_all_params() @responses.activate - def test_list_endpoint_gateway_ips_required_params(self): + def test_get_load_balancer_listener_policy_value_error(self): """ - test_list_endpoint_gateway_ips_required_params() + test_get_load_balancer_listener_policy_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') + mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add( responses.GET, url, @@ -46482,475 +48015,653 @@ def test_list_endpoint_gateway_ips_required_params(self): ) # Set up parameter values - endpoint_gateway_id = 'testString' + load_balancer_id = 'testString' + listener_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "load_balancer_id": load_balancer_id, + "listener_id": listener_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_load_balancer_listener_policy(**req_copy) + + def test_get_load_balancer_listener_policy_value_error_with_retries(self): + # Enable retries and run test_get_load_balancer_listener_policy_value_error. + _service.enable_retries() + self.test_get_load_balancer_listener_policy_value_error() + + # Disable retries and run test_get_load_balancer_listener_policy_value_error. + _service.disable_retries() + self.test_get_load_balancer_listener_policy_value_error() + + +class TestUpdateLoadBalancerListenerPolicy: + """ + Test Class for update_load_balancer_listener_policy + """ + + @responses.activate + def test_update_load_balancer_listener_policy_all_params(self): + """ + update_load_balancer_listener_policy() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') + mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + load_balancer_listener_policy_target_patch_model = {} + load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerPolicyPatch model + load_balancer_listener_policy_patch_model = {} + load_balancer_listener_policy_patch_model['name'] = 'my-policy' + load_balancer_listener_policy_patch_model['priority'] = 5 + load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model + + # Set up parameter values + load_balancer_id = 'testString' + listener_id = 'testString' + id = 'testString' + load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model # Invoke method - response = _service.list_endpoint_gateway_ips( - endpoint_gateway_id, + response = _service.update_load_balancer_listener_policy( + load_balancer_id, + listener_id, + id, + load_balancer_listener_policy_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == load_balancer_listener_policy_patch - def test_list_endpoint_gateway_ips_required_params_with_retries(self): - # Enable retries and run test_list_endpoint_gateway_ips_required_params. + def test_update_load_balancer_listener_policy_all_params_with_retries(self): + # Enable retries and run test_update_load_balancer_listener_policy_all_params. _service.enable_retries() - self.test_list_endpoint_gateway_ips_required_params() + self.test_update_load_balancer_listener_policy_all_params() - # Disable retries and run test_list_endpoint_gateway_ips_required_params. + # Disable retries and run test_update_load_balancer_listener_policy_all_params. _service.disable_retries() - self.test_list_endpoint_gateway_ips_required_params() + self.test_update_load_balancer_listener_policy_all_params() @responses.activate - def test_list_endpoint_gateway_ips_value_error(self): + def test_update_load_balancer_listener_policy_value_error(self): """ - test_list_endpoint_gateway_ips_value_error() + test_update_load_balancer_listener_policy_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') + mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}' responses.add( - responses.GET, + responses.PATCH, url, body=mock_response, content_type='application/json', status=200, ) + # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + load_balancer_listener_policy_target_patch_model = {} + load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerPolicyPatch model + load_balancer_listener_policy_patch_model = {} + load_balancer_listener_policy_patch_model['name'] = 'my-policy' + load_balancer_listener_policy_patch_model['priority'] = 5 + load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model + # Set up parameter values - endpoint_gateway_id = 'testString' + load_balancer_id = 'testString' + listener_id = 'testString' + id = 'testString' + load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "endpoint_gateway_id": endpoint_gateway_id, + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "id": id, + "load_balancer_listener_policy_patch": load_balancer_listener_policy_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_endpoint_gateway_ips(**req_copy) + _service.update_load_balancer_listener_policy(**req_copy) - def test_list_endpoint_gateway_ips_value_error_with_retries(self): - # Enable retries and run test_list_endpoint_gateway_ips_value_error. + def test_update_load_balancer_listener_policy_value_error_with_retries(self): + # Enable retries and run test_update_load_balancer_listener_policy_value_error. _service.enable_retries() - self.test_list_endpoint_gateway_ips_value_error() + self.test_update_load_balancer_listener_policy_value_error() - # Disable retries and run test_list_endpoint_gateway_ips_value_error. + # Disable retries and run test_update_load_balancer_listener_policy_value_error. _service.disable_retries() - self.test_list_endpoint_gateway_ips_value_error() + self.test_update_load_balancer_listener_policy_value_error() + + +class TestListLoadBalancerListenerPolicyRules: + """ + Test Class for list_load_balancer_listener_policy_rules + """ @responses.activate - def test_list_endpoint_gateway_ips_with_pager_get_next(self): + def test_list_load_balancer_listener_policy_rules_all_params(self): """ - test_list_endpoint_gateway_ips_with_pager_get_next() + list_load_balancer_listener_policy_rules() """ - # Set up a two-page mock response - url = preprocess_url('/endpoint_gateways/testString/ips') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) + # Set up mock + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules') + mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}]}' responses.add( responses.GET, url, - body=mock_response2, + body=mock_response, content_type='application/json', status=200, ) - # Exercise the pager class for this operation - all_results = [] - pager = EndpointGatewayIpsPager( - client=_service, - endpoint_gateway_id='testString', - limit=10, - sort='name', + # Set up parameter values + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' + + # Invoke method + response = _service.list_load_balancer_listener_policy_rules( + load_balancer_id, + listener_id, + policy_id, + headers={}, ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_load_balancer_listener_policy_rules_all_params_with_retries(self): + # Enable retries and run test_list_load_balancer_listener_policy_rules_all_params. + _service.enable_retries() + self.test_list_load_balancer_listener_policy_rules_all_params() + + # Disable retries and run test_list_load_balancer_listener_policy_rules_all_params. + _service.disable_retries() + self.test_list_load_balancer_listener_policy_rules_all_params() @responses.activate - def test_list_endpoint_gateway_ips_with_pager_get_all(self): + def test_list_load_balancer_listener_policy_rules_value_error(self): """ - test_list_endpoint_gateway_ips_with_pager_get_all() + test_list_load_balancer_listener_policy_rules_value_error() """ - # Set up a two-page mock response - url = preprocess_url('/endpoint_gateways/testString/ips') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}' + # Set up mock + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules') + mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}]}' responses.add( responses.GET, url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, + body=mock_response, content_type='application/json', status=200, ) - # Exercise the pager class for this operation - pager = EndpointGatewayIpsPager( - client=_service, - endpoint_gateway_id='testString', - limit=10, - sort='name', - ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + # Set up parameter values + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "policy_id": policy_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.list_load_balancer_listener_policy_rules(**req_copy) -class TestRemoveEndpointGatewayIp: + def test_list_load_balancer_listener_policy_rules_value_error_with_retries(self): + # Enable retries and run test_list_load_balancer_listener_policy_rules_value_error. + _service.enable_retries() + self.test_list_load_balancer_listener_policy_rules_value_error() + + # Disable retries and run test_list_load_balancer_listener_policy_rules_value_error. + _service.disable_retries() + self.test_list_load_balancer_listener_policy_rules_value_error() + + +class TestCreateLoadBalancerListenerPolicyRule: """ - Test Class for remove_endpoint_gateway_ip + Test Class for create_load_balancer_listener_policy_rule """ @responses.activate - def test_remove_endpoint_gateway_ip_all_params(self): + def test_create_load_balancer_listener_policy_rule_all_params(self): """ - remove_endpoint_gateway_ip() + create_load_balancer_listener_policy_rule() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips/testString') + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules') + mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' responses.add( - responses.DELETE, + responses.POST, url, - status=204, + body=mock_response, + content_type='application/json', + status=201, ) # Set up parameter values - endpoint_gateway_id = 'testString' - id = 'testString' + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' + condition = 'contains' + type = 'body' + value = 'testString' + field = 'MY-APP-HEADER' # Invoke method - response = _service.remove_endpoint_gateway_ip( - endpoint_gateway_id, - id, + response = _service.create_load_balancer_listener_policy_rule( + load_balancer_id, + listener_id, + policy_id, + condition, + type, + value, + field=field, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['condition'] == 'contains' + assert req_body['type'] == 'body' + assert req_body['value'] == 'testString' + assert req_body['field'] == 'MY-APP-HEADER' - def test_remove_endpoint_gateway_ip_all_params_with_retries(self): - # Enable retries and run test_remove_endpoint_gateway_ip_all_params. + def test_create_load_balancer_listener_policy_rule_all_params_with_retries(self): + # Enable retries and run test_create_load_balancer_listener_policy_rule_all_params. _service.enable_retries() - self.test_remove_endpoint_gateway_ip_all_params() + self.test_create_load_balancer_listener_policy_rule_all_params() - # Disable retries and run test_remove_endpoint_gateway_ip_all_params. + # Disable retries and run test_create_load_balancer_listener_policy_rule_all_params. _service.disable_retries() - self.test_remove_endpoint_gateway_ip_all_params() + self.test_create_load_balancer_listener_policy_rule_all_params() @responses.activate - def test_remove_endpoint_gateway_ip_value_error(self): + def test_create_load_balancer_listener_policy_rule_value_error(self): """ - test_remove_endpoint_gateway_ip_value_error() + test_create_load_balancer_listener_policy_rule_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips/testString') + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules') + mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' responses.add( - responses.DELETE, + responses.POST, url, - status=204, + body=mock_response, + content_type='application/json', + status=201, ) # Set up parameter values - endpoint_gateway_id = 'testString' - id = 'testString' + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' + condition = 'contains' + type = 'body' + value = 'testString' + field = 'MY-APP-HEADER' # Pass in all but one required param and check for a ValueError req_param_dict = { - "endpoint_gateway_id": endpoint_gateway_id, - "id": id, + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "policy_id": policy_id, + "condition": condition, + "type": type, + "value": value, } 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.remove_endpoint_gateway_ip(**req_copy) + _service.create_load_balancer_listener_policy_rule(**req_copy) - def test_remove_endpoint_gateway_ip_value_error_with_retries(self): - # Enable retries and run test_remove_endpoint_gateway_ip_value_error. + def test_create_load_balancer_listener_policy_rule_value_error_with_retries(self): + # Enable retries and run test_create_load_balancer_listener_policy_rule_value_error. _service.enable_retries() - self.test_remove_endpoint_gateway_ip_value_error() + self.test_create_load_balancer_listener_policy_rule_value_error() - # Disable retries and run test_remove_endpoint_gateway_ip_value_error. + # Disable retries and run test_create_load_balancer_listener_policy_rule_value_error. _service.disable_retries() - self.test_remove_endpoint_gateway_ip_value_error() + self.test_create_load_balancer_listener_policy_rule_value_error() -class TestGetEndpointGatewayIp: +class TestDeleteLoadBalancerListenerPolicyRule: """ - Test Class for get_endpoint_gateway_ip + Test Class for delete_load_balancer_listener_policy_rule """ @responses.activate - def test_get_endpoint_gateway_ip_all_params(self): + def test_delete_load_balancer_listener_policy_rule_all_params(self): """ - get_endpoint_gateway_ip() + delete_load_balancer_listener_policy_rule() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips/testString') - mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=202, ) # Set up parameter values - endpoint_gateway_id = 'testString' + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' id = 'testString' # Invoke method - response = _service.get_endpoint_gateway_ip( - endpoint_gateway_id, + response = _service.delete_load_balancer_listener_policy_rule( + load_balancer_id, + listener_id, + policy_id, id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 202 - def test_get_endpoint_gateway_ip_all_params_with_retries(self): - # Enable retries and run test_get_endpoint_gateway_ip_all_params. + def test_delete_load_balancer_listener_policy_rule_all_params_with_retries(self): + # Enable retries and run test_delete_load_balancer_listener_policy_rule_all_params. _service.enable_retries() - self.test_get_endpoint_gateway_ip_all_params() + self.test_delete_load_balancer_listener_policy_rule_all_params() - # Disable retries and run test_get_endpoint_gateway_ip_all_params. + # Disable retries and run test_delete_load_balancer_listener_policy_rule_all_params. _service.disable_retries() - self.test_get_endpoint_gateway_ip_all_params() + self.test_delete_load_balancer_listener_policy_rule_all_params() @responses.activate - def test_get_endpoint_gateway_ip_value_error(self): + def test_delete_load_balancer_listener_policy_rule_value_error(self): """ - test_get_endpoint_gateway_ip_value_error() + test_delete_load_balancer_listener_policy_rule_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips/testString') - mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=202, ) # Set up parameter values - endpoint_gateway_id = 'testString' + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "endpoint_gateway_id": endpoint_gateway_id, + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "policy_id": policy_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_endpoint_gateway_ip(**req_copy) + _service.delete_load_balancer_listener_policy_rule(**req_copy) - def test_get_endpoint_gateway_ip_value_error_with_retries(self): - # Enable retries and run test_get_endpoint_gateway_ip_value_error. + def test_delete_load_balancer_listener_policy_rule_value_error_with_retries(self): + # Enable retries and run test_delete_load_balancer_listener_policy_rule_value_error. _service.enable_retries() - self.test_get_endpoint_gateway_ip_value_error() + self.test_delete_load_balancer_listener_policy_rule_value_error() - # Disable retries and run test_get_endpoint_gateway_ip_value_error. + # Disable retries and run test_delete_load_balancer_listener_policy_rule_value_error. _service.disable_retries() - self.test_get_endpoint_gateway_ip_value_error() + self.test_delete_load_balancer_listener_policy_rule_value_error() -class TestAddEndpointGatewayIp: +class TestGetLoadBalancerListenerPolicyRule: """ - Test Class for add_endpoint_gateway_ip + Test Class for get_load_balancer_listener_policy_rule """ @responses.activate - def test_add_endpoint_gateway_ip_all_params(self): + def test_get_load_balancer_listener_policy_rule_all_params(self): """ - add_endpoint_gateway_ip() + get_load_balancer_listener_policy_rule() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips/testString') - mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') + mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' responses.add( - responses.PUT, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) # Set up parameter values - endpoint_gateway_id = 'testString' + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' id = 'testString' # Invoke method - response = _service.add_endpoint_gateway_ip( - endpoint_gateway_id, + response = _service.get_load_balancer_listener_policy_rule( + load_balancer_id, + listener_id, + policy_id, id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 201 + assert response.status_code == 200 - def test_add_endpoint_gateway_ip_all_params_with_retries(self): - # Enable retries and run test_add_endpoint_gateway_ip_all_params. + def test_get_load_balancer_listener_policy_rule_all_params_with_retries(self): + # Enable retries and run test_get_load_balancer_listener_policy_rule_all_params. _service.enable_retries() - self.test_add_endpoint_gateway_ip_all_params() + self.test_get_load_balancer_listener_policy_rule_all_params() - # Disable retries and run test_add_endpoint_gateway_ip_all_params. + # Disable retries and run test_get_load_balancer_listener_policy_rule_all_params. _service.disable_retries() - self.test_add_endpoint_gateway_ip_all_params() + self.test_get_load_balancer_listener_policy_rule_all_params() @responses.activate - def test_add_endpoint_gateway_ip_value_error(self): + def test_get_load_balancer_listener_policy_rule_value_error(self): """ - test_add_endpoint_gateway_ip_value_error() + test_get_load_balancer_listener_policy_rule_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString/ips/testString') - mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') + mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' responses.add( - responses.PUT, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) # Set up parameter values - endpoint_gateway_id = 'testString' + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "endpoint_gateway_id": endpoint_gateway_id, + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "policy_id": policy_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.add_endpoint_gateway_ip(**req_copy) + _service.get_load_balancer_listener_policy_rule(**req_copy) - def test_add_endpoint_gateway_ip_value_error_with_retries(self): - # Enable retries and run test_add_endpoint_gateway_ip_value_error. + def test_get_load_balancer_listener_policy_rule_value_error_with_retries(self): + # Enable retries and run test_get_load_balancer_listener_policy_rule_value_error. _service.enable_retries() - self.test_add_endpoint_gateway_ip_value_error() + self.test_get_load_balancer_listener_policy_rule_value_error() - # Disable retries and run test_add_endpoint_gateway_ip_value_error. + # Disable retries and run test_get_load_balancer_listener_policy_rule_value_error. _service.disable_retries() - self.test_add_endpoint_gateway_ip_value_error() + self.test_get_load_balancer_listener_policy_rule_value_error() -class TestDeleteEndpointGateway: +class TestUpdateLoadBalancerListenerPolicyRule: """ - Test Class for delete_endpoint_gateway + Test Class for update_load_balancer_listener_policy_rule """ @responses.activate - def test_delete_endpoint_gateway_all_params(self): + def test_update_load_balancer_listener_policy_rule_all_params(self): """ - delete_endpoint_gateway() + update_load_balancer_listener_policy_rule() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString') + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') + mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' responses.add( - responses.DELETE, + responses.PATCH, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) + # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model + load_balancer_listener_policy_rule_patch_model = {} + load_balancer_listener_policy_rule_patch_model['condition'] = 'contains' + load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_patch_model['type'] = 'body' + load_balancer_listener_policy_rule_patch_model['value'] = 'testString' + # Set up parameter values + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' id = 'testString' + load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model # Invoke method - response = _service.delete_endpoint_gateway( + response = _service.update_load_balancer_listener_policy_rule( + load_balancer_id, + listener_id, + policy_id, id, + load_balancer_listener_policy_rule_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == load_balancer_listener_policy_rule_patch - def test_delete_endpoint_gateway_all_params_with_retries(self): - # Enable retries and run test_delete_endpoint_gateway_all_params. + def test_update_load_balancer_listener_policy_rule_all_params_with_retries(self): + # Enable retries and run test_update_load_balancer_listener_policy_rule_all_params. _service.enable_retries() - self.test_delete_endpoint_gateway_all_params() + self.test_update_load_balancer_listener_policy_rule_all_params() - # Disable retries and run test_delete_endpoint_gateway_all_params. + # Disable retries and run test_update_load_balancer_listener_policy_rule_all_params. _service.disable_retries() - self.test_delete_endpoint_gateway_all_params() + self.test_update_load_balancer_listener_policy_rule_all_params() @responses.activate - def test_delete_endpoint_gateway_value_error(self): + def test_update_load_balancer_listener_policy_rule_value_error(self): """ - test_delete_endpoint_gateway_value_error() + test_update_load_balancer_listener_policy_rule_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString') + url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') + mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}' responses.add( - responses.DELETE, + responses.PATCH, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) + # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model + load_balancer_listener_policy_rule_patch_model = {} + load_balancer_listener_policy_rule_patch_model['condition'] = 'contains' + load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER' + load_balancer_listener_policy_rule_patch_model['type'] = 'body' + load_balancer_listener_policy_rule_patch_model['value'] = 'testString' + # Set up parameter values + load_balancer_id = 'testString' + listener_id = 'testString' + policy_id = 'testString' id = 'testString' + load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { + "load_balancer_id": load_balancer_id, + "listener_id": listener_id, + "policy_id": policy_id, "id": id, + "load_balancer_listener_policy_rule_patch": load_balancer_listener_policy_rule_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.delete_endpoint_gateway(**req_copy) + _service.update_load_balancer_listener_policy_rule(**req_copy) - def test_delete_endpoint_gateway_value_error_with_retries(self): - # Enable retries and run test_delete_endpoint_gateway_value_error. + def test_update_load_balancer_listener_policy_rule_value_error_with_retries(self): + # Enable retries and run test_update_load_balancer_listener_policy_rule_value_error. _service.enable_retries() - self.test_delete_endpoint_gateway_value_error() + self.test_update_load_balancer_listener_policy_rule_value_error() - # Disable retries and run test_delete_endpoint_gateway_value_error. + # Disable retries and run test_update_load_balancer_listener_policy_rule_value_error. _service.disable_retries() - self.test_delete_endpoint_gateway_value_error() + self.test_update_load_balancer_listener_policy_rule_value_error() -class TestGetEndpointGateway: +class TestListLoadBalancerPools: """ - Test Class for get_endpoint_gateway + Test Class for list_load_balancer_pools """ @responses.activate - def test_get_endpoint_gateway_all_params(self): + def test_list_load_balancer_pools_all_params(self): """ - get_endpoint_gateway() + list_load_balancer_pools() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString') - mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools') + mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}' responses.add( responses.GET, url, @@ -46960,11 +48671,11 @@ def test_get_endpoint_gateway_all_params(self): ) # Set up parameter values - id = 'testString' + load_balancer_id = 'testString' # Invoke method - response = _service.get_endpoint_gateway( - id, + response = _service.list_load_balancer_pools( + load_balancer_id, headers={}, ) @@ -46972,23 +48683,23 @@ def test_get_endpoint_gateway_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_endpoint_gateway_all_params_with_retries(self): - # Enable retries and run test_get_endpoint_gateway_all_params. + def test_list_load_balancer_pools_all_params_with_retries(self): + # Enable retries and run test_list_load_balancer_pools_all_params. _service.enable_retries() - self.test_get_endpoint_gateway_all_params() + self.test_list_load_balancer_pools_all_params() - # Disable retries and run test_get_endpoint_gateway_all_params. + # Disable retries and run test_list_load_balancer_pools_all_params. _service.disable_retries() - self.test_get_endpoint_gateway_all_params() + self.test_list_load_balancer_pools_all_params() @responses.activate - def test_get_endpoint_gateway_value_error(self): + def test_list_load_balancer_pools_value_error(self): """ - test_get_endpoint_gateway_value_error() + test_list_load_balancer_pools_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString') - mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools') + mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}' responses.add( responses.GET, url, @@ -46998,261 +48709,281 @@ def test_get_endpoint_gateway_value_error(self): ) # Set up parameter values - id = 'testString' + load_balancer_id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "id": id, + "load_balancer_id": load_balancer_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_endpoint_gateway(**req_copy) + _service.list_load_balancer_pools(**req_copy) - def test_get_endpoint_gateway_value_error_with_retries(self): - # Enable retries and run test_get_endpoint_gateway_value_error. + def test_list_load_balancer_pools_value_error_with_retries(self): + # Enable retries and run test_list_load_balancer_pools_value_error. _service.enable_retries() - self.test_get_endpoint_gateway_value_error() + self.test_list_load_balancer_pools_value_error() - # Disable retries and run test_get_endpoint_gateway_value_error. + # Disable retries and run test_list_load_balancer_pools_value_error. _service.disable_retries() - self.test_get_endpoint_gateway_value_error() + self.test_list_load_balancer_pools_value_error() -class TestUpdateEndpointGateway: +class TestCreateLoadBalancerPool: """ - Test Class for update_endpoint_gateway + Test Class for create_load_balancer_pool """ @responses.activate - def test_update_endpoint_gateway_all_params(self): + def test_create_load_balancer_pool_all_params(self): """ - update_endpoint_gateway() + create_load_balancer_pool() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString') - mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools') + mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' responses.add( - responses.PATCH, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Construct a dict representation of a EndpointGatewayPatch model - endpoint_gateway_patch_model = {} - endpoint_gateway_patch_model['allow_dns_resolution_binding'] = True - endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway' + # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model + load_balancer_pool_health_monitor_prototype_model = {} + load_balancer_pool_health_monitor_prototype_model['delay'] = 5 + load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2 + load_balancer_pool_health_monitor_prototype_model['port'] = 22 + load_balancer_pool_health_monitor_prototype_model['timeout'] = 2 + load_balancer_pool_health_monitor_prototype_model['type'] = 'http' + load_balancer_pool_health_monitor_prototype_model['url_path'] = '/' + + # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + load_balancer_pool_member_target_prototype_model = {} + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + + # Construct a dict representation of a LoadBalancerPoolMemberPrototype model + load_balancer_pool_member_prototype_model = {} + load_balancer_pool_member_prototype_model['port'] = 80 + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['weight'] = 50 + + # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model + load_balancer_pool_session_persistence_prototype_model = {} + load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name' + load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie' # Set up parameter values - id = 'testString' - endpoint_gateway_patch = endpoint_gateway_patch_model + load_balancer_id = 'testString' + algorithm = 'least_connections' + health_monitor = load_balancer_pool_health_monitor_prototype_model + protocol = 'http' + members = [load_balancer_pool_member_prototype_model] + name = 'my-load-balancer-pool' + proxy_protocol = 'disabled' + session_persistence = load_balancer_pool_session_persistence_prototype_model # Invoke method - response = _service.update_endpoint_gateway( - id, - endpoint_gateway_patch, + response = _service.create_load_balancer_pool( + load_balancer_id, + algorithm, + health_monitor, + protocol, + members=members, + name=name, + proxy_protocol=proxy_protocol, + session_persistence=session_persistence, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == endpoint_gateway_patch + assert req_body['algorithm'] == 'least_connections' + assert req_body['health_monitor'] == load_balancer_pool_health_monitor_prototype_model + assert req_body['protocol'] == 'http' + assert req_body['members'] == [load_balancer_pool_member_prototype_model] + assert req_body['name'] == 'my-load-balancer-pool' + assert req_body['proxy_protocol'] == 'disabled' + assert req_body['session_persistence'] == load_balancer_pool_session_persistence_prototype_model - def test_update_endpoint_gateway_all_params_with_retries(self): - # Enable retries and run test_update_endpoint_gateway_all_params. + def test_create_load_balancer_pool_all_params_with_retries(self): + # Enable retries and run test_create_load_balancer_pool_all_params. _service.enable_retries() - self.test_update_endpoint_gateway_all_params() + self.test_create_load_balancer_pool_all_params() - # Disable retries and run test_update_endpoint_gateway_all_params. + # Disable retries and run test_create_load_balancer_pool_all_params. _service.disable_retries() - self.test_update_endpoint_gateway_all_params() + self.test_create_load_balancer_pool_all_params() @responses.activate - def test_update_endpoint_gateway_value_error(self): + def test_create_load_balancer_pool_value_error(self): """ - test_update_endpoint_gateway_value_error() + test_create_load_balancer_pool_value_error() """ # Set up mock - url = preprocess_url('/endpoint_gateways/testString') - mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools') + mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' responses.add( - responses.PATCH, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Construct a dict representation of a EndpointGatewayPatch model - endpoint_gateway_patch_model = {} - endpoint_gateway_patch_model['allow_dns_resolution_binding'] = True - endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway' + # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model + load_balancer_pool_health_monitor_prototype_model = {} + load_balancer_pool_health_monitor_prototype_model['delay'] = 5 + load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2 + load_balancer_pool_health_monitor_prototype_model['port'] = 22 + load_balancer_pool_health_monitor_prototype_model['timeout'] = 2 + load_balancer_pool_health_monitor_prototype_model['type'] = 'http' + load_balancer_pool_health_monitor_prototype_model['url_path'] = '/' + + # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + load_balancer_pool_member_target_prototype_model = {} + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + + # Construct a dict representation of a LoadBalancerPoolMemberPrototype model + load_balancer_pool_member_prototype_model = {} + load_balancer_pool_member_prototype_model['port'] = 80 + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['weight'] = 50 + + # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model + load_balancer_pool_session_persistence_prototype_model = {} + load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name' + load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie' # Set up parameter values - id = 'testString' - endpoint_gateway_patch = endpoint_gateway_patch_model + load_balancer_id = 'testString' + algorithm = 'least_connections' + health_monitor = load_balancer_pool_health_monitor_prototype_model + protocol = 'http' + members = [load_balancer_pool_member_prototype_model] + name = 'my-load-balancer-pool' + proxy_protocol = 'disabled' + session_persistence = load_balancer_pool_session_persistence_prototype_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "id": id, - "endpoint_gateway_patch": endpoint_gateway_patch, + "load_balancer_id": load_balancer_id, + "algorithm": algorithm, + "health_monitor": health_monitor, + "protocol": protocol, } 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_endpoint_gateway(**req_copy) + _service.create_load_balancer_pool(**req_copy) - def test_update_endpoint_gateway_value_error_with_retries(self): - # Enable retries and run test_update_endpoint_gateway_value_error. + def test_create_load_balancer_pool_value_error_with_retries(self): + # Enable retries and run test_create_load_balancer_pool_value_error. _service.enable_retries() - self.test_update_endpoint_gateway_value_error() + self.test_create_load_balancer_pool_value_error() - # Disable retries and run test_update_endpoint_gateway_value_error. + # Disable retries and run test_create_load_balancer_pool_value_error. _service.disable_retries() - self.test_update_endpoint_gateway_value_error() - - -# endregion -############################################################################## -# End of Service: EndpointGateways -############################################################################## - -############################################################################## -# Start of Service: FlowLogCollectors -############################################################################## -# region + self.test_create_load_balancer_pool_value_error() -class TestNewInstance: +class TestDeleteLoadBalancerPool: """ - Test Class for new_instance + Test Class for delete_load_balancer_pool """ - def test_new_instance(self): + @responses.activate + def test_delete_load_balancer_pool_all_params(self): """ - new_instance() + delete_load_balancer_pool() """ - os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE', + # Set up mock + url = preprocess_url('/load_balancers/testString/pools/testString') + responses.add( + responses.DELETE, + url, + status=202, ) - assert service is not None - assert isinstance(service, VpcV1) - - def test_new_instance_without_authenticator(self): - """ - new_instance_without_authenticator() - """ - with pytest.raises(ValueError, match='authenticator must be provided'): - service = VpcV1.new_instance( - version=version, - service_name='TEST_SERVICE_NOT_FOUND', - ) + # Set up parameter values + load_balancer_id = 'testString' + id = 'testString' - def test_new_instance_without_required_params(self): - """ - new_instance_without_required_params() - """ - with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): - service = VpcV1.new_instance() + # Invoke method + response = _service.delete_load_balancer_pool( + load_balancer_id, + id, + headers={}, + ) - def test_new_instance_required_param_none(self): - """ - new_instance_required_param_none() - """ - with pytest.raises(ValueError, match='version must be provided'): - service = VpcV1.new_instance( - version=None, - ) + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + def test_delete_load_balancer_pool_all_params_with_retries(self): + # Enable retries and run test_delete_load_balancer_pool_all_params. + _service.enable_retries() + self.test_delete_load_balancer_pool_all_params() -class TestListFlowLogCollectors: - """ - Test Class for list_flow_log_collectors - """ + # Disable retries and run test_delete_load_balancer_pool_all_params. + _service.disable_retries() + self.test_delete_load_balancer_pool_all_params() @responses.activate - def test_list_flow_log_collectors_all_params(self): + def test_delete_load_balancer_pool_value_error(self): """ - list_flow_log_collectors() + test_delete_load_balancer_pool_value_error() """ # Set up mock - url = preprocess_url('/flow_log_collectors') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/pools/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=202, ) # Set up parameter values - start = 'testString' - limit = 50 - resource_group_id = 'testString' - name = 'my-name' - vpc_id = 'testString' - vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' - vpc_name = 'my-vpc' - target_id = 'testString' - target_resource_type = 'testString' - - # Invoke method - response = _service.list_flow_log_collectors( - start=start, - limit=limit, - resource_group_id=resource_group_id, - name=name, - vpc_id=vpc_id, - vpc_crn=vpc_crn, - vpc_name=vpc_name, - target_id=target_id, - target_resource_type=target_resource_type, - headers={}, - ) + load_balancer_id = 'testString' + id = 'testString' - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'resource_group.id={}'.format(resource_group_id) in query_string - assert 'name={}'.format(name) in query_string - assert 'vpc.id={}'.format(vpc_id) in query_string - assert 'vpc.crn={}'.format(vpc_crn) in query_string - assert 'vpc.name={}'.format(vpc_name) in query_string - assert 'target.id={}'.format(target_id) in query_string - assert 'target.resource_type={}'.format(target_resource_type) in query_string + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "load_balancer_id": load_balancer_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.delete_load_balancer_pool(**req_copy) - def test_list_flow_log_collectors_all_params_with_retries(self): - # Enable retries and run test_list_flow_log_collectors_all_params. + def test_delete_load_balancer_pool_value_error_with_retries(self): + # Enable retries and run test_delete_load_balancer_pool_value_error. _service.enable_retries() - self.test_list_flow_log_collectors_all_params() + self.test_delete_load_balancer_pool_value_error() - # Disable retries and run test_list_flow_log_collectors_all_params. + # Disable retries and run test_delete_load_balancer_pool_value_error. _service.disable_retries() - self.test_list_flow_log_collectors_all_params() + self.test_delete_load_balancer_pool_value_error() + + +class TestGetLoadBalancerPool: + """ + Test Class for get_load_balancer_pool + """ @responses.activate - def test_list_flow_log_collectors_required_params(self): + def test_get_load_balancer_pool_all_params(self): """ - test_list_flow_log_collectors_required_params() + get_load_balancer_pool() """ # Set up mock - url = preprocess_url('/flow_log_collectors') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/pools/testString') + mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' responses.add( responses.GET, url, @@ -47261,30 +48992,38 @@ def test_list_flow_log_collectors_required_params(self): status=200, ) + # Set up parameter values + load_balancer_id = 'testString' + id = 'testString' + # Invoke method - response = _service.list_flow_log_collectors() + response = _service.get_load_balancer_pool( + load_balancer_id, + id, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_flow_log_collectors_required_params_with_retries(self): - # Enable retries and run test_list_flow_log_collectors_required_params. + def test_get_load_balancer_pool_all_params_with_retries(self): + # Enable retries and run test_get_load_balancer_pool_all_params. _service.enable_retries() - self.test_list_flow_log_collectors_required_params() + self.test_get_load_balancer_pool_all_params() - # Disable retries and run test_list_flow_log_collectors_required_params. + # Disable retries and run test_get_load_balancer_pool_all_params. _service.disable_retries() - self.test_list_flow_log_collectors_required_params() + self.test_get_load_balancer_pool_all_params() @responses.activate - def test_list_flow_log_collectors_value_error(self): + def test_get_load_balancer_pool_value_error(self): """ - test_list_flow_log_collectors_value_error() + test_get_load_balancer_pool_value_error() """ # Set up mock - url = preprocess_url('/flow_log_collectors') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + url = preprocess_url('/load_balancers/testString/pools/testString') + mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' responses.add( responses.GET, url, @@ -47293,320 +49032,570 @@ def test_list_flow_log_collectors_value_error(self): status=200, ) + # Set up parameter values + load_balancer_id = 'testString' + id = 'testString' + # Pass in all but one required param and check for a ValueError req_param_dict = { + "load_balancer_id": load_balancer_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.list_flow_log_collectors(**req_copy) + _service.get_load_balancer_pool(**req_copy) - def test_list_flow_log_collectors_value_error_with_retries(self): - # Enable retries and run test_list_flow_log_collectors_value_error. + def test_get_load_balancer_pool_value_error_with_retries(self): + # Enable retries and run test_get_load_balancer_pool_value_error. _service.enable_retries() - self.test_list_flow_log_collectors_value_error() + self.test_get_load_balancer_pool_value_error() - # Disable retries and run test_list_flow_log_collectors_value_error. + # Disable retries and run test_get_load_balancer_pool_value_error. _service.disable_retries() - self.test_list_flow_log_collectors_value_error() - - @responses.activate - def test_list_flow_log_collectors_with_pager_get_next(self): - """ - test_list_flow_log_collectors_with_pager_get_next() - """ - # Set up a two-page mock response - url = preprocess_url('/flow_log_collectors') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - all_results = [] - pager = FlowLogCollectorsPager( - client=_service, - limit=10, - resource_group_id='testString', - name='my-name', - vpc_id='testString', - vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', - vpc_name='my-vpc', - target_id='testString', - target_resource_type='testString', - ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 - - @responses.activate - def test_list_flow_log_collectors_with_pager_get_all(self): - """ - test_list_flow_log_collectors_with_pager_get_all() - """ - # Set up a two-page mock response - url = preprocess_url('/flow_log_collectors') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e","id":"0717-10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - pager = FlowLogCollectorsPager( - client=_service, - limit=10, - resource_group_id='testString', - name='my-name', - vpc_id='testString', - vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', - vpc_name='my-vpc', - target_id='testString', - target_resource_type='testString', - ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + self.test_get_load_balancer_pool_value_error() -class TestCreateFlowLogCollector: +class TestUpdateLoadBalancerPool: """ - Test Class for create_flow_log_collector + Test Class for update_load_balancer_pool """ @responses.activate - def test_create_flow_log_collector_all_params(self): + def test_update_load_balancer_pool_all_params(self): """ - create_flow_log_collector() + update_load_balancer_pool() """ # Set up mock - url = preprocess_url('/flow_log_collectors') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools/testString') + mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' responses.add( - responses.POST, + responses.PATCH, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model - legacy_cloud_object_storage_bucket_identity_model = {} - legacy_cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue' + # Construct a dict representation of a LoadBalancerPoolHealthMonitorPatch model + load_balancer_pool_health_monitor_patch_model = {} + load_balancer_pool_health_monitor_patch_model['delay'] = 5 + load_balancer_pool_health_monitor_patch_model['max_retries'] = 2 + load_balancer_pool_health_monitor_patch_model['port'] = 22 + load_balancer_pool_health_monitor_patch_model['timeout'] = 2 + load_balancer_pool_health_monitor_patch_model['type'] = 'http' + load_balancer_pool_health_monitor_patch_model['url_path'] = '/' - # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model - flow_log_collector_target_prototype_model = {} - flow_log_collector_target_prototype_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + # Construct a dict representation of a LoadBalancerPoolSessionPersistencePatch model + load_balancer_pool_session_persistence_patch_model = {} + load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name' + load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie' - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a LoadBalancerPoolPatch model + load_balancer_pool_patch_model = {} + load_balancer_pool_patch_model['algorithm'] = 'least_connections' + load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model + load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool' + load_balancer_pool_patch_model['protocol'] = 'http' + load_balancer_pool_patch_model['proxy_protocol'] = 'disabled' + load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model # Set up parameter values - storage_bucket = legacy_cloud_object_storage_bucket_identity_model - target = flow_log_collector_target_prototype_model - active = False - name = 'my-flow-log-collector' - resource_group = resource_group_identity_model + load_balancer_id = 'testString' + id = 'testString' + load_balancer_pool_patch = load_balancer_pool_patch_model # Invoke method - response = _service.create_flow_log_collector( - storage_bucket, - target, - active=active, - name=name, - resource_group=resource_group, + response = _service.update_load_balancer_pool( + load_balancer_id, + id, + load_balancer_pool_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 201 + assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['storage_bucket'] == legacy_cloud_object_storage_bucket_identity_model - assert req_body['target'] == flow_log_collector_target_prototype_model - assert req_body['active'] == False - assert req_body['name'] == 'my-flow-log-collector' - assert req_body['resource_group'] == resource_group_identity_model + assert req_body == load_balancer_pool_patch - def test_create_flow_log_collector_all_params_with_retries(self): - # Enable retries and run test_create_flow_log_collector_all_params. + def test_update_load_balancer_pool_all_params_with_retries(self): + # Enable retries and run test_update_load_balancer_pool_all_params. _service.enable_retries() - self.test_create_flow_log_collector_all_params() + self.test_update_load_balancer_pool_all_params() - # Disable retries and run test_create_flow_log_collector_all_params. + # Disable retries and run test_update_load_balancer_pool_all_params. _service.disable_retries() - self.test_create_flow_log_collector_all_params() + self.test_update_load_balancer_pool_all_params() @responses.activate - def test_create_flow_log_collector_value_error(self): + def test_update_load_balancer_pool_value_error(self): """ - test_create_flow_log_collector_value_error() + test_update_load_balancer_pool_value_error() """ # Set up mock - url = preprocess_url('/flow_log_collectors') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools/testString') + mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}' responses.add( - responses.POST, + responses.PATCH, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) - # Construct a dict representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model - legacy_cloud_object_storage_bucket_identity_model = {} - legacy_cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue' + # Construct a dict representation of a LoadBalancerPoolHealthMonitorPatch model + load_balancer_pool_health_monitor_patch_model = {} + load_balancer_pool_health_monitor_patch_model['delay'] = 5 + load_balancer_pool_health_monitor_patch_model['max_retries'] = 2 + load_balancer_pool_health_monitor_patch_model['port'] = 22 + load_balancer_pool_health_monitor_patch_model['timeout'] = 2 + load_balancer_pool_health_monitor_patch_model['type'] = 'http' + load_balancer_pool_health_monitor_patch_model['url_path'] = '/' - # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model - flow_log_collector_target_prototype_model = {} - flow_log_collector_target_prototype_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + # Construct a dict representation of a LoadBalancerPoolSessionPersistencePatch model + load_balancer_pool_session_persistence_patch_model = {} + load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name' + load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie' - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a LoadBalancerPoolPatch model + load_balancer_pool_patch_model = {} + load_balancer_pool_patch_model['algorithm'] = 'least_connections' + load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model + load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool' + load_balancer_pool_patch_model['protocol'] = 'http' + load_balancer_pool_patch_model['proxy_protocol'] = 'disabled' + load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model # Set up parameter values - storage_bucket = legacy_cloud_object_storage_bucket_identity_model - target = flow_log_collector_target_prototype_model - active = False - name = 'my-flow-log-collector' - resource_group = resource_group_identity_model + load_balancer_id = 'testString' + id = 'testString' + load_balancer_pool_patch = load_balancer_pool_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "storage_bucket": storage_bucket, - "target": target, + "load_balancer_id": load_balancer_id, + "id": id, + "load_balancer_pool_patch": load_balancer_pool_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.create_flow_log_collector(**req_copy) + _service.update_load_balancer_pool(**req_copy) - def test_create_flow_log_collector_value_error_with_retries(self): - # Enable retries and run test_create_flow_log_collector_value_error. + def test_update_load_balancer_pool_value_error_with_retries(self): + # Enable retries and run test_update_load_balancer_pool_value_error. _service.enable_retries() - self.test_create_flow_log_collector_value_error() + self.test_update_load_balancer_pool_value_error() - # Disable retries and run test_create_flow_log_collector_value_error. + # Disable retries and run test_update_load_balancer_pool_value_error. _service.disable_retries() - self.test_create_flow_log_collector_value_error() + self.test_update_load_balancer_pool_value_error() -class TestDeleteFlowLogCollector: +class TestListLoadBalancerPoolMembers: """ - Test Class for delete_flow_log_collector + Test Class for list_load_balancer_pool_members """ @responses.activate - def test_delete_flow_log_collector_all_params(self): + def test_list_load_balancer_pool_members_all_params(self): """ - delete_flow_log_collector() + list_load_balancer_pool_members() """ # Set up mock - url = preprocess_url('/flow_log_collectors/testString') + url = preprocess_url('/load_balancers/testString/pools/testString/members') + mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}]}' responses.add( - responses.DELETE, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - id = 'testString' + load_balancer_id = 'testString' + pool_id = 'testString' # Invoke method - response = _service.delete_flow_log_collector( - id, + response = _service.list_load_balancer_pool_members( + load_balancer_id, + pool_id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 200 - def test_delete_flow_log_collector_all_params_with_retries(self): - # Enable retries and run test_delete_flow_log_collector_all_params. + def test_list_load_balancer_pool_members_all_params_with_retries(self): + # Enable retries and run test_list_load_balancer_pool_members_all_params. _service.enable_retries() - self.test_delete_flow_log_collector_all_params() + self.test_list_load_balancer_pool_members_all_params() - # Disable retries and run test_delete_flow_log_collector_all_params. + # Disable retries and run test_list_load_balancer_pool_members_all_params. _service.disable_retries() - self.test_delete_flow_log_collector_all_params() + self.test_list_load_balancer_pool_members_all_params() @responses.activate - def test_delete_flow_log_collector_value_error(self): + def test_list_load_balancer_pool_members_value_error(self): """ - test_delete_flow_log_collector_value_error() + test_list_load_balancer_pool_members_value_error() """ # Set up mock - url = preprocess_url('/flow_log_collectors/testString') + url = preprocess_url('/load_balancers/testString/pools/testString/members') + mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "load_balancer_id": load_balancer_id, + "pool_id": pool_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.list_load_balancer_pool_members(**req_copy) + + def test_list_load_balancer_pool_members_value_error_with_retries(self): + # Enable retries and run test_list_load_balancer_pool_members_value_error. + _service.enable_retries() + self.test_list_load_balancer_pool_members_value_error() + + # Disable retries and run test_list_load_balancer_pool_members_value_error. + _service.disable_retries() + self.test_list_load_balancer_pool_members_value_error() + + +class TestCreateLoadBalancerPoolMember: + """ + Test Class for create_load_balancer_pool_member + """ + + @responses.activate + def test_create_load_balancer_pool_member_all_params(self): + """ + create_load_balancer_pool_member() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString/pools/testString/members') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + load_balancer_pool_member_target_prototype_model = {} + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + + # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' + port = 80 + target = load_balancer_pool_member_target_prototype_model + weight = 50 + + # Invoke method + response = _service.create_load_balancer_pool_member( + load_balancer_id, + pool_id, + port, + target, + weight=weight, + 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['port'] == 80 + assert req_body['target'] == load_balancer_pool_member_target_prototype_model + assert req_body['weight'] == 50 + + def test_create_load_balancer_pool_member_all_params_with_retries(self): + # Enable retries and run test_create_load_balancer_pool_member_all_params. + _service.enable_retries() + self.test_create_load_balancer_pool_member_all_params() + + # Disable retries and run test_create_load_balancer_pool_member_all_params. + _service.disable_retries() + self.test_create_load_balancer_pool_member_all_params() + + @responses.activate + def test_create_load_balancer_pool_member_value_error(self): + """ + test_create_load_balancer_pool_member_value_error() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString/pools/testString/members') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + load_balancer_pool_member_target_prototype_model = {} + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + + # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' + port = 80 + target = load_balancer_pool_member_target_prototype_model + weight = 50 + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "load_balancer_id": load_balancer_id, + "pool_id": pool_id, + "port": port, + "target": target, + } + 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_load_balancer_pool_member(**req_copy) + + def test_create_load_balancer_pool_member_value_error_with_retries(self): + # Enable retries and run test_create_load_balancer_pool_member_value_error. + _service.enable_retries() + self.test_create_load_balancer_pool_member_value_error() + + # Disable retries and run test_create_load_balancer_pool_member_value_error. + _service.disable_retries() + self.test_create_load_balancer_pool_member_value_error() + + +class TestReplaceLoadBalancerPoolMembers: + """ + Test Class for replace_load_balancer_pool_members + """ + + @responses.activate + def test_replace_load_balancer_pool_members_all_params(self): + """ + replace_load_balancer_pool_members() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString/pools/testString/members') + mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}]}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + load_balancer_pool_member_target_prototype_model = {} + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + + # Construct a dict representation of a LoadBalancerPoolMemberPrototype model + load_balancer_pool_member_prototype_model = {} + load_balancer_pool_member_prototype_model['port'] = 80 + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['weight'] = 50 + + # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' + members = [load_balancer_pool_member_prototype_model] + + # Invoke method + response = _service.replace_load_balancer_pool_members( + load_balancer_id, + pool_id, + members, + 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['members'] == [load_balancer_pool_member_prototype_model] + + def test_replace_load_balancer_pool_members_all_params_with_retries(self): + # Enable retries and run test_replace_load_balancer_pool_members_all_params. + _service.enable_retries() + self.test_replace_load_balancer_pool_members_all_params() + + # Disable retries and run test_replace_load_balancer_pool_members_all_params. + _service.disable_retries() + self.test_replace_load_balancer_pool_members_all_params() + + @responses.activate + def test_replace_load_balancer_pool_members_value_error(self): + """ + test_replace_load_balancer_pool_members_value_error() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString/pools/testString/members') + mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}]}' + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + load_balancer_pool_member_target_prototype_model = {} + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + + # Construct a dict representation of a LoadBalancerPoolMemberPrototype model + load_balancer_pool_member_prototype_model = {} + load_balancer_pool_member_prototype_model['port'] = 80 + load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_prototype_model['weight'] = 50 + + # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' + members = [load_balancer_pool_member_prototype_model] + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "load_balancer_id": load_balancer_id, + "pool_id": pool_id, + "members": members, + } + 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.replace_load_balancer_pool_members(**req_copy) + + def test_replace_load_balancer_pool_members_value_error_with_retries(self): + # Enable retries and run test_replace_load_balancer_pool_members_value_error. + _service.enable_retries() + self.test_replace_load_balancer_pool_members_value_error() + + # Disable retries and run test_replace_load_balancer_pool_members_value_error. + _service.disable_retries() + self.test_replace_load_balancer_pool_members_value_error() + + +class TestDeleteLoadBalancerPoolMember: + """ + Test Class for delete_load_balancer_pool_member + """ + + @responses.activate + def test_delete_load_balancer_pool_member_all_params(self): + """ + delete_load_balancer_pool_member() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') responses.add( responses.DELETE, url, - status=204, + status=202, + ) + + # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.delete_load_balancer_pool_member( + load_balancer_id, + pool_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_load_balancer_pool_member_all_params_with_retries(self): + # Enable retries and run test_delete_load_balancer_pool_member_all_params. + _service.enable_retries() + self.test_delete_load_balancer_pool_member_all_params() + + # Disable retries and run test_delete_load_balancer_pool_member_all_params. + _service.disable_retries() + self.test_delete_load_balancer_pool_member_all_params() + + @responses.activate + def test_delete_load_balancer_pool_member_value_error(self): + """ + test_delete_load_balancer_pool_member_value_error() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') + responses.add( + responses.DELETE, + url, + status=202, ) # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "load_balancer_id": load_balancer_id, + "pool_id": pool_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.delete_flow_log_collector(**req_copy) + _service.delete_load_balancer_pool_member(**req_copy) - def test_delete_flow_log_collector_value_error_with_retries(self): - # Enable retries and run test_delete_flow_log_collector_value_error. + def test_delete_load_balancer_pool_member_value_error_with_retries(self): + # Enable retries and run test_delete_load_balancer_pool_member_value_error. _service.enable_retries() - self.test_delete_flow_log_collector_value_error() + self.test_delete_load_balancer_pool_member_value_error() - # Disable retries and run test_delete_flow_log_collector_value_error. + # Disable retries and run test_delete_load_balancer_pool_member_value_error. _service.disable_retries() - self.test_delete_flow_log_collector_value_error() + self.test_delete_load_balancer_pool_member_value_error() -class TestGetFlowLogCollector: +class TestGetLoadBalancerPoolMember: """ - Test Class for get_flow_log_collector + Test Class for get_load_balancer_pool_member """ @responses.activate - def test_get_flow_log_collector_all_params(self): + def test_get_load_balancer_pool_member_all_params(self): """ - get_flow_log_collector() + get_load_balancer_pool_member() """ # Set up mock - url = preprocess_url('/flow_log_collectors/testString') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}' responses.add( responses.GET, url, @@ -47616,10 +49605,14 @@ def test_get_flow_log_collector_all_params(self): ) # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' id = 'testString' # Invoke method - response = _service.get_flow_log_collector( + response = _service.get_load_balancer_pool_member( + load_balancer_id, + pool_id, id, headers={}, ) @@ -47628,23 +49621,23 @@ def test_get_flow_log_collector_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_flow_log_collector_all_params_with_retries(self): - # Enable retries and run test_get_flow_log_collector_all_params. + def test_get_load_balancer_pool_member_all_params_with_retries(self): + # Enable retries and run test_get_load_balancer_pool_member_all_params. _service.enable_retries() - self.test_get_flow_log_collector_all_params() + self.test_get_load_balancer_pool_member_all_params() - # Disable retries and run test_get_flow_log_collector_all_params. + # Disable retries and run test_get_load_balancer_pool_member_all_params. _service.disable_retries() - self.test_get_flow_log_collector_all_params() + self.test_get_load_balancer_pool_member_all_params() @responses.activate - def test_get_flow_log_collector_value_error(self): + def test_get_load_balancer_pool_member_value_error(self): """ - test_get_flow_log_collector_value_error() + test_get_load_balancer_pool_member_value_error() """ # Set up mock - url = preprocess_url('/flow_log_collectors/testString') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}' responses.add( responses.GET, url, @@ -47654,40 +49647,44 @@ def test_get_flow_log_collector_value_error(self): ) # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "load_balancer_id": load_balancer_id, + "pool_id": pool_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_flow_log_collector(**req_copy) + _service.get_load_balancer_pool_member(**req_copy) - def test_get_flow_log_collector_value_error_with_retries(self): - # Enable retries and run test_get_flow_log_collector_value_error. + def test_get_load_balancer_pool_member_value_error_with_retries(self): + # Enable retries and run test_get_load_balancer_pool_member_value_error. _service.enable_retries() - self.test_get_flow_log_collector_value_error() + self.test_get_load_balancer_pool_member_value_error() - # Disable retries and run test_get_flow_log_collector_value_error. + # Disable retries and run test_get_load_balancer_pool_member_value_error. _service.disable_retries() - self.test_get_flow_log_collector_value_error() + self.test_get_load_balancer_pool_member_value_error() -class TestUpdateFlowLogCollector: +class TestUpdateLoadBalancerPoolMember: """ - Test Class for update_flow_log_collector + Test Class for update_load_balancer_pool_member """ @responses.activate - def test_update_flow_log_collector_all_params(self): + def test_update_load_balancer_pool_member_all_params(self): """ - update_flow_log_collector() + update_load_balancer_pool_member() """ # Set up mock - url = preprocess_url('/flow_log_collectors/testString') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}' responses.add( responses.PATCH, url, @@ -47696,19 +49693,28 @@ def test_update_flow_log_collector_all_params(self): status=200, ) - # Construct a dict representation of a FlowLogCollectorPatch model - flow_log_collector_patch_model = {} - flow_log_collector_patch_model['active'] = True - flow_log_collector_patch_model['name'] = 'my-flow-log-collector' + # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + load_balancer_pool_member_target_prototype_model = {} + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + + # Construct a dict representation of a LoadBalancerPoolMemberPatch model + load_balancer_pool_member_patch_model = {} + load_balancer_pool_member_patch_model['port'] = 80 + load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_patch_model['weight'] = 50 # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' id = 'testString' - flow_log_collector_patch = flow_log_collector_patch_model + load_balancer_pool_member_patch = load_balancer_pool_member_patch_model # Invoke method - response = _service.update_flow_log_collector( + response = _service.update_load_balancer_pool_member( + load_balancer_id, + pool_id, id, - flow_log_collector_patch, + load_balancer_pool_member_patch, headers={}, ) @@ -47717,25 +49723,25 @@ def test_update_flow_log_collector_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == flow_log_collector_patch + assert req_body == load_balancer_pool_member_patch - def test_update_flow_log_collector_all_params_with_retries(self): - # Enable retries and run test_update_flow_log_collector_all_params. + def test_update_load_balancer_pool_member_all_params_with_retries(self): + # Enable retries and run test_update_load_balancer_pool_member_all_params. _service.enable_retries() - self.test_update_flow_log_collector_all_params() + self.test_update_load_balancer_pool_member_all_params() - # Disable retries and run test_update_flow_log_collector_all_params. + # Disable retries and run test_update_load_balancer_pool_member_all_params. _service.disable_retries() - self.test_update_flow_log_collector_all_params() + self.test_update_load_balancer_pool_member_all_params() @responses.activate - def test_update_flow_log_collector_value_error(self): + def test_update_load_balancer_pool_member_value_error(self): """ - test_update_flow_log_collector_value_error() + test_update_load_balancer_pool_member_value_error() """ # Set up mock - url = preprocess_url('/flow_log_collectors/testString') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "0717-10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "id": "0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0", "name": "my-instance"}, "weight": 50}' responses.add( responses.PATCH, url, @@ -47744,42 +49750,51 @@ def test_update_flow_log_collector_value_error(self): status=200, ) - # Construct a dict representation of a FlowLogCollectorPatch model - flow_log_collector_patch_model = {} - flow_log_collector_patch_model['active'] = True - flow_log_collector_patch_model['name'] = 'my-flow-log-collector' + # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + load_balancer_pool_member_target_prototype_model = {} + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + + # Construct a dict representation of a LoadBalancerPoolMemberPatch model + load_balancer_pool_member_patch_model = {} + load_balancer_pool_member_patch_model['port'] = 80 + load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model + load_balancer_pool_member_patch_model['weight'] = 50 # Set up parameter values + load_balancer_id = 'testString' + pool_id = 'testString' id = 'testString' - flow_log_collector_patch = flow_log_collector_patch_model + load_balancer_pool_member_patch = load_balancer_pool_member_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { + "load_balancer_id": load_balancer_id, + "pool_id": pool_id, "id": id, - "flow_log_collector_patch": flow_log_collector_patch, + "load_balancer_pool_member_patch": load_balancer_pool_member_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_flow_log_collector(**req_copy) + _service.update_load_balancer_pool_member(**req_copy) - def test_update_flow_log_collector_value_error_with_retries(self): - # Enable retries and run test_update_flow_log_collector_value_error. + def test_update_load_balancer_pool_member_value_error_with_retries(self): + # Enable retries and run test_update_load_balancer_pool_member_value_error. _service.enable_retries() - self.test_update_flow_log_collector_value_error() + self.test_update_load_balancer_pool_member_value_error() - # Disable retries and run test_update_flow_log_collector_value_error. + # Disable retries and run test_update_load_balancer_pool_member_value_error. _service.disable_retries() - self.test_update_flow_log_collector_value_error() + self.test_update_load_balancer_pool_member_value_error() # endregion ############################################################################## -# End of Service: FlowLogCollectors +# End of Service: LoadBalancers ############################################################################## ############################################################################## -# Start of Service: PrivatePathServiceGateways +# Start of Service: EndpointGateways ############################################################################## # region @@ -47813,12 +49828,12 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) - # def test_new_instance_without_required_params(self): - # """ - # new_instance_without_required_params() - # """ - # with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): - # service = VpcV1.new_instance() + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() def test_new_instance_required_param_none(self): """ @@ -47830,19 +49845,19 @@ def test_new_instance_required_param_none(self): ) -class TestListPrivatePathServiceGateways: +class TestListEndpointGateways: """ - Test Class for list_private_path_service_gateways + Test Class for list_endpoint_gateways """ @responses.activate - def test_list_private_path_service_gateways_all_params(self): + def test_list_endpoint_gateways_all_params(self): """ - list_private_path_service_gateways() + list_endpoint_gateways() """ # Set up mock - url = preprocess_url('/private_path_service_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "private_path_service_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}], "total_count": 132}' + url = preprocess_url('/endpoint_gateways') + mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -47852,15 +49867,27 @@ def test_list_private_path_service_gateways_all_params(self): ) # Set up parameter values + name = 'my-name' start = 'testString' limit = 50 resource_group_id = 'testString' + lifecycle_state = ['stable'] + vpc_id = 'testString' + vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_name = 'my-vpc' + allow_dns_resolution_binding = True # Invoke method - response = _service.list_private_path_service_gateways( + response = _service.list_endpoint_gateways( + name=name, start=start, limit=limit, resource_group_id=resource_group_id, + lifecycle_state=lifecycle_state, + vpc_id=vpc_id, + vpc_crn=vpc_crn, + vpc_name=vpc_name, + allow_dns_resolution_binding=allow_dns_resolution_binding, headers={}, ) @@ -47870,27 +49897,33 @@ def test_list_private_path_service_gateways_all_params(self): # Validate query params query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) + assert 'name={}'.format(name) in query_string assert 'start={}'.format(start) in query_string assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'lifecycle_state={}'.format(','.join(lifecycle_state)) in query_string + assert 'vpc.id={}'.format(vpc_id) in query_string + assert 'vpc.crn={}'.format(vpc_crn) in query_string + assert 'vpc.name={}'.format(vpc_name) in query_string + assert 'allow_dns_resolution_binding={}'.format('true' if allow_dns_resolution_binding else 'false') in query_string - def test_list_private_path_service_gateways_all_params_with_retries(self): - # Enable retries and run test_list_private_path_service_gateways_all_params. + def test_list_endpoint_gateways_all_params_with_retries(self): + # Enable retries and run test_list_endpoint_gateways_all_params. _service.enable_retries() - self.test_list_private_path_service_gateways_all_params() + self.test_list_endpoint_gateways_all_params() - # Disable retries and run test_list_private_path_service_gateways_all_params. + # Disable retries and run test_list_endpoint_gateways_all_params. _service.disable_retries() - self.test_list_private_path_service_gateways_all_params() + self.test_list_endpoint_gateways_all_params() @responses.activate - def test_list_private_path_service_gateways_required_params(self): + def test_list_endpoint_gateways_required_params(self): """ - test_list_private_path_service_gateways_required_params() + test_list_endpoint_gateways_required_params() """ # Set up mock - url = preprocess_url('/private_path_service_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "private_path_service_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}], "total_count": 132}' + url = preprocess_url('/endpoint_gateways') + mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -47900,29 +49933,29 @@ def test_list_private_path_service_gateways_required_params(self): ) # Invoke method - response = _service.list_private_path_service_gateways() + response = _service.list_endpoint_gateways() # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_private_path_service_gateways_required_params_with_retries(self): - # Enable retries and run test_list_private_path_service_gateways_required_params. + def test_list_endpoint_gateways_required_params_with_retries(self): + # Enable retries and run test_list_endpoint_gateways_required_params. _service.enable_retries() - self.test_list_private_path_service_gateways_required_params() + self.test_list_endpoint_gateways_required_params() - # Disable retries and run test_list_private_path_service_gateways_required_params. + # Disable retries and run test_list_endpoint_gateways_required_params. _service.disable_retries() - self.test_list_private_path_service_gateways_required_params() + self.test_list_endpoint_gateways_required_params() @responses.activate - def test_list_private_path_service_gateways_value_error(self): + def test_list_endpoint_gateways_value_error(self): """ - test_list_private_path_service_gateways_value_error() + test_list_endpoint_gateways_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "private_path_service_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}], "total_count": 132}' + url = preprocess_url('/endpoint_gateways') + mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -47937,26 +49970,26 @@ def test_list_private_path_service_gateways_value_error(self): for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_private_path_service_gateways(**req_copy) + _service.list_endpoint_gateways(**req_copy) - def test_list_private_path_service_gateways_value_error_with_retries(self): - # Enable retries and run test_list_private_path_service_gateways_value_error. + def test_list_endpoint_gateways_value_error_with_retries(self): + # Enable retries and run test_list_endpoint_gateways_value_error. _service.enable_retries() - self.test_list_private_path_service_gateways_value_error() + self.test_list_endpoint_gateways_value_error() - # Disable retries and run test_list_private_path_service_gateways_value_error. + # Disable retries and run test_list_endpoint_gateways_value_error. _service.disable_retries() - self.test_list_private_path_service_gateways_value_error() + self.test_list_endpoint_gateways_value_error() @responses.activate - def test_list_private_path_service_gateways_with_pager_get_next(self): + def test_list_endpoint_gateways_with_pager_get_next(self): """ - test_list_private_path_service_gateways_with_pager_get_next() + test_list_endpoint_gateways_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/private_path_service_gateways') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":true}],"total_count":2,"limit":1}' - mock_response2 = '{"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":true}],"total_count":2,"limit":1}' + url = preprocess_url('/endpoint_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -47974,10 +50007,16 @@ def test_list_private_path_service_gateways_with_pager_get_next(self): # Exercise the pager class for this operation all_results = [] - pager = PrivatePathServiceGatewaysPager( + pager = EndpointGatewaysPager( client=_service, + name='my-name', limit=10, resource_group_id='testString', + lifecycle_state=['stable'], + vpc_id='testString', + vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', + vpc_name='my-vpc', + allow_dns_resolution_binding=True, ) while pager.has_next(): next_page = pager.get_next() @@ -47986,14 +50025,14 @@ def test_list_private_path_service_gateways_with_pager_get_next(self): assert len(all_results) == 2 @responses.activate - def test_list_private_path_service_gateways_with_pager_get_all(self): + def test_list_endpoint_gateways_with_pager_get_all(self): """ - test_list_private_path_service_gateways_with_pager_get_all() + test_list_endpoint_gateways_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/private_path_service_gateways') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":true}],"total_count":2,"limit":1}' - mock_response2 = '{"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":true}],"total_count":2,"limit":1}' + url = preprocess_url('/endpoint_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","name":"my-private-path-service-gateway","remote":{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"private_path_service_gateway"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -48010,29 +50049,35 @@ def test_list_private_path_service_gateways_with_pager_get_all(self): ) # Exercise the pager class for this operation - pager = PrivatePathServiceGatewaysPager( + pager = EndpointGatewaysPager( client=_service, + name='my-name', limit=10, resource_group_id='testString', + lifecycle_state=['stable'], + vpc_id='testString', + vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', + vpc_name='my-vpc', + allow_dns_resolution_binding=True, ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestCreatePrivatePathServiceGateway: +class TestCreateEndpointGateway: """ - Test Class for create_private_path_service_gateway + Test Class for create_endpoint_gateway """ @responses.activate - def test_create_private_path_service_gateway_all_params(self): + def test_create_endpoint_gateway_all_params(self): """ - create_private_path_service_gateway() + create_endpoint_gateway() """ # Set up mock - url = preprocess_url('/private_path_service_gateways') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + url = preprocess_url('/endpoint_gateways') + mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -48041,30 +50086,45 @@ def test_create_private_path_service_gateway_all_params(self): status=201, ) - # Construct a dict representation of a LoadBalancerIdentityById model - load_balancer_identity_model = {} - load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + # Construct a dict representation of a EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model + endpoint_gateway_target_prototype_model = {} + endpoint_gateway_target_prototype_model['name'] = 'ibm-ntp-server' + endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service' + + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf' + + # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityById model + endpoint_gateway_reserved_ip_model = {} + endpoint_gateway_reserved_ip_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a SecurityGroupIdentityById model + security_group_identity_model = {} + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + # Set up parameter values - load_balancer = load_balancer_identity_model - service_endpoints = ['*.example.com'] - default_access_policy = 'deny' - name = 'my-private-path-service-gateway' + target = endpoint_gateway_target_prototype_model + vpc = vpc_identity_model + allow_dns_resolution_binding = True + ips = [endpoint_gateway_reserved_ip_model] + name = 'testString' resource_group = resource_group_identity_model - zonal_affinity = False + security_groups = [security_group_identity_model] # Invoke method - response = _service.create_private_path_service_gateway( - load_balancer, - service_endpoints, - default_access_policy=default_access_policy, + response = _service.create_endpoint_gateway( + target, + vpc, + allow_dns_resolution_binding=allow_dns_resolution_binding, + ips=ips, name=name, resource_group=resource_group, - zonal_affinity=zonal_affinity, + security_groups=security_groups, headers={}, ) @@ -48073,30 +50133,31 @@ def test_create_private_path_service_gateway_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['load_balancer'] == load_balancer_identity_model - assert req_body['service_endpoints'] == ['*.example.com'] - assert req_body['default_access_policy'] == 'deny' - assert req_body['name'] == 'my-private-path-service-gateway' + assert req_body['target'] == endpoint_gateway_target_prototype_model + assert req_body['vpc'] == vpc_identity_model + assert req_body['allow_dns_resolution_binding'] == True + assert req_body['ips'] == [endpoint_gateway_reserved_ip_model] + assert req_body['name'] == 'testString' assert req_body['resource_group'] == resource_group_identity_model - assert req_body['zonal_affinity'] == False + assert req_body['security_groups'] == [security_group_identity_model] - def test_create_private_path_service_gateway_all_params_with_retries(self): - # Enable retries and run test_create_private_path_service_gateway_all_params. + def test_create_endpoint_gateway_all_params_with_retries(self): + # Enable retries and run test_create_endpoint_gateway_all_params. _service.enable_retries() - self.test_create_private_path_service_gateway_all_params() + self.test_create_endpoint_gateway_all_params() - # Disable retries and run test_create_private_path_service_gateway_all_params. + # Disable retries and run test_create_endpoint_gateway_all_params. _service.disable_retries() - self.test_create_private_path_service_gateway_all_params() + self.test_create_endpoint_gateway_all_params() @responses.activate - def test_create_private_path_service_gateway_value_error(self): + def test_create_endpoint_gateway_value_error(self): """ - test_create_private_path_service_gateway_value_error() + test_create_endpoint_gateway_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + url = preprocess_url('/endpoint_gateways') + mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -48105,625 +50166,521 @@ def test_create_private_path_service_gateway_value_error(self): status=201, ) - # Construct a dict representation of a LoadBalancerIdentityById model - load_balancer_identity_model = {} - load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + # Construct a dict representation of a EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model + endpoint_gateway_target_prototype_model = {} + endpoint_gateway_target_prototype_model['name'] = 'ibm-ntp-server' + endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service' + + # Construct a dict representation of a VPCIdentityById model + vpc_identity_model = {} + vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf' + + # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityById model + endpoint_gateway_reserved_ip_model = {} + endpoint_gateway_reserved_ip_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a SecurityGroupIdentityById model + security_group_identity_model = {} + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + # Set up parameter values - load_balancer = load_balancer_identity_model - service_endpoints = ['*.example.com'] - default_access_policy = 'deny' - name = 'my-private-path-service-gateway' + target = endpoint_gateway_target_prototype_model + vpc = vpc_identity_model + allow_dns_resolution_binding = True + ips = [endpoint_gateway_reserved_ip_model] + name = 'testString' resource_group = resource_group_identity_model - zonal_affinity = False + security_groups = [security_group_identity_model] # Pass in all but one required param and check for a ValueError req_param_dict = { - "load_balancer": load_balancer, - "service_endpoints": service_endpoints, + "target": target, + "vpc": vpc, } 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_private_path_service_gateway(**req_copy) + _service.create_endpoint_gateway(**req_copy) - def test_create_private_path_service_gateway_value_error_with_retries(self): - # Enable retries and run test_create_private_path_service_gateway_value_error. + def test_create_endpoint_gateway_value_error_with_retries(self): + # Enable retries and run test_create_endpoint_gateway_value_error. _service.enable_retries() - self.test_create_private_path_service_gateway_value_error() + self.test_create_endpoint_gateway_value_error() - # Disable retries and run test_create_private_path_service_gateway_value_error. + # Disable retries and run test_create_endpoint_gateway_value_error. _service.disable_retries() - self.test_create_private_path_service_gateway_value_error() + self.test_create_endpoint_gateway_value_error() -class TestDeletePrivatePathServiceGateway: +class TestListEndpointGatewayIps: """ - Test Class for delete_private_path_service_gateway + Test Class for list_endpoint_gateway_ips """ @responses.activate - def test_delete_private_path_service_gateway_all_params(self): + def test_list_endpoint_gateway_ips_all_params(self): """ - delete_private_path_service_gateway() + list_endpoint_gateway_ips() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString') + url = preprocess_url('/endpoint_gateways/testString/ips') + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( - responses.DELETE, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - id = 'testString' + endpoint_gateway_id = 'testString' + start = 'testString' + limit = 50 + sort = 'name' # Invoke method - response = _service.delete_private_path_service_gateway( - id, + response = _service.list_endpoint_gateway_ips( + endpoint_gateway_id, + start=start, + limit=limit, + sort=sort, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'sort={}'.format(sort) in query_string - def test_delete_private_path_service_gateway_all_params_with_retries(self): - # Enable retries and run test_delete_private_path_service_gateway_all_params. + def test_list_endpoint_gateway_ips_all_params_with_retries(self): + # Enable retries and run test_list_endpoint_gateway_ips_all_params. _service.enable_retries() - self.test_delete_private_path_service_gateway_all_params() + self.test_list_endpoint_gateway_ips_all_params() - # Disable retries and run test_delete_private_path_service_gateway_all_params. + # Disable retries and run test_list_endpoint_gateway_ips_all_params. _service.disable_retries() - self.test_delete_private_path_service_gateway_all_params() + self.test_list_endpoint_gateway_ips_all_params() @responses.activate - def test_delete_private_path_service_gateway_value_error(self): + def test_list_endpoint_gateway_ips_required_params(self): """ - test_delete_private_path_service_gateway_value_error() + test_list_endpoint_gateway_ips_required_params() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString') + url = preprocess_url('/endpoint_gateways/testString/ips') + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( - responses.DELETE, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - id = 'testString' + endpoint_gateway_id = 'testString' + + # Invoke method + response = _service.list_endpoint_gateway_ips( + endpoint_gateway_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_endpoint_gateway_ips_required_params_with_retries(self): + # Enable retries and run test_list_endpoint_gateway_ips_required_params. + _service.enable_retries() + self.test_list_endpoint_gateway_ips_required_params() + + # Disable retries and run test_list_endpoint_gateway_ips_required_params. + _service.disable_retries() + self.test_list_endpoint_gateway_ips_required_params() + + @responses.activate + def test_list_endpoint_gateway_ips_value_error(self): + """ + test_list_endpoint_gateway_ips_value_error() + """ + # Set up mock + url = preprocess_url('/endpoint_gateways/testString/ips') + mock_response = '{"first": {"href": "href"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + endpoint_gateway_id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "id": id, + "endpoint_gateway_id": endpoint_gateway_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_private_path_service_gateway(**req_copy) + _service.list_endpoint_gateway_ips(**req_copy) - def test_delete_private_path_service_gateway_value_error_with_retries(self): - # Enable retries and run test_delete_private_path_service_gateway_value_error. + def test_list_endpoint_gateway_ips_value_error_with_retries(self): + # Enable retries and run test_list_endpoint_gateway_ips_value_error. _service.enable_retries() - self.test_delete_private_path_service_gateway_value_error() + self.test_list_endpoint_gateway_ips_value_error() - # Disable retries and run test_delete_private_path_service_gateway_value_error. + # Disable retries and run test_list_endpoint_gateway_ips_value_error. _service.disable_retries() - self.test_delete_private_path_service_gateway_value_error() + self.test_list_endpoint_gateway_ips_value_error() + @responses.activate + def test_list_endpoint_gateway_ips_with_pager_get_next(self): + """ + test_list_endpoint_gateway_ips_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/endpoint_gateways/testString/ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) -class TestGetPrivatePathServiceGateway: - """ - Test Class for get_private_path_service_gateway - """ + # Exercise the pager class for this operation + all_results = [] + pager = EndpointGatewayIpsPager( + client=_service, + endpoint_gateway_id='testString', + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 @responses.activate - def test_get_private_path_service_gateway_all_params(self): + def test_list_endpoint_gateway_ips_with_pager_get_all(self): """ - get_private_path_service_gateway() + test_list_endpoint_gateway_ips_with_pager_get_all() """ - # Set up mock - url = preprocess_url('/private_path_service_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + # Set up a two-page mock response + url = preprocess_url('/endpoint_gateways/testString/ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"provider","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}' responses.add( responses.GET, url, - body=mock_response, + body=mock_response1, content_type='application/json', status=200, ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = EndpointGatewayIpsPager( + client=_service, + endpoint_gateway_id='testString', + limit=10, + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestRemoveEndpointGatewayIp: + """ + Test Class for remove_endpoint_gateway_ip + """ + + @responses.activate + def test_remove_endpoint_gateway_ip_all_params(self): + """ + remove_endpoint_gateway_ip() + """ + # Set up mock + url = preprocess_url('/endpoint_gateways/testString/ips/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) # Set up parameter values + endpoint_gateway_id = 'testString' id = 'testString' # Invoke method - response = _service.get_private_path_service_gateway( + response = _service.remove_endpoint_gateway_ip( + endpoint_gateway_id, id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 204 - def test_get_private_path_service_gateway_all_params_with_retries(self): - # Enable retries and run test_get_private_path_service_gateway_all_params. + def test_remove_endpoint_gateway_ip_all_params_with_retries(self): + # Enable retries and run test_remove_endpoint_gateway_ip_all_params. _service.enable_retries() - self.test_get_private_path_service_gateway_all_params() + self.test_remove_endpoint_gateway_ip_all_params() - # Disable retries and run test_get_private_path_service_gateway_all_params. + # Disable retries and run test_remove_endpoint_gateway_ip_all_params. _service.disable_retries() - self.test_get_private_path_service_gateway_all_params() + self.test_remove_endpoint_gateway_ip_all_params() @responses.activate - def test_get_private_path_service_gateway_value_error(self): + def test_remove_endpoint_gateway_ip_value_error(self): """ - test_get_private_path_service_gateway_value_error() + test_remove_endpoint_gateway_ip_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + url = preprocess_url('/endpoint_gateways/testString/ips/testString') responses.add( - responses.GET, + responses.DELETE, url, - body=mock_response, - content_type='application/json', - status=200, + status=204, ) # Set up parameter values + endpoint_gateway_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { + "endpoint_gateway_id": endpoint_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_private_path_service_gateway(**req_copy) + _service.remove_endpoint_gateway_ip(**req_copy) - def test_get_private_path_service_gateway_value_error_with_retries(self): - # Enable retries and run test_get_private_path_service_gateway_value_error. + def test_remove_endpoint_gateway_ip_value_error_with_retries(self): + # Enable retries and run test_remove_endpoint_gateway_ip_value_error. _service.enable_retries() - self.test_get_private_path_service_gateway_value_error() + self.test_remove_endpoint_gateway_ip_value_error() - # Disable retries and run test_get_private_path_service_gateway_value_error. + # Disable retries and run test_remove_endpoint_gateway_ip_value_error. _service.disable_retries() - self.test_get_private_path_service_gateway_value_error() + self.test_remove_endpoint_gateway_ip_value_error() -class TestUpdatePrivatePathServiceGateway: +class TestGetEndpointGatewayIp: """ - Test Class for update_private_path_service_gateway + Test Class for get_endpoint_gateway_ip """ @responses.activate - def test_update_private_path_service_gateway_all_params(self): + def test_get_endpoint_gateway_ip_all_params(self): """ - update_private_path_service_gateway() + get_endpoint_gateway_ip() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + url = preprocess_url('/endpoint_gateways/testString/ips/testString') + mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add( - responses.PATCH, + responses.GET, url, body=mock_response, content_type='application/json', status=200, ) - # Construct a dict representation of a LoadBalancerIdentityById model - load_balancer_identity_model = {} - load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - - # Construct a dict representation of a PrivatePathServiceGatewayPatch model - private_path_service_gateway_patch_model = {} - private_path_service_gateway_patch_model['default_access_policy'] = 'deny' - private_path_service_gateway_patch_model['load_balancer'] = load_balancer_identity_model - private_path_service_gateway_patch_model['name'] = 'my-private-path-service-gateway' - private_path_service_gateway_patch_model['zonal_affinity'] = True - # Set up parameter values + endpoint_gateway_id = 'testString' id = 'testString' - private_path_service_gateway_patch = private_path_service_gateway_patch_model # Invoke method - response = _service.update_private_path_service_gateway( + response = _service.get_endpoint_gateway_ip( + endpoint_gateway_id, id, - private_path_service_gateway_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # Validate body params - req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == private_path_service_gateway_patch - def test_update_private_path_service_gateway_all_params_with_retries(self): - # Enable retries and run test_update_private_path_service_gateway_all_params. + def test_get_endpoint_gateway_ip_all_params_with_retries(self): + # Enable retries and run test_get_endpoint_gateway_ip_all_params. _service.enable_retries() - self.test_update_private_path_service_gateway_all_params() + self.test_get_endpoint_gateway_ip_all_params() - # Disable retries and run test_update_private_path_service_gateway_all_params. + # Disable retries and run test_get_endpoint_gateway_ip_all_params. _service.disable_retries() - self.test_update_private_path_service_gateway_all_params() + self.test_get_endpoint_gateway_ip_all_params() @responses.activate - def test_update_private_path_service_gateway_value_error(self): + def test_get_endpoint_gateway_ip_value_error(self): """ - test_update_private_path_service_gateway_value_error() + test_get_endpoint_gateway_ip_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + url = preprocess_url('/endpoint_gateways/testString/ips/testString') + mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add( - responses.PATCH, + responses.GET, url, body=mock_response, content_type='application/json', status=200, ) - # Construct a dict representation of a LoadBalancerIdentityById model - load_balancer_identity_model = {} - load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - - # Construct a dict representation of a PrivatePathServiceGatewayPatch model - private_path_service_gateway_patch_model = {} - private_path_service_gateway_patch_model['default_access_policy'] = 'deny' - private_path_service_gateway_patch_model['load_balancer'] = load_balancer_identity_model - private_path_service_gateway_patch_model['name'] = 'my-private-path-service-gateway' - private_path_service_gateway_patch_model['zonal_affinity'] = True - # Set up parameter values + endpoint_gateway_id = 'testString' id = 'testString' - private_path_service_gateway_patch = private_path_service_gateway_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { + "endpoint_gateway_id": endpoint_gateway_id, "id": id, - "private_path_service_gateway_patch": private_path_service_gateway_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_private_path_service_gateway(**req_copy) + _service.get_endpoint_gateway_ip(**req_copy) - def test_update_private_path_service_gateway_value_error_with_retries(self): - # Enable retries and run test_update_private_path_service_gateway_value_error. - _service.enable_retries() - self.test_update_private_path_service_gateway_value_error() - - # Disable retries and run test_update_private_path_service_gateway_value_error. - _service.disable_retries() - self.test_update_private_path_service_gateway_value_error() - - -class TestListPrivatePathServiceGatewayAccountPolicies: - """ - Test Class for list_private_path_service_gateway_account_policies - """ - - @responses.activate - def test_list_private_path_service_gateway_account_policies_all_params(self): - """ - list_private_path_service_gateway_account_policies() - """ - # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies') - mock_response = '{"account_policies": [{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - private_path_service_gateway_id = 'testString' - start = 'testString' - limit = 50 - account_id = 'bb1b52262f7441a586f49068482f1e60' - - # Invoke method - response = _service.list_private_path_service_gateway_account_policies( - private_path_service_gateway_id, - start=start, - limit=limit, - account_id=account_id, - headers={}, - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'account.id={}'.format(account_id) in query_string - - def test_list_private_path_service_gateway_account_policies_all_params_with_retries(self): - # Enable retries and run test_list_private_path_service_gateway_account_policies_all_params. - _service.enable_retries() - self.test_list_private_path_service_gateway_account_policies_all_params() - - # Disable retries and run test_list_private_path_service_gateway_account_policies_all_params. - _service.disable_retries() - self.test_list_private_path_service_gateway_account_policies_all_params() - - @responses.activate - def test_list_private_path_service_gateway_account_policies_required_params(self): - """ - test_list_private_path_service_gateway_account_policies_required_params() - """ - # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies') - mock_response = '{"account_policies": [{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - private_path_service_gateway_id = 'testString' - - # Invoke method - response = _service.list_private_path_service_gateway_account_policies( - private_path_service_gateway_id, - headers={}, - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_list_private_path_service_gateway_account_policies_required_params_with_retries(self): - # Enable retries and run test_list_private_path_service_gateway_account_policies_required_params. - _service.enable_retries() - self.test_list_private_path_service_gateway_account_policies_required_params() - - # Disable retries and run test_list_private_path_service_gateway_account_policies_required_params. - _service.disable_retries() - self.test_list_private_path_service_gateway_account_policies_required_params() - - @responses.activate - def test_list_private_path_service_gateway_account_policies_value_error(self): - """ - test_list_private_path_service_gateway_account_policies_value_error() - """ - # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies') - mock_response = '{"account_policies": [{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - private_path_service_gateway_id = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "private_path_service_gateway_id": private_path_service_gateway_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.list_private_path_service_gateway_account_policies(**req_copy) - - def test_list_private_path_service_gateway_account_policies_value_error_with_retries(self): - # Enable retries and run test_list_private_path_service_gateway_account_policies_value_error. + def test_get_endpoint_gateway_ip_value_error_with_retries(self): + # Enable retries and run test_get_endpoint_gateway_ip_value_error. _service.enable_retries() - self.test_list_private_path_service_gateway_account_policies_value_error() + self.test_get_endpoint_gateway_ip_value_error() - # Disable retries and run test_list_private_path_service_gateway_account_policies_value_error. + # Disable retries and run test_get_endpoint_gateway_ip_value_error. _service.disable_retries() - self.test_list_private_path_service_gateway_account_policies_value_error() - - @responses.activate - def test_list_private_path_service_gateway_account_policies_with_pager_get_next(self): - """ - test_list_private_path_service_gateway_account_policies_with_pager_get_next() - """ - # Set up a two-page mock response - url = preprocess_url('/private_path_service_gateways/testString/account_policies') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r134-fb880975-db45-4459-8548-64e3995ac213","resource_type":"private_path_service_gateway_account_policy"}]}' - mock_response2 = '{"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r134-fb880975-db45-4459-8548-64e3995ac213","resource_type":"private_path_service_gateway_account_policy"}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - all_results = [] - pager = PrivatePathServiceGatewayAccountPoliciesPager( - client=_service, - private_path_service_gateway_id='testString', - limit=10, - account_id='bb1b52262f7441a586f49068482f1e60', - ) - while pager.has_next(): - next_page = pager.get_next() - assert next_page is not None - all_results.extend(next_page) - assert len(all_results) == 2 - - @responses.activate - def test_list_private_path_service_gateway_account_policies_with_pager_get_all(self): - """ - test_list_private_path_service_gateway_account_policies_with_pager_get_all() - """ - # Set up a two-page mock response - url = preprocess_url('/private_path_service_gateways/testString/account_policies') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r134-fb880975-db45-4459-8548-64e3995ac213","resource_type":"private_path_service_gateway_account_policy"}]}' - mock_response2 = '{"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r134-fb880975-db45-4459-8548-64e3995ac213","resource_type":"private_path_service_gateway_account_policy"}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) - responses.add( - responses.GET, - url, - body=mock_response2, - content_type='application/json', - status=200, - ) - - # Exercise the pager class for this operation - pager = PrivatePathServiceGatewayAccountPoliciesPager( - client=_service, - private_path_service_gateway_id='testString', - limit=10, - account_id='bb1b52262f7441a586f49068482f1e60', - ) - all_results = pager.get_all() - assert all_results is not None - assert len(all_results) == 2 + self.test_get_endpoint_gateway_ip_value_error() -class TestCreatePrivatePathServiceGatewayAccountPolicy: +class TestAddEndpointGatewayIp: """ - Test Class for create_private_path_service_gateway_account_policy + Test Class for add_endpoint_gateway_ip """ @responses.activate - def test_create_private_path_service_gateway_account_policy_all_params(self): + def test_add_endpoint_gateway_ip_all_params(self): """ - create_private_path_service_gateway_account_policy() + add_endpoint_gateway_ip() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies') - mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + url = preprocess_url('/endpoint_gateways/testString/ips/testString') + mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add( - responses.POST, + responses.PUT, url, body=mock_response, content_type='application/json', status=201, ) - # Construct a dict representation of a AccountIdentityById model - account_identity_model = {} - account_identity_model['id'] = 'bb1b52262f7441a586f49068482f1e60' - # Set up parameter values - private_path_service_gateway_id = 'testString' - access_policy = 'deny' - account = account_identity_model + endpoint_gateway_id = 'testString' + id = 'testString' # Invoke method - response = _service.create_private_path_service_gateway_account_policy( - private_path_service_gateway_id, - access_policy, - account, + response = _service.add_endpoint_gateway_ip( + endpoint_gateway_id, + id, 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['access_policy'] == 'deny' - assert req_body['account'] == account_identity_model - def test_create_private_path_service_gateway_account_policy_all_params_with_retries(self): - # Enable retries and run test_create_private_path_service_gateway_account_policy_all_params. + def test_add_endpoint_gateway_ip_all_params_with_retries(self): + # Enable retries and run test_add_endpoint_gateway_ip_all_params. _service.enable_retries() - self.test_create_private_path_service_gateway_account_policy_all_params() + self.test_add_endpoint_gateway_ip_all_params() - # Disable retries and run test_create_private_path_service_gateway_account_policy_all_params. + # Disable retries and run test_add_endpoint_gateway_ip_all_params. _service.disable_retries() - self.test_create_private_path_service_gateway_account_policy_all_params() + self.test_add_endpoint_gateway_ip_all_params() @responses.activate - def test_create_private_path_service_gateway_account_policy_value_error(self): + def test_add_endpoint_gateway_ip_value_error(self): """ - test_create_private_path_service_gateway_account_policy_value_error() + test_add_endpoint_gateway_ip_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies') - mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + url = preprocess_url('/endpoint_gateways/testString/ips/testString') + mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "provider", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add( - responses.POST, + responses.PUT, url, body=mock_response, content_type='application/json', status=201, ) - # Construct a dict representation of a AccountIdentityById model - account_identity_model = {} - account_identity_model['id'] = 'bb1b52262f7441a586f49068482f1e60' - # Set up parameter values - private_path_service_gateway_id = 'testString' - access_policy = 'deny' - account = account_identity_model + endpoint_gateway_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_gateway_id, - "access_policy": access_policy, - "account": account, + "endpoint_gateway_id": endpoint_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.create_private_path_service_gateway_account_policy(**req_copy) + _service.add_endpoint_gateway_ip(**req_copy) - def test_create_private_path_service_gateway_account_policy_value_error_with_retries(self): - # Enable retries and run test_create_private_path_service_gateway_account_policy_value_error. + def test_add_endpoint_gateway_ip_value_error_with_retries(self): + # Enable retries and run test_add_endpoint_gateway_ip_value_error. _service.enable_retries() - self.test_create_private_path_service_gateway_account_policy_value_error() + self.test_add_endpoint_gateway_ip_value_error() - # Disable retries and run test_create_private_path_service_gateway_account_policy_value_error. + # Disable retries and run test_add_endpoint_gateway_ip_value_error. _service.disable_retries() - self.test_create_private_path_service_gateway_account_policy_value_error() + self.test_add_endpoint_gateway_ip_value_error() -class TestDeletePrivatePathServiceGatewayAccountPolicy: +class TestDeleteEndpointGateway: """ - Test Class for delete_private_path_service_gateway_account_policy + Test Class for delete_endpoint_gateway """ @responses.activate - def test_delete_private_path_service_gateway_account_policy_all_params(self): + def test_delete_endpoint_gateway_all_params(self): """ - delete_private_path_service_gateway_account_policy() + delete_endpoint_gateway() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') + url = preprocess_url('/endpoint_gateways/testString') responses.add( responses.DELETE, url, @@ -48731,12 +50688,10 @@ def test_delete_private_path_service_gateway_account_policy_all_params(self): ) # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' # Invoke method - response = _service.delete_private_path_service_gateway_account_policy( - private_path_service_gateway_id, + response = _service.delete_endpoint_gateway( id, headers={}, ) @@ -48745,22 +50700,22 @@ def test_delete_private_path_service_gateway_account_policy_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 204 - def test_delete_private_path_service_gateway_account_policy_all_params_with_retries(self): - # Enable retries and run test_delete_private_path_service_gateway_account_policy_all_params. + def test_delete_endpoint_gateway_all_params_with_retries(self): + # Enable retries and run test_delete_endpoint_gateway_all_params. _service.enable_retries() - self.test_delete_private_path_service_gateway_account_policy_all_params() + self.test_delete_endpoint_gateway_all_params() - # Disable retries and run test_delete_private_path_service_gateway_account_policy_all_params. + # Disable retries and run test_delete_endpoint_gateway_all_params. _service.disable_retries() - self.test_delete_private_path_service_gateway_account_policy_all_params() + self.test_delete_endpoint_gateway_all_params() @responses.activate - def test_delete_private_path_service_gateway_account_policy_value_error(self): + def test_delete_endpoint_gateway_value_error(self): """ - test_delete_private_path_service_gateway_account_policy_value_error() + test_delete_endpoint_gateway_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') + url = preprocess_url('/endpoint_gateways/testString') responses.add( responses.DELETE, url, @@ -48768,42 +50723,40 @@ def test_delete_private_path_service_gateway_account_policy_value_error(self): ) # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_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.delete_private_path_service_gateway_account_policy(**req_copy) + _service.delete_endpoint_gateway(**req_copy) - def test_delete_private_path_service_gateway_account_policy_value_error_with_retries(self): - # Enable retries and run test_delete_private_path_service_gateway_account_policy_value_error. + def test_delete_endpoint_gateway_value_error_with_retries(self): + # Enable retries and run test_delete_endpoint_gateway_value_error. _service.enable_retries() - self.test_delete_private_path_service_gateway_account_policy_value_error() + self.test_delete_endpoint_gateway_value_error() - # Disable retries and run test_delete_private_path_service_gateway_account_policy_value_error. + # Disable retries and run test_delete_endpoint_gateway_value_error. _service.disable_retries() - self.test_delete_private_path_service_gateway_account_policy_value_error() + self.test_delete_endpoint_gateway_value_error() -class TestGetPrivatePathServiceGatewayAccountPolicy: +class TestGetEndpointGateway: """ - Test Class for get_private_path_service_gateway_account_policy + Test Class for get_endpoint_gateway """ @responses.activate - def test_get_private_path_service_gateway_account_policy_all_params(self): + def test_get_endpoint_gateway_all_params(self): """ - get_private_path_service_gateway_account_policy() + get_endpoint_gateway() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') - mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + url = preprocess_url('/endpoint_gateways/testString') + mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -48813,12 +50766,10 @@ def test_get_private_path_service_gateway_account_policy_all_params(self): ) # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' # Invoke method - response = _service.get_private_path_service_gateway_account_policy( - private_path_service_gateway_id, + response = _service.get_endpoint_gateway( id, headers={}, ) @@ -48827,23 +50778,23 @@ def test_get_private_path_service_gateway_account_policy_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_private_path_service_gateway_account_policy_all_params_with_retries(self): - # Enable retries and run test_get_private_path_service_gateway_account_policy_all_params. + def test_get_endpoint_gateway_all_params_with_retries(self): + # Enable retries and run test_get_endpoint_gateway_all_params. _service.enable_retries() - self.test_get_private_path_service_gateway_account_policy_all_params() + self.test_get_endpoint_gateway_all_params() - # Disable retries and run test_get_private_path_service_gateway_account_policy_all_params. + # Disable retries and run test_get_endpoint_gateway_all_params. _service.disable_retries() - self.test_get_private_path_service_gateway_account_policy_all_params() + self.test_get_endpoint_gateway_all_params() @responses.activate - def test_get_private_path_service_gateway_account_policy_value_error(self): + def test_get_endpoint_gateway_value_error(self): """ - test_get_private_path_service_gateway_account_policy_value_error() + test_get_endpoint_gateway_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') - mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + url = preprocess_url('/endpoint_gateways/testString') + mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -48853,42 +50804,40 @@ def test_get_private_path_service_gateway_account_policy_value_error(self): ) # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_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_private_path_service_gateway_account_policy(**req_copy) + _service.get_endpoint_gateway(**req_copy) - def test_get_private_path_service_gateway_account_policy_value_error_with_retries(self): - # Enable retries and run test_get_private_path_service_gateway_account_policy_value_error. + def test_get_endpoint_gateway_value_error_with_retries(self): + # Enable retries and run test_get_endpoint_gateway_value_error. _service.enable_retries() - self.test_get_private_path_service_gateway_account_policy_value_error() + self.test_get_endpoint_gateway_value_error() - # Disable retries and run test_get_private_path_service_gateway_account_policy_value_error. + # Disable retries and run test_get_endpoint_gateway_value_error. _service.disable_retries() - self.test_get_private_path_service_gateway_account_policy_value_error() + self.test_get_endpoint_gateway_value_error() -class TestUpdatePrivatePathServiceGatewayAccountPolicy: +class TestUpdateEndpointGateway: """ - Test Class for update_private_path_service_gateway_account_policy + Test Class for update_endpoint_gateway """ @responses.activate - def test_update_private_path_service_gateway_account_policy_all_params(self): + def test_update_endpoint_gateway_all_params(self): """ - update_private_path_service_gateway_account_policy() + update_endpoint_gateway() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') - mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + url = preprocess_url('/endpoint_gateways/testString') + mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -48897,20 +50846,19 @@ def test_update_private_path_service_gateway_account_policy_all_params(self): status=200, ) - # Construct a dict representation of a PrivatePathServiceGatewayAccountPolicyPatch model - private_path_service_gateway_account_policy_patch_model = {} - private_path_service_gateway_account_policy_patch_model['access_policy'] = 'deny' + # Construct a dict representation of a EndpointGatewayPatch model + endpoint_gateway_patch_model = {} + endpoint_gateway_patch_model['allow_dns_resolution_binding'] = True + endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway' # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' - private_path_service_gateway_account_policy_patch = private_path_service_gateway_account_policy_patch_model + endpoint_gateway_patch = endpoint_gateway_patch_model # Invoke method - response = _service.update_private_path_service_gateway_account_policy( - private_path_service_gateway_id, + response = _service.update_endpoint_gateway( id, - private_path_service_gateway_account_policy_patch, + endpoint_gateway_patch, headers={}, ) @@ -48919,25 +50867,25 @@ def test_update_private_path_service_gateway_account_policy_all_params(self): assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body == private_path_service_gateway_account_policy_patch + assert req_body == endpoint_gateway_patch - def test_update_private_path_service_gateway_account_policy_all_params_with_retries(self): - # Enable retries and run test_update_private_path_service_gateway_account_policy_all_params. + def test_update_endpoint_gateway_all_params_with_retries(self): + # Enable retries and run test_update_endpoint_gateway_all_params. _service.enable_retries() - self.test_update_private_path_service_gateway_account_policy_all_params() + self.test_update_endpoint_gateway_all_params() - # Disable retries and run test_update_private_path_service_gateway_account_policy_all_params. + # Disable retries and run test_update_endpoint_gateway_all_params. _service.disable_retries() - self.test_update_private_path_service_gateway_account_policy_all_params() + self.test_update_endpoint_gateway_all_params() @responses.activate - def test_update_private_path_service_gateway_account_policy_value_error(self): + def test_update_endpoint_gateway_value_error(self): """ - test_update_private_path_service_gateway_account_policy_value_error() + test_update_endpoint_gateway_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') - mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + url = preprocess_url('/endpoint_gateways/testString') + mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "name": "my-private-path-service-gateway", "remote": {"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "private_path_service_gateway"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -48946,102 +50894,105 @@ def test_update_private_path_service_gateway_account_policy_value_error(self): status=200, ) - # Construct a dict representation of a PrivatePathServiceGatewayAccountPolicyPatch model - private_path_service_gateway_account_policy_patch_model = {} - private_path_service_gateway_account_policy_patch_model['access_policy'] = 'deny' + # Construct a dict representation of a EndpointGatewayPatch model + endpoint_gateway_patch_model = {} + endpoint_gateway_patch_model['allow_dns_resolution_binding'] = True + endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway' # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' - private_path_service_gateway_account_policy_patch = private_path_service_gateway_account_policy_patch_model + endpoint_gateway_patch = endpoint_gateway_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_gateway_id, "id": id, - "private_path_service_gateway_account_policy_patch": private_path_service_gateway_account_policy_patch, + "endpoint_gateway_patch": endpoint_gateway_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.update_private_path_service_gateway_account_policy(**req_copy) + _service.update_endpoint_gateway(**req_copy) - def test_update_private_path_service_gateway_account_policy_value_error_with_retries(self): - # Enable retries and run test_update_private_path_service_gateway_account_policy_value_error. + def test_update_endpoint_gateway_value_error_with_retries(self): + # Enable retries and run test_update_endpoint_gateway_value_error. _service.enable_retries() - self.test_update_private_path_service_gateway_account_policy_value_error() + self.test_update_endpoint_gateway_value_error() - # Disable retries and run test_update_private_path_service_gateway_account_policy_value_error. + # Disable retries and run test_update_endpoint_gateway_value_error. _service.disable_retries() - self.test_update_private_path_service_gateway_account_policy_value_error() + self.test_update_endpoint_gateway_value_error() -class TestListPrivatePathServiceGatewayEndpointGatewayBindings: +# endregion +############################################################################## +# End of Service: EndpointGateways +############################################################################## + +############################################################################## +# Start of Service: FlowLogCollectors +############################################################################## +# region + + +class TestNewInstance: """ - Test Class for list_private_path_service_gateway_endpoint_gateway_bindings + Test Class for new_instance """ - @responses.activate - def test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params(self): + def test_new_instance(self): """ - list_private_path_service_gateway_endpoint_gateway_bindings() + new_instance() """ - # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') - mock_response = '{"endpoint_gateway_bindings": [{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - private_path_service_gateway_id = 'testString' - start = 'testString' - limit = 50 - status = 'abandoned' - account_id = 'bb1b52262f7441a586f49068482f1e60' + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - # Invoke method - response = _service.list_private_path_service_gateway_endpoint_gateway_bindings( - private_path_service_gateway_id, - start=start, - limit=limit, - status=status, - account_id=account_id, - headers={}, + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', ) - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'start={}'.format(start) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'status={}'.format(status) in query_string - assert 'account.id={}'.format(account_id) in query_string + assert service is not None + assert isinstance(service, VpcV1) - def test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params_with_retries(self): - # Enable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params. - _service.enable_retries() - self.test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params() + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) - # Disable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params. - _service.disable_retries() - self.test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params() + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) + + +class TestListFlowLogCollectors: + """ + Test Class for list_flow_log_collectors + """ @responses.activate - def test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params(self): + def test_list_flow_log_collectors_all_params(self): """ - test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params() + list_flow_log_collectors() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') - mock_response = '{"endpoint_gateway_bindings": [{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/flow_log_collectors') + mock_response = '{"first": {"href": "href"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -49051,35 +51002,63 @@ def test_list_private_path_service_gateway_endpoint_gateway_bindings_required_pa ) # Set up parameter values - private_path_service_gateway_id = 'testString' + start = 'testString' + limit = 50 + resource_group_id = 'testString' + name = 'my-name' + vpc_id = 'testString' + vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_name = 'my-vpc' + target_id = 'testString' + target_resource_type = 'testString' # Invoke method - response = _service.list_private_path_service_gateway_endpoint_gateway_bindings( - private_path_service_gateway_id, + response = _service.list_flow_log_collectors( + start=start, + limit=limit, + resource_group_id=resource_group_id, + name=name, + vpc_id=vpc_id, + vpc_crn=vpc_crn, + vpc_name=vpc_name, + target_id=target_id, + target_resource_type=target_resource_type, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'name={}'.format(name) in query_string + assert 'vpc.id={}'.format(vpc_id) in query_string + assert 'vpc.crn={}'.format(vpc_crn) in query_string + assert 'vpc.name={}'.format(vpc_name) in query_string + assert 'target.id={}'.format(target_id) in query_string + assert 'target.resource_type={}'.format(target_resource_type) in query_string - def test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params_with_retries(self): - # Enable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params. + def test_list_flow_log_collectors_all_params_with_retries(self): + # Enable retries and run test_list_flow_log_collectors_all_params. _service.enable_retries() - self.test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params() + self.test_list_flow_log_collectors_all_params() - # Disable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params. + # Disable retries and run test_list_flow_log_collectors_all_params. _service.disable_retries() - self.test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params() + self.test_list_flow_log_collectors_all_params() @responses.activate - def test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error(self): + def test_list_flow_log_collectors_required_params(self): """ - test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error() + test_list_flow_log_collectors_required_params() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') - mock_response = '{"endpoint_gateway_bindings": [{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + url = preprocess_url('/flow_log_collectors') + mock_response = '{"first": {"href": "href"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' responses.add( responses.GET, url, @@ -49088,36 +51067,64 @@ def test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error status=200, ) - # Set up parameter values - private_path_service_gateway_id = 'testString' + # Invoke method + response = _service.list_flow_log_collectors() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_flow_log_collectors_required_params_with_retries(self): + # Enable retries and run test_list_flow_log_collectors_required_params. + _service.enable_retries() + self.test_list_flow_log_collectors_required_params() + + # Disable retries and run test_list_flow_log_collectors_required_params. + _service.disable_retries() + self.test_list_flow_log_collectors_required_params() + + @responses.activate + def test_list_flow_log_collectors_value_error(self): + """ + test_list_flow_log_collectors_value_error() + """ + # Set up mock + url = preprocess_url('/flow_log_collectors') + mock_response = '{"first": {"href": "href"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_gateway_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.list_private_path_service_gateway_endpoint_gateway_bindings(**req_copy) + _service.list_flow_log_collectors(**req_copy) - def test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error_with_retries(self): - # Enable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error. + def test_list_flow_log_collectors_value_error_with_retries(self): + # Enable retries and run test_list_flow_log_collectors_value_error. _service.enable_retries() - self.test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error() + self.test_list_flow_log_collectors_value_error() - # Disable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error. + # Disable retries and run test_list_flow_log_collectors_value_error. _service.disable_retries() - self.test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error() + self.test_list_flow_log_collectors_value_error() @responses.activate - def test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_get_next(self): + def test_list_flow_log_collectors_with_pager_get_next(self): """ - test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_get_next() + test_list_flow_log_collectors_with_pager_get_next() """ # Set up a two-page mock response - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}' - mock_response2 = '{"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}' + url = preprocess_url('/flow_log_collectors') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' responses.add( responses.GET, url, @@ -49135,12 +51142,16 @@ def test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_ # Exercise the pager class for this operation all_results = [] - pager = PrivatePathServiceGatewayEndpointGatewayBindingsPager( + pager = FlowLogCollectorsPager( client=_service, - private_path_service_gateway_id='testString', limit=10, - status='abandoned', - account_id='bb1b52262f7441a586f49068482f1e60', + resource_group_id='testString', + name='my-name', + vpc_id='testString', + vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', + vpc_name='my-vpc', + target_id='testString', + target_resource_type='testString', ) while pager.has_next(): next_page = pager.get_next() @@ -49149,14 +51160,14 @@ def test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_ assert len(all_results) == 2 @responses.activate - def test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_get_all(self): + def test_list_flow_log_collectors_with_pager_get_all(self): """ - test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_get_all() + test_list_flow_log_collectors_with_pager_get_all() """ # Set up a two-page mock response - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}' - mock_response2 = '{"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}' + url = preprocess_url('/flow_log_collectors') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0717-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' responses.add( responses.GET, url, @@ -49173,534 +51184,793 @@ def test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_ ) # Exercise the pager class for this operation - pager = PrivatePathServiceGatewayEndpointGatewayBindingsPager( + pager = FlowLogCollectorsPager( client=_service, - private_path_service_gateway_id='testString', limit=10, - status='abandoned', - account_id='bb1b52262f7441a586f49068482f1e60', + resource_group_id='testString', + name='my-name', + vpc_id='testString', + vpc_crn='crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b', + vpc_name='my-vpc', + target_id='testString', + target_resource_type='testString', ) all_results = pager.get_all() assert all_results is not None assert len(all_results) == 2 -class TestGetPrivatePathServiceGatewayEndpointGatewayBinding: +class TestCreateFlowLogCollector: """ - Test Class for get_private_path_service_gateway_endpoint_gateway_binding + Test Class for create_flow_log_collector """ @responses.activate - def test_get_private_path_service_gateway_endpoint_gateway_binding_all_params(self): + def test_create_flow_log_collector_all_params(self): """ - get_private_path_service_gateway_endpoint_gateway_binding() + create_flow_log_collector() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString') - mock_response = '{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}' + url = preprocess_url('/flow_log_collectors') + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.GET, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) + # Construct a dict representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacy_cloud_object_storage_bucket_identity_model = {} + legacy_cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue' + + # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model + flow_log_collector_target_prototype_model = {} + flow_log_collector_target_prototype_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Set up parameter values - private_path_service_gateway_id = 'testString' - id = 'testString' + storage_bucket = legacy_cloud_object_storage_bucket_identity_model + target = flow_log_collector_target_prototype_model + active = False + name = 'my-flow-log-collector' + resource_group = resource_group_identity_model # Invoke method - response = _service.get_private_path_service_gateway_endpoint_gateway_binding( - private_path_service_gateway_id, - id, + response = _service.create_flow_log_collector( + storage_bucket, + target, + active=active, + name=name, + resource_group=resource_group, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['storage_bucket'] == legacy_cloud_object_storage_bucket_identity_model + assert req_body['target'] == flow_log_collector_target_prototype_model + assert req_body['active'] == False + assert req_body['name'] == 'my-flow-log-collector' + assert req_body['resource_group'] == resource_group_identity_model - def test_get_private_path_service_gateway_endpoint_gateway_binding_all_params_with_retries(self): - # Enable retries and run test_get_private_path_service_gateway_endpoint_gateway_binding_all_params. + def test_create_flow_log_collector_all_params_with_retries(self): + # Enable retries and run test_create_flow_log_collector_all_params. _service.enable_retries() - self.test_get_private_path_service_gateway_endpoint_gateway_binding_all_params() + self.test_create_flow_log_collector_all_params() - # Disable retries and run test_get_private_path_service_gateway_endpoint_gateway_binding_all_params. + # Disable retries and run test_create_flow_log_collector_all_params. _service.disable_retries() - self.test_get_private_path_service_gateway_endpoint_gateway_binding_all_params() + self.test_create_flow_log_collector_all_params() @responses.activate - def test_get_private_path_service_gateway_endpoint_gateway_binding_value_error(self): + def test_create_flow_log_collector_value_error(self): """ - test_get_private_path_service_gateway_endpoint_gateway_binding_value_error() + test_create_flow_log_collector_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString') - mock_response = '{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}' + url = preprocess_url('/flow_log_collectors') + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.GET, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) + # Construct a dict representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacy_cloud_object_storage_bucket_identity_model = {} + legacy_cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue' + + # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model + flow_log_collector_target_prototype_model = {} + flow_log_collector_target_prototype_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Set up parameter values - private_path_service_gateway_id = 'testString' - id = 'testString' + storage_bucket = legacy_cloud_object_storage_bucket_identity_model + target = flow_log_collector_target_prototype_model + active = False + name = 'my-flow-log-collector' + resource_group = resource_group_identity_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_gateway_id, - "id": id, + "storage_bucket": storage_bucket, + "target": target, } 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_private_path_service_gateway_endpoint_gateway_binding(**req_copy) + _service.create_flow_log_collector(**req_copy) - def test_get_private_path_service_gateway_endpoint_gateway_binding_value_error_with_retries(self): - # Enable retries and run test_get_private_path_service_gateway_endpoint_gateway_binding_value_error. + def test_create_flow_log_collector_value_error_with_retries(self): + # Enable retries and run test_create_flow_log_collector_value_error. _service.enable_retries() - self.test_get_private_path_service_gateway_endpoint_gateway_binding_value_error() + self.test_create_flow_log_collector_value_error() - # Disable retries and run test_get_private_path_service_gateway_endpoint_gateway_binding_value_error. + # Disable retries and run test_create_flow_log_collector_value_error. _service.disable_retries() - self.test_get_private_path_service_gateway_endpoint_gateway_binding_value_error() + self.test_create_flow_log_collector_value_error() -class TestDenyPrivatePathServiceGatewayEndpointGatewayBinding: +class TestDeleteFlowLogCollector: """ - Test Class for deny_private_path_service_gateway_endpoint_gateway_binding + Test Class for delete_flow_log_collector """ @responses.activate - def test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params(self): + def test_delete_flow_log_collector_all_params(self): """ - deny_private_path_service_gateway_endpoint_gateway_binding() + delete_flow_log_collector() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny') + url = preprocess_url('/flow_log_collectors/testString') responses.add( - responses.POST, + responses.DELETE, url, status=204, ) # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' - set_account_policy = True # Invoke method - response = _service.deny_private_path_service_gateway_endpoint_gateway_binding( - private_path_service_gateway_id, + response = _service.delete_flow_log_collector( id, - set_account_policy=set_account_policy, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 204 - # Validate body params - req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['set_account_policy'] == True - def test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params_with_retries(self): - # Enable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params. + def test_delete_flow_log_collector_all_params_with_retries(self): + # Enable retries and run test_delete_flow_log_collector_all_params. _service.enable_retries() - self.test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params() + self.test_delete_flow_log_collector_all_params() - # Disable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params. + # Disable retries and run test_delete_flow_log_collector_all_params. _service.disable_retries() - self.test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params() + self.test_delete_flow_log_collector_all_params() @responses.activate - def test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params(self): + def test_delete_flow_log_collector_value_error(self): """ - test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params() + test_delete_flow_log_collector_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny') + url = preprocess_url('/flow_log_collectors/testString') responses.add( - responses.POST, + responses.DELETE, url, status=204, ) # Set up parameter values - private_path_service_gateway_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.delete_flow_log_collector(**req_copy) + + def test_delete_flow_log_collector_value_error_with_retries(self): + # Enable retries and run test_delete_flow_log_collector_value_error. + _service.enable_retries() + self.test_delete_flow_log_collector_value_error() + + # Disable retries and run test_delete_flow_log_collector_value_error. + _service.disable_retries() + self.test_delete_flow_log_collector_value_error() + + +class TestGetFlowLogCollector: + """ + Test Class for get_flow_log_collector + """ + + @responses.activate + def test_get_flow_log_collector_all_params(self): + """ + get_flow_log_collector() + """ + # Set up mock + url = preprocess_url('/flow_log_collectors/testString') + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values id = 'testString' # Invoke method - response = _service.deny_private_path_service_gateway_endpoint_gateway_binding( - private_path_service_gateway_id, + response = _service.get_flow_log_collector( id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 200 - def test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params_with_retries(self): - # Enable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params. + def test_get_flow_log_collector_all_params_with_retries(self): + # Enable retries and run test_get_flow_log_collector_all_params. _service.enable_retries() - self.test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params() + self.test_get_flow_log_collector_all_params() - # Disable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params. + # Disable retries and run test_get_flow_log_collector_all_params. _service.disable_retries() - self.test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params() + self.test_get_flow_log_collector_all_params() @responses.activate - def test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error(self): + def test_get_flow_log_collector_value_error(self): """ - test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error() + test_get_flow_log_collector_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny') + url = preprocess_url('/flow_log_collectors/testString') + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.POST, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_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.deny_private_path_service_gateway_endpoint_gateway_binding(**req_copy) + _service.get_flow_log_collector(**req_copy) - def test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error_with_retries(self): - # Enable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error. + def test_get_flow_log_collector_value_error_with_retries(self): + # Enable retries and run test_get_flow_log_collector_value_error. _service.enable_retries() - self.test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error() + self.test_get_flow_log_collector_value_error() - # Disable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error. + # Disable retries and run test_get_flow_log_collector_value_error. _service.disable_retries() - self.test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error() + self.test_get_flow_log_collector_value_error() -class TestPermitPrivatePathServiceGatewayEndpointGatewayBinding: +class TestUpdateFlowLogCollector: """ - Test Class for permit_private_path_service_gateway_endpoint_gateway_binding + Test Class for update_flow_log_collector """ @responses.activate - def test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params(self): + def test_update_flow_log_collector_all_params(self): """ - permit_private_path_service_gateway_endpoint_gateway_binding() + update_flow_log_collector() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit') + url = preprocess_url('/flow_log_collectors/testString') + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.POST, + responses.PATCH, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) + # Construct a dict representation of a FlowLogCollectorPatch model + flow_log_collector_patch_model = {} + flow_log_collector_patch_model['active'] = True + flow_log_collector_patch_model['name'] = 'my-flow-log-collector' + # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' - set_account_policy = True + flow_log_collector_patch = flow_log_collector_patch_model # Invoke method - response = _service.permit_private_path_service_gateway_endpoint_gateway_binding( - private_path_service_gateway_id, + response = _service.update_flow_log_collector( id, - set_account_policy=set_account_policy, + flow_log_collector_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 200 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['set_account_policy'] == True + assert req_body == flow_log_collector_patch - def test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params_with_retries(self): - # Enable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params. + def test_update_flow_log_collector_all_params_with_retries(self): + # Enable retries and run test_update_flow_log_collector_all_params. _service.enable_retries() - self.test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params() + self.test_update_flow_log_collector_all_params() - # Disable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params. + # Disable retries and run test_update_flow_log_collector_all_params. _service.disable_retries() - self.test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params() + self.test_update_flow_log_collector_all_params() @responses.activate - def test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params(self): + def test_update_flow_log_collector_value_error(self): """ - test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params() + test_update_flow_log_collector_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit') + url = preprocess_url('/flow_log_collectors/testString') + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0717-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( - responses.POST, + responses.PATCH, url, - status=204, - ) - - # Set up parameter values - private_path_service_gateway_id = 'testString' - id = 'testString' - - # Invoke method - response = _service.permit_private_path_service_gateway_endpoint_gateway_binding( - private_path_service_gateway_id, - id, - headers={}, + body=mock_response, + content_type='application/json', + status=200, ) - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 204 - - def test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params_with_retries(self): - # Enable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params. - _service.enable_retries() - self.test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params() - - # Disable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params. - _service.disable_retries() - self.test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params() - - @responses.activate - def test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error(self): - """ - test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error() - """ - # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit') - responses.add( - responses.POST, - url, - status=204, - ) + # Construct a dict representation of a FlowLogCollectorPatch model + flow_log_collector_patch_model = {} + flow_log_collector_patch_model['active'] = True + flow_log_collector_patch_model['name'] = 'my-flow-log-collector' # Set up parameter values - private_path_service_gateway_id = 'testString' id = 'testString' + flow_log_collector_patch = flow_log_collector_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_gateway_id, "id": id, + "flow_log_collector_patch": flow_log_collector_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.permit_private_path_service_gateway_endpoint_gateway_binding(**req_copy) + _service.update_flow_log_collector(**req_copy) - def test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error_with_retries(self): - # Enable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error. + def test_update_flow_log_collector_value_error_with_retries(self): + # Enable retries and run test_update_flow_log_collector_value_error. _service.enable_retries() - self.test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error() + self.test_update_flow_log_collector_value_error() - # Disable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error. + # Disable retries and run test_update_flow_log_collector_value_error. _service.disable_retries() - self.test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error() + self.test_update_flow_log_collector_value_error() -class TestPublishPrivatePathServiceGateway: +# endregion +############################################################################## +# End of Service: FlowLogCollectors +############################################################################## + +############################################################################## +# Start of Service: PrivatePathServiceGateways +############################################################################## +# region + + +class TestNewInstance: """ - Test Class for publish_private_path_service_gateway + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, VpcV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) + + # def test_new_instance_without_required_params(self): + # """ + # new_instance_without_required_params() + # """ + # with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + # service = VpcV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) + + +class TestListPrivatePathServiceGateways: + """ + Test Class for list_private_path_service_gateways """ @responses.activate - def test_publish_private_path_service_gateway_all_params(self): + def test_list_private_path_service_gateways_all_params(self): """ - publish_private_path_service_gateway() + list_private_path_service_gateways() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/publish') + url = preprocess_url('/private_path_service_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "private_path_service_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}], "total_count": 132}' responses.add( - responses.POST, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) # Set up parameter values - private_path_service_gateway_id = 'testString' + start = 'testString' + limit = 50 + resource_group_id = 'testString' # Invoke method - response = _service.publish_private_path_service_gateway( - private_path_service_gateway_id, + response = _service.list_private_path_service_gateways( + start=start, + limit=limit, + resource_group_id=resource_group_id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string - def test_publish_private_path_service_gateway_all_params_with_retries(self): - # Enable retries and run test_publish_private_path_service_gateway_all_params. + def test_list_private_path_service_gateways_all_params_with_retries(self): + # Enable retries and run test_list_private_path_service_gateways_all_params. _service.enable_retries() - self.test_publish_private_path_service_gateway_all_params() + self.test_list_private_path_service_gateways_all_params() - # Disable retries and run test_publish_private_path_service_gateway_all_params. + # Disable retries and run test_list_private_path_service_gateways_all_params. _service.disable_retries() - self.test_publish_private_path_service_gateway_all_params() + self.test_list_private_path_service_gateways_all_params() @responses.activate - def test_publish_private_path_service_gateway_value_error(self): + def test_list_private_path_service_gateways_required_params(self): """ - test_publish_private_path_service_gateway_value_error() + test_list_private_path_service_gateways_required_params() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/publish') + url = preprocess_url('/private_path_service_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "private_path_service_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}], "total_count": 132}' responses.add( - responses.POST, + responses.GET, url, - status=204, + body=mock_response, + content_type='application/json', + status=200, ) - # Set up parameter values - private_path_service_gateway_id = 'testString' + # Invoke method + response = _service.list_private_path_service_gateways() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_private_path_service_gateways_required_params_with_retries(self): + # Enable retries and run test_list_private_path_service_gateways_required_params. + _service.enable_retries() + self.test_list_private_path_service_gateways_required_params() + + # Disable retries and run test_list_private_path_service_gateways_required_params. + _service.disable_retries() + self.test_list_private_path_service_gateways_required_params() + + @responses.activate + def test_list_private_path_service_gateways_value_error(self): + """ + test_list_private_path_service_gateways_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways') + mock_response = '{"first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "private_path_service_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_gateway_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.publish_private_path_service_gateway(**req_copy) + _service.list_private_path_service_gateways(**req_copy) - def test_publish_private_path_service_gateway_value_error_with_retries(self): - # Enable retries and run test_publish_private_path_service_gateway_value_error. + def test_list_private_path_service_gateways_value_error_with_retries(self): + # Enable retries and run test_list_private_path_service_gateways_value_error. _service.enable_retries() - self.test_publish_private_path_service_gateway_value_error() + self.test_list_private_path_service_gateways_value_error() - # Disable retries and run test_publish_private_path_service_gateway_value_error. + # Disable retries and run test_list_private_path_service_gateways_value_error. _service.disable_retries() - self.test_publish_private_path_service_gateway_value_error() + self.test_list_private_path_service_gateways_value_error() + @responses.activate + def test_list_private_path_service_gateways_with_pager_get_next(self): + """ + test_list_private_path_service_gateways_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/private_path_service_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":true}],"total_count":2,"limit":1}' + mock_response2 = '{"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":true}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) -class TestRevokeAccountForPrivatePathServiceGateway: + # Exercise the pager class for this operation + all_results = [] + pager = PrivatePathServiceGatewaysPager( + client=_service, + limit=10, + resource_group_id='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_private_path_service_gateways_with_pager_get_all(self): + """ + test_list_private_path_service_gateways_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/private_path_service_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":true}],"total_count":2,"limit":1}' + mock_response2 = '{"private_path_service_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213","default_access_policy":"deny","endpoint_gateway_binding_auto_delete":true,"endpoint_gateway_binding_auto_delete_timeout":1,"endpoint_gateway_count":0,"href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213","id":"r134-fb880975-db45-4459-8548-64e3995ac213","lifecycle_state":"stable","load_balancer":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","name":"my-load-balancer","resource_type":"load_balancer"},"name":"my-private-path-service-gateway","published":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"private_path_service_gateway","service_endpoints":["*.example.com"],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zonal_affinity":true}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = PrivatePathServiceGatewaysPager( + client=_service, + limit=10, + resource_group_id='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreatePrivatePathServiceGateway: """ - Test Class for revoke_account_for_private_path_service_gateway + Test Class for create_private_path_service_gateway """ @responses.activate - def test_revoke_account_for_private_path_service_gateway_all_params(self): + def test_create_private_path_service_gateway_all_params(self): """ - revoke_account_for_private_path_service_gateway() + create_private_path_service_gateway() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/revoke_account') + url = preprocess_url('/private_path_service_gateways') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' responses.add( responses.POST, url, - status=204, + body=mock_response, + content_type='application/json', + status=201, ) - # Construct a dict representation of a AccountIdentityById model - account_identity_model = {} - account_identity_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + # Construct a dict representation of a LoadBalancerIdentityById model + load_balancer_identity_model = {} + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - private_path_service_gateway_id = 'testString' - account = account_identity_model + load_balancer = load_balancer_identity_model + service_endpoints = ['*.example.com'] + default_access_policy = 'deny' + name = 'my-private-path-service-gateway' + resource_group = resource_group_identity_model + zonal_affinity = False # Invoke method - response = _service.revoke_account_for_private_path_service_gateway( - private_path_service_gateway_id, - account, + response = _service.create_private_path_service_gateway( + load_balancer, + service_endpoints, + default_access_policy=default_access_policy, + name=name, + resource_group=resource_group, + zonal_affinity=zonal_affinity, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['account'] == account_identity_model + assert req_body['load_balancer'] == load_balancer_identity_model + assert req_body['service_endpoints'] == ['*.example.com'] + assert req_body['default_access_policy'] == 'deny' + assert req_body['name'] == 'my-private-path-service-gateway' + assert req_body['resource_group'] == resource_group_identity_model + assert req_body['zonal_affinity'] == False - def test_revoke_account_for_private_path_service_gateway_all_params_with_retries(self): - # Enable retries and run test_revoke_account_for_private_path_service_gateway_all_params. + def test_create_private_path_service_gateway_all_params_with_retries(self): + # Enable retries and run test_create_private_path_service_gateway_all_params. _service.enable_retries() - self.test_revoke_account_for_private_path_service_gateway_all_params() + self.test_create_private_path_service_gateway_all_params() - # Disable retries and run test_revoke_account_for_private_path_service_gateway_all_params. + # Disable retries and run test_create_private_path_service_gateway_all_params. _service.disable_retries() - self.test_revoke_account_for_private_path_service_gateway_all_params() + self.test_create_private_path_service_gateway_all_params() @responses.activate - def test_revoke_account_for_private_path_service_gateway_value_error(self): + def test_create_private_path_service_gateway_value_error(self): """ - test_revoke_account_for_private_path_service_gateway_value_error() + test_create_private_path_service_gateway_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/revoke_account') + url = preprocess_url('/private_path_service_gateways') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' responses.add( responses.POST, url, - status=204, + body=mock_response, + content_type='application/json', + status=201, ) - # Construct a dict representation of a AccountIdentityById model - account_identity_model = {} - account_identity_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + # Construct a dict representation of a LoadBalancerIdentityById model + load_balancer_identity_model = {} + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - private_path_service_gateway_id = 'testString' - account = account_identity_model + load_balancer = load_balancer_identity_model + service_endpoints = ['*.example.com'] + default_access_policy = 'deny' + name = 'my-private-path-service-gateway' + resource_group = resource_group_identity_model + zonal_affinity = False # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_gateway_id, - "account": account, + "load_balancer": load_balancer, + "service_endpoints": service_endpoints, } 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.revoke_account_for_private_path_service_gateway(**req_copy) + _service.create_private_path_service_gateway(**req_copy) - def test_revoke_account_for_private_path_service_gateway_value_error_with_retries(self): - # Enable retries and run test_revoke_account_for_private_path_service_gateway_value_error. + def test_create_private_path_service_gateway_value_error_with_retries(self): + # Enable retries and run test_create_private_path_service_gateway_value_error. _service.enable_retries() - self.test_revoke_account_for_private_path_service_gateway_value_error() + self.test_create_private_path_service_gateway_value_error() - # Disable retries and run test_revoke_account_for_private_path_service_gateway_value_error. + # Disable retries and run test_create_private_path_service_gateway_value_error. _service.disable_retries() - self.test_revoke_account_for_private_path_service_gateway_value_error() + self.test_create_private_path_service_gateway_value_error() -class TestUnpublishPrivatePathServiceGateway: +class TestDeletePrivatePathServiceGateway: """ - Test Class for unpublish_private_path_service_gateway + Test Class for delete_private_path_service_gateway """ @responses.activate - def test_unpublish_private_path_service_gateway_all_params(self): + def test_delete_private_path_service_gateway_all_params(self): """ - unpublish_private_path_service_gateway() + delete_private_path_service_gateway() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/unpublish') + url = preprocess_url('/private_path_service_gateways/testString') responses.add( - responses.POST, + responses.DELETE, url, status=204, ) # Set up parameter values - private_path_service_gateway_id = 'testString' + id = 'testString' # Invoke method - response = _service.unpublish_private_path_service_gateway( - private_path_service_gateway_id, + response = _service.delete_private_path_service_gateway( + id, headers={}, ) @@ -49708,111 +51978,1647 @@ def test_unpublish_private_path_service_gateway_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 204 - def test_unpublish_private_path_service_gateway_all_params_with_retries(self): - # Enable retries and run test_unpublish_private_path_service_gateway_all_params. + def test_delete_private_path_service_gateway_all_params_with_retries(self): + # Enable retries and run test_delete_private_path_service_gateway_all_params. _service.enable_retries() - self.test_unpublish_private_path_service_gateway_all_params() + self.test_delete_private_path_service_gateway_all_params() - # Disable retries and run test_unpublish_private_path_service_gateway_all_params. + # Disable retries and run test_delete_private_path_service_gateway_all_params. _service.disable_retries() - self.test_unpublish_private_path_service_gateway_all_params() + self.test_delete_private_path_service_gateway_all_params() @responses.activate - def test_unpublish_private_path_service_gateway_value_error(self): + def test_delete_private_path_service_gateway_value_error(self): """ - test_unpublish_private_path_service_gateway_value_error() + test_delete_private_path_service_gateway_value_error() """ # Set up mock - url = preprocess_url('/private_path_service_gateways/testString/unpublish') + url = preprocess_url('/private_path_service_gateways/testString') responses.add( - responses.POST, + responses.DELETE, url, status=204, ) # Set up parameter values - private_path_service_gateway_id = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "private_path_service_gateway_id": private_path_service_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.unpublish_private_path_service_gateway(**req_copy) + _service.delete_private_path_service_gateway(**req_copy) - def test_unpublish_private_path_service_gateway_value_error_with_retries(self): - # Enable retries and run test_unpublish_private_path_service_gateway_value_error. + def test_delete_private_path_service_gateway_value_error_with_retries(self): + # Enable retries and run test_delete_private_path_service_gateway_value_error. _service.enable_retries() - self.test_unpublish_private_path_service_gateway_value_error() + self.test_delete_private_path_service_gateway_value_error() - # Disable retries and run test_unpublish_private_path_service_gateway_value_error. + # Disable retries and run test_delete_private_path_service_gateway_value_error. _service.disable_retries() - self.test_unpublish_private_path_service_gateway_value_error() + self.test_delete_private_path_service_gateway_value_error() -# endregion -############################################################################## -# End of Service: PrivatePathServiceGateways -############################################################################## +class TestGetPrivatePathServiceGateway: + """ + Test Class for get_private_path_service_gateway + """ + + @responses.activate + def test_get_private_path_service_gateway_all_params(self): + """ + get_private_path_service_gateway() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + # Set up parameter values + id = 'testString' -############################################################################## -# Start of Model Tests -############################################################################## -# region + # Invoke method + response = _service.get_private_path_service_gateway( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + def test_get_private_path_service_gateway_all_params_with_retries(self): + # Enable retries and run test_get_private_path_service_gateway_all_params. + _service.enable_retries() + self.test_get_private_path_service_gateway_all_params() -class TestModel_AccountReference: - """ - Test Class for AccountReference - """ + # Disable retries and run test_get_private_path_service_gateway_all_params. + _service.disable_retries() + self.test_get_private_path_service_gateway_all_params() - def test_account_reference_serialization(self): + @responses.activate + def test_get_private_path_service_gateway_value_error(self): """ - Test serialization/deserialization for AccountReference + test_get_private_path_service_gateway_value_error() """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) - # Construct a json representation of a AccountReference model - account_reference_model_json = {} - account_reference_model_json['id'] = 'bb1b52262f7441a586f49068482f1e60' - account_reference_model_json['resource_type'] = 'account' - - # Construct a model instance of AccountReference by calling from_dict on the json representation - account_reference_model = AccountReference.from_dict(account_reference_model_json) - assert account_reference_model != False + # Set up parameter values + id = 'testString' - # Construct a model instance of AccountReference by calling from_dict on the json representation - account_reference_model_dict = AccountReference.from_dict(account_reference_model_json).__dict__ - account_reference_model2 = AccountReference(**account_reference_model_dict) + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_private_path_service_gateway(**req_copy) - # Verify the model instances are equivalent - assert account_reference_model == account_reference_model2 + def test_get_private_path_service_gateway_value_error_with_retries(self): + # Enable retries and run test_get_private_path_service_gateway_value_error. + _service.enable_retries() + self.test_get_private_path_service_gateway_value_error() - # Convert model instance back to dict and verify no loss of data - account_reference_model_json2 = account_reference_model.to_dict() - assert account_reference_model_json2 == account_reference_model_json + # Disable retries and run test_get_private_path_service_gateway_value_error. + _service.disable_retries() + self.test_get_private_path_service_gateway_value_error() -class TestModel_AddressPrefix: +class TestUpdatePrivatePathServiceGateway: """ - Test Class for AddressPrefix + Test Class for update_private_path_service_gateway """ - def test_address_prefix_serialization(self): + @responses.activate + def test_update_private_path_service_gateway_all_params(self): """ - Test serialization/deserialization for AddressPrefix + update_private_path_service_gateway() """ - - # Construct dict forms of any model objects needed in order to build this model. - - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' - zone_reference_model['name'] = 'us-south-1' - - # Construct a json representation of a AddressPrefix model - address_prefix_model_json = {} + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a LoadBalancerIdentityById model + load_balancer_identity_model = {} + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + + # Construct a dict representation of a PrivatePathServiceGatewayPatch model + private_path_service_gateway_patch_model = {} + private_path_service_gateway_patch_model['default_access_policy'] = 'deny' + private_path_service_gateway_patch_model['load_balancer'] = load_balancer_identity_model + private_path_service_gateway_patch_model['name'] = 'my-private-path-service-gateway' + private_path_service_gateway_patch_model['zonal_affinity'] = True + + # Set up parameter values + id = 'testString' + private_path_service_gateway_patch = private_path_service_gateway_patch_model + + # Invoke method + response = _service.update_private_path_service_gateway( + id, + private_path_service_gateway_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == private_path_service_gateway_patch + + def test_update_private_path_service_gateway_all_params_with_retries(self): + # Enable retries and run test_update_private_path_service_gateway_all_params. + _service.enable_retries() + self.test_update_private_path_service_gateway_all_params() + + # Disable retries and run test_update_private_path_service_gateway_all_params. + _service.disable_retries() + self.test_update_private_path_service_gateway_all_params() + + @responses.activate + def test_update_private_path_service_gateway_value_error(self): + """ + test_update_private_path_service_gateway_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString') + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r134-fb880975-db45-4459-8548-64e3995ac213", "default_access_policy": "deny", "endpoint_gateway_binding_auto_delete": true, "endpoint_gateway_binding_auto_delete_timeout": 1, "endpoint_gateway_count": 0, "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "lifecycle_state": "stable", "load_balancer": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "name": "my-load-balancer", "resource_type": "load_balancer"}, "name": "my-private-path-service-gateway", "published": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "private_path_service_gateway", "service_endpoints": ["*.example.com"], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zonal_affinity": true}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a LoadBalancerIdentityById model + load_balancer_identity_model = {} + load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + + # Construct a dict representation of a PrivatePathServiceGatewayPatch model + private_path_service_gateway_patch_model = {} + private_path_service_gateway_patch_model['default_access_policy'] = 'deny' + private_path_service_gateway_patch_model['load_balancer'] = load_balancer_identity_model + private_path_service_gateway_patch_model['name'] = 'my-private-path-service-gateway' + private_path_service_gateway_patch_model['zonal_affinity'] = True + + # Set up parameter values + id = 'testString' + private_path_service_gateway_patch = private_path_service_gateway_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + "private_path_service_gateway_patch": private_path_service_gateway_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_private_path_service_gateway(**req_copy) + + def test_update_private_path_service_gateway_value_error_with_retries(self): + # Enable retries and run test_update_private_path_service_gateway_value_error. + _service.enable_retries() + self.test_update_private_path_service_gateway_value_error() + + # Disable retries and run test_update_private_path_service_gateway_value_error. + _service.disable_retries() + self.test_update_private_path_service_gateway_value_error() + + +class TestListPrivatePathServiceGatewayAccountPolicies: + """ + Test Class for list_private_path_service_gateway_account_policies + """ + + @responses.activate + def test_list_private_path_service_gateway_account_policies_all_params(self): + """ + list_private_path_service_gateway_account_policies() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies') + mock_response = '{"account_policies": [{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + start = 'testString' + limit = 50 + account_id = 'bb1b52262f7441a586f49068482f1e60' + + # Invoke method + response = _service.list_private_path_service_gateway_account_policies( + private_path_service_gateway_id, + start=start, + limit=limit, + account_id=account_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'account.id={}'.format(account_id) in query_string + + def test_list_private_path_service_gateway_account_policies_all_params_with_retries(self): + # Enable retries and run test_list_private_path_service_gateway_account_policies_all_params. + _service.enable_retries() + self.test_list_private_path_service_gateway_account_policies_all_params() + + # Disable retries and run test_list_private_path_service_gateway_account_policies_all_params. + _service.disable_retries() + self.test_list_private_path_service_gateway_account_policies_all_params() + + @responses.activate + def test_list_private_path_service_gateway_account_policies_required_params(self): + """ + test_list_private_path_service_gateway_account_policies_required_params() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies') + mock_response = '{"account_policies": [{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + + # Invoke method + response = _service.list_private_path_service_gateway_account_policies( + private_path_service_gateway_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_private_path_service_gateway_account_policies_required_params_with_retries(self): + # Enable retries and run test_list_private_path_service_gateway_account_policies_required_params. + _service.enable_retries() + self.test_list_private_path_service_gateway_account_policies_required_params() + + # Disable retries and run test_list_private_path_service_gateway_account_policies_required_params. + _service.disable_retries() + self.test_list_private_path_service_gateway_account_policies_required_params() + + @responses.activate + def test_list_private_path_service_gateway_account_policies_value_error(self): + """ + test_list_private_path_service_gateway_account_policies_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies') + mock_response = '{"account_policies": [{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_gateway_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.list_private_path_service_gateway_account_policies(**req_copy) + + def test_list_private_path_service_gateway_account_policies_value_error_with_retries(self): + # Enable retries and run test_list_private_path_service_gateway_account_policies_value_error. + _service.enable_retries() + self.test_list_private_path_service_gateway_account_policies_value_error() + + # Disable retries and run test_list_private_path_service_gateway_account_policies_value_error. + _service.disable_retries() + self.test_list_private_path_service_gateway_account_policies_value_error() + + @responses.activate + def test_list_private_path_service_gateway_account_policies_with_pager_get_next(self): + """ + test_list_private_path_service_gateway_account_policies_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/private_path_service_gateways/testString/account_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r134-fb880975-db45-4459-8548-64e3995ac213","resource_type":"private_path_service_gateway_account_policy"}]}' + mock_response2 = '{"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r134-fb880975-db45-4459-8548-64e3995ac213","resource_type":"private_path_service_gateway_account_policy"}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + all_results = [] + pager = PrivatePathServiceGatewayAccountPoliciesPager( + client=_service, + private_path_service_gateway_id='testString', + limit=10, + account_id='bb1b52262f7441a586f49068482f1e60', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_private_path_service_gateway_account_policies_with_pager_get_all(self): + """ + test_list_private_path_service_gateway_account_policies_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/private_path_service_gateways/testString/account_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r134-fb880975-db45-4459-8548-64e3995ac213","resource_type":"private_path_service_gateway_account_policy"}]}' + mock_response2 = '{"total_count":2,"limit":1,"account_policies":[{"access_policy":"deny","account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c","id":"r134-fb880975-db45-4459-8548-64e3995ac213","resource_type":"private_path_service_gateway_account_policy"}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = PrivatePathServiceGatewayAccountPoliciesPager( + client=_service, + private_path_service_gateway_id='testString', + limit=10, + account_id='bb1b52262f7441a586f49068482f1e60', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreatePrivatePathServiceGatewayAccountPolicy: + """ + Test Class for create_private_path_service_gateway_account_policy + """ + + @responses.activate + def test_create_private_path_service_gateway_account_policy_all_params(self): + """ + create_private_path_service_gateway_account_policy() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies') + mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a AccountIdentityById model + account_identity_model = {} + account_identity_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + + # Set up parameter values + private_path_service_gateway_id = 'testString' + access_policy = 'deny' + account = account_identity_model + + # Invoke method + response = _service.create_private_path_service_gateway_account_policy( + private_path_service_gateway_id, + access_policy, + account, + 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['access_policy'] == 'deny' + assert req_body['account'] == account_identity_model + + def test_create_private_path_service_gateway_account_policy_all_params_with_retries(self): + # Enable retries and run test_create_private_path_service_gateway_account_policy_all_params. + _service.enable_retries() + self.test_create_private_path_service_gateway_account_policy_all_params() + + # Disable retries and run test_create_private_path_service_gateway_account_policy_all_params. + _service.disable_retries() + self.test_create_private_path_service_gateway_account_policy_all_params() + + @responses.activate + def test_create_private_path_service_gateway_account_policy_value_error(self): + """ + test_create_private_path_service_gateway_account_policy_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies') + mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a AccountIdentityById model + account_identity_model = {} + account_identity_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + + # Set up parameter values + private_path_service_gateway_id = 'testString' + access_policy = 'deny' + account = account_identity_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_gateway_id, + "access_policy": access_policy, + "account": account, + } + 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_private_path_service_gateway_account_policy(**req_copy) + + def test_create_private_path_service_gateway_account_policy_value_error_with_retries(self): + # Enable retries and run test_create_private_path_service_gateway_account_policy_value_error. + _service.enable_retries() + self.test_create_private_path_service_gateway_account_policy_value_error() + + # Disable retries and run test_create_private_path_service_gateway_account_policy_value_error. + _service.disable_retries() + self.test_create_private_path_service_gateway_account_policy_value_error() + + +class TestDeletePrivatePathServiceGatewayAccountPolicy: + """ + Test Class for delete_private_path_service_gateway_account_policy + """ + + @responses.activate + def test_delete_private_path_service_gateway_account_policy_all_params(self): + """ + delete_private_path_service_gateway_account_policy() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.delete_private_path_service_gateway_account_policy( + private_path_service_gateway_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_delete_private_path_service_gateway_account_policy_all_params_with_retries(self): + # Enable retries and run test_delete_private_path_service_gateway_account_policy_all_params. + _service.enable_retries() + self.test_delete_private_path_service_gateway_account_policy_all_params() + + # Disable retries and run test_delete_private_path_service_gateway_account_policy_all_params. + _service.disable_retries() + self.test_delete_private_path_service_gateway_account_policy_all_params() + + @responses.activate + def test_delete_private_path_service_gateway_account_policy_value_error(self): + """ + test_delete_private_path_service_gateway_account_policy_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') + responses.add( + responses.DELETE, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_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.delete_private_path_service_gateway_account_policy(**req_copy) + + def test_delete_private_path_service_gateway_account_policy_value_error_with_retries(self): + # Enable retries and run test_delete_private_path_service_gateway_account_policy_value_error. + _service.enable_retries() + self.test_delete_private_path_service_gateway_account_policy_value_error() + + # Disable retries and run test_delete_private_path_service_gateway_account_policy_value_error. + _service.disable_retries() + self.test_delete_private_path_service_gateway_account_policy_value_error() + + +class TestGetPrivatePathServiceGatewayAccountPolicy: + """ + Test Class for get_private_path_service_gateway_account_policy + """ + + @responses.activate + def test_get_private_path_service_gateway_account_policy_all_params(self): + """ + get_private_path_service_gateway_account_policy() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') + mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_private_path_service_gateway_account_policy( + private_path_service_gateway_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_private_path_service_gateway_account_policy_all_params_with_retries(self): + # Enable retries and run test_get_private_path_service_gateway_account_policy_all_params. + _service.enable_retries() + self.test_get_private_path_service_gateway_account_policy_all_params() + + # Disable retries and run test_get_private_path_service_gateway_account_policy_all_params. + _service.disable_retries() + self.test_get_private_path_service_gateway_account_policy_all_params() + + @responses.activate + def test_get_private_path_service_gateway_account_policy_value_error(self): + """ + test_get_private_path_service_gateway_account_policy_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') + mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_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_private_path_service_gateway_account_policy(**req_copy) + + def test_get_private_path_service_gateway_account_policy_value_error_with_retries(self): + # Enable retries and run test_get_private_path_service_gateway_account_policy_value_error. + _service.enable_retries() + self.test_get_private_path_service_gateway_account_policy_value_error() + + # Disable retries and run test_get_private_path_service_gateway_account_policy_value_error. + _service.disable_retries() + self.test_get_private_path_service_gateway_account_policy_value_error() + + +class TestUpdatePrivatePathServiceGatewayAccountPolicy: + """ + Test Class for update_private_path_service_gateway_account_policy + """ + + @responses.activate + def test_update_private_path_service_gateway_account_policy_all_params(self): + """ + update_private_path_service_gateway_account_policy() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') + mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a PrivatePathServiceGatewayAccountPolicyPatch model + private_path_service_gateway_account_policy_patch_model = {} + private_path_service_gateway_account_policy_patch_model['access_policy'] = 'deny' + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + private_path_service_gateway_account_policy_patch = private_path_service_gateway_account_policy_patch_model + + # Invoke method + response = _service.update_private_path_service_gateway_account_policy( + private_path_service_gateway_id, + id, + private_path_service_gateway_account_policy_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == private_path_service_gateway_account_policy_patch + + def test_update_private_path_service_gateway_account_policy_all_params_with_retries(self): + # Enable retries and run test_update_private_path_service_gateway_account_policy_all_params. + _service.enable_retries() + self.test_update_private_path_service_gateway_account_policy_all_params() + + # Disable retries and run test_update_private_path_service_gateway_account_policy_all_params. + _service.disable_retries() + self.test_update_private_path_service_gateway_account_policy_all_params() + + @responses.activate + def test_update_private_path_service_gateway_account_policy_value_error(self): + """ + test_update_private_path_service_gateway_account_policy_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/account_policies/testString') + mock_response = '{"access_policy": "deny", "account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/account_policies/dd455384-b019-4242-9453-45fe68b18e4c", "id": "r134-fb880975-db45-4459-8548-64e3995ac213", "resource_type": "private_path_service_gateway_account_policy"}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a PrivatePathServiceGatewayAccountPolicyPatch model + private_path_service_gateway_account_policy_patch_model = {} + private_path_service_gateway_account_policy_patch_model['access_policy'] = 'deny' + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + private_path_service_gateway_account_policy_patch = private_path_service_gateway_account_policy_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_gateway_id, + "id": id, + "private_path_service_gateway_account_policy_patch": private_path_service_gateway_account_policy_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_private_path_service_gateway_account_policy(**req_copy) + + def test_update_private_path_service_gateway_account_policy_value_error_with_retries(self): + # Enable retries and run test_update_private_path_service_gateway_account_policy_value_error. + _service.enable_retries() + self.test_update_private_path_service_gateway_account_policy_value_error() + + # Disable retries and run test_update_private_path_service_gateway_account_policy_value_error. + _service.disable_retries() + self.test_update_private_path_service_gateway_account_policy_value_error() + + +class TestListPrivatePathServiceGatewayEndpointGatewayBindings: + """ + Test Class for list_private_path_service_gateway_endpoint_gateway_bindings + """ + + @responses.activate + def test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params(self): + """ + list_private_path_service_gateway_endpoint_gateway_bindings() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') + mock_response = '{"endpoint_gateway_bindings": [{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + start = 'testString' + limit = 50 + status = 'abandoned' + account_id = 'bb1b52262f7441a586f49068482f1e60' + + # Invoke method + response = _service.list_private_path_service_gateway_endpoint_gateway_bindings( + private_path_service_gateway_id, + start=start, + limit=limit, + status=status, + account_id=account_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'status={}'.format(status) in query_string + assert 'account.id={}'.format(account_id) in query_string + + def test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params_with_retries(self): + # Enable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params. + _service.enable_retries() + self.test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params() + + # Disable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params. + _service.disable_retries() + self.test_list_private_path_service_gateway_endpoint_gateway_bindings_all_params() + + @responses.activate + def test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params(self): + """ + test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') + mock_response = '{"endpoint_gateway_bindings": [{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + + # Invoke method + response = _service.list_private_path_service_gateway_endpoint_gateway_bindings( + private_path_service_gateway_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params_with_retries(self): + # Enable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params. + _service.enable_retries() + self.test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params() + + # Disable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params. + _service.disable_retries() + self.test_list_private_path_service_gateway_endpoint_gateway_bindings_required_params() + + @responses.activate + def test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error(self): + """ + test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') + mock_response = '{"endpoint_gateway_bindings": [{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}], "first": {"href": "href"}, "limit": 20, "next": {"href": "href"}, "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_gateway_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.list_private_path_service_gateway_endpoint_gateway_bindings(**req_copy) + + def test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error_with_retries(self): + # Enable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error. + _service.enable_retries() + self.test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error() + + # Disable retries and run test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error. + _service.disable_retries() + self.test_list_private_path_service_gateway_endpoint_gateway_bindings_value_error() + + @responses.activate + def test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_get_next(self): + """ + test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}' + mock_response2 = '{"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + all_results = [] + pager = PrivatePathServiceGatewayEndpointGatewayBindingsPager( + client=_service, + private_path_service_gateway_id='testString', + limit=10, + status='abandoned', + account_id='bb1b52262f7441a586f49068482f1e60', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_get_all(self): + """ + test_list_private_path_service_gateway_endpoint_gateway_bindings_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}' + mock_response2 = '{"total_count":2,"limit":1,"endpoint_gateway_bindings":[{"account":{"id":"bb1b52262f7441a586f49068482f1e60","resource_type":"account"},"created_at":"2019-01-01T12:00:00.000Z","expiration_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f","id":"r134-ce9dac18-dea0-4392-841c-142d3300674f","lifecycle_state":"stable","resource_type":"private_path_service_gateway_endpoint_gateway_binding","status":"abandoned"}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = PrivatePathServiceGatewayEndpointGatewayBindingsPager( + client=_service, + private_path_service_gateway_id='testString', + limit=10, + status='abandoned', + account_id='bb1b52262f7441a586f49068482f1e60', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestGetPrivatePathServiceGatewayEndpointGatewayBinding: + """ + Test Class for get_private_path_service_gateway_endpoint_gateway_binding + """ + + @responses.activate + def test_get_private_path_service_gateway_endpoint_gateway_binding_all_params(self): + """ + get_private_path_service_gateway_endpoint_gateway_binding() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString') + mock_response = '{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_private_path_service_gateway_endpoint_gateway_binding( + private_path_service_gateway_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_private_path_service_gateway_endpoint_gateway_binding_all_params_with_retries(self): + # Enable retries and run test_get_private_path_service_gateway_endpoint_gateway_binding_all_params. + _service.enable_retries() + self.test_get_private_path_service_gateway_endpoint_gateway_binding_all_params() + + # Disable retries and run test_get_private_path_service_gateway_endpoint_gateway_binding_all_params. + _service.disable_retries() + self.test_get_private_path_service_gateway_endpoint_gateway_binding_all_params() + + @responses.activate + def test_get_private_path_service_gateway_endpoint_gateway_binding_value_error(self): + """ + test_get_private_path_service_gateway_endpoint_gateway_binding_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString') + mock_response = '{"account": {"id": "bb1b52262f7441a586f49068482f1e60", "resource_type": "account"}, "created_at": "2019-01-01T12:00:00.000Z", "expiration_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r134-fb880975-db45-4459-8548-64e3995ac213/endpoint_gateway_bindings/r134-ce9dac18-dea0-4392-841c-142d3300674f", "id": "r134-ce9dac18-dea0-4392-841c-142d3300674f", "lifecycle_state": "stable", "resource_type": "private_path_service_gateway_endpoint_gateway_binding", "status": "abandoned"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_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_private_path_service_gateway_endpoint_gateway_binding(**req_copy) + + def test_get_private_path_service_gateway_endpoint_gateway_binding_value_error_with_retries(self): + # Enable retries and run test_get_private_path_service_gateway_endpoint_gateway_binding_value_error. + _service.enable_retries() + self.test_get_private_path_service_gateway_endpoint_gateway_binding_value_error() + + # Disable retries and run test_get_private_path_service_gateway_endpoint_gateway_binding_value_error. + _service.disable_retries() + self.test_get_private_path_service_gateway_endpoint_gateway_binding_value_error() + + +class TestDenyPrivatePathServiceGatewayEndpointGatewayBinding: + """ + Test Class for deny_private_path_service_gateway_endpoint_gateway_binding + """ + + @responses.activate + def test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params(self): + """ + deny_private_path_service_gateway_endpoint_gateway_binding() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + set_account_policy = True + + # Invoke method + response = _service.deny_private_path_service_gateway_endpoint_gateway_binding( + private_path_service_gateway_id, + id, + set_account_policy=set_account_policy, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['set_account_policy'] == True + + def test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params_with_retries(self): + # Enable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params. + _service.enable_retries() + self.test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params() + + # Disable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params. + _service.disable_retries() + self.test_deny_private_path_service_gateway_endpoint_gateway_binding_all_params() + + @responses.activate + def test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params(self): + """ + test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.deny_private_path_service_gateway_endpoint_gateway_binding( + private_path_service_gateway_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params_with_retries(self): + # Enable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params. + _service.enable_retries() + self.test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params() + + # Disable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params. + _service.disable_retries() + self.test_deny_private_path_service_gateway_endpoint_gateway_binding_required_params() + + @responses.activate + def test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error(self): + """ + test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_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.deny_private_path_service_gateway_endpoint_gateway_binding(**req_copy) + + def test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error_with_retries(self): + # Enable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error. + _service.enable_retries() + self.test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error() + + # Disable retries and run test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error. + _service.disable_retries() + self.test_deny_private_path_service_gateway_endpoint_gateway_binding_value_error() + + +class TestPermitPrivatePathServiceGatewayEndpointGatewayBinding: + """ + Test Class for permit_private_path_service_gateway_endpoint_gateway_binding + """ + + @responses.activate + def test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params(self): + """ + permit_private_path_service_gateway_endpoint_gateway_binding() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + set_account_policy = True + + # Invoke method + response = _service.permit_private_path_service_gateway_endpoint_gateway_binding( + private_path_service_gateway_id, + id, + set_account_policy=set_account_policy, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['set_account_policy'] == True + + def test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params_with_retries(self): + # Enable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params. + _service.enable_retries() + self.test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params() + + # Disable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params. + _service.disable_retries() + self.test_permit_private_path_service_gateway_endpoint_gateway_binding_all_params() + + @responses.activate + def test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params(self): + """ + test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.permit_private_path_service_gateway_endpoint_gateway_binding( + private_path_service_gateway_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params_with_retries(self): + # Enable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params. + _service.enable_retries() + self.test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params() + + # Disable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params. + _service.disable_retries() + self.test_permit_private_path_service_gateway_endpoint_gateway_binding_required_params() + + @responses.activate + def test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error(self): + """ + test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_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.permit_private_path_service_gateway_endpoint_gateway_binding(**req_copy) + + def test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error_with_retries(self): + # Enable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error. + _service.enable_retries() + self.test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error() + + # Disable retries and run test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error. + _service.disable_retries() + self.test_permit_private_path_service_gateway_endpoint_gateway_binding_value_error() + + +class TestPublishPrivatePathServiceGateway: + """ + Test Class for publish_private_path_service_gateway + """ + + @responses.activate + def test_publish_private_path_service_gateway_all_params(self): + """ + publish_private_path_service_gateway() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/publish') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + + # Invoke method + response = _service.publish_private_path_service_gateway( + private_path_service_gateway_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_publish_private_path_service_gateway_all_params_with_retries(self): + # Enable retries and run test_publish_private_path_service_gateway_all_params. + _service.enable_retries() + self.test_publish_private_path_service_gateway_all_params() + + # Disable retries and run test_publish_private_path_service_gateway_all_params. + _service.disable_retries() + self.test_publish_private_path_service_gateway_all_params() + + @responses.activate + def test_publish_private_path_service_gateway_value_error(self): + """ + test_publish_private_path_service_gateway_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/publish') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_gateway_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.publish_private_path_service_gateway(**req_copy) + + def test_publish_private_path_service_gateway_value_error_with_retries(self): + # Enable retries and run test_publish_private_path_service_gateway_value_error. + _service.enable_retries() + self.test_publish_private_path_service_gateway_value_error() + + # Disable retries and run test_publish_private_path_service_gateway_value_error. + _service.disable_retries() + self.test_publish_private_path_service_gateway_value_error() + + +class TestRevokeAccountForPrivatePathServiceGateway: + """ + Test Class for revoke_account_for_private_path_service_gateway + """ + + @responses.activate + def test_revoke_account_for_private_path_service_gateway_all_params(self): + """ + revoke_account_for_private_path_service_gateway() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/revoke_account') + responses.add( + responses.POST, + url, + status=204, + ) + + # Construct a dict representation of a AccountIdentityById model + account_identity_model = {} + account_identity_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + + # Set up parameter values + private_path_service_gateway_id = 'testString' + account = account_identity_model + + # Invoke method + response = _service.revoke_account_for_private_path_service_gateway( + private_path_service_gateway_id, + account, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['account'] == account_identity_model + + def test_revoke_account_for_private_path_service_gateway_all_params_with_retries(self): + # Enable retries and run test_revoke_account_for_private_path_service_gateway_all_params. + _service.enable_retries() + self.test_revoke_account_for_private_path_service_gateway_all_params() + + # Disable retries and run test_revoke_account_for_private_path_service_gateway_all_params. + _service.disable_retries() + self.test_revoke_account_for_private_path_service_gateway_all_params() + + @responses.activate + def test_revoke_account_for_private_path_service_gateway_value_error(self): + """ + test_revoke_account_for_private_path_service_gateway_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/revoke_account') + responses.add( + responses.POST, + url, + status=204, + ) + + # Construct a dict representation of a AccountIdentityById model + account_identity_model = {} + account_identity_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + + # Set up parameter values + private_path_service_gateway_id = 'testString' + account = account_identity_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_gateway_id, + "account": account, + } + 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.revoke_account_for_private_path_service_gateway(**req_copy) + + def test_revoke_account_for_private_path_service_gateway_value_error_with_retries(self): + # Enable retries and run test_revoke_account_for_private_path_service_gateway_value_error. + _service.enable_retries() + self.test_revoke_account_for_private_path_service_gateway_value_error() + + # Disable retries and run test_revoke_account_for_private_path_service_gateway_value_error. + _service.disable_retries() + self.test_revoke_account_for_private_path_service_gateway_value_error() + + +class TestUnpublishPrivatePathServiceGateway: + """ + Test Class for unpublish_private_path_service_gateway + """ + + @responses.activate + def test_unpublish_private_path_service_gateway_all_params(self): + """ + unpublish_private_path_service_gateway() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/unpublish') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + + # Invoke method + response = _service.unpublish_private_path_service_gateway( + private_path_service_gateway_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_unpublish_private_path_service_gateway_all_params_with_retries(self): + # Enable retries and run test_unpublish_private_path_service_gateway_all_params. + _service.enable_retries() + self.test_unpublish_private_path_service_gateway_all_params() + + # Disable retries and run test_unpublish_private_path_service_gateway_all_params. + _service.disable_retries() + self.test_unpublish_private_path_service_gateway_all_params() + + @responses.activate + def test_unpublish_private_path_service_gateway_value_error(self): + """ + test_unpublish_private_path_service_gateway_value_error() + """ + # Set up mock + url = preprocess_url('/private_path_service_gateways/testString/unpublish') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + private_path_service_gateway_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "private_path_service_gateway_id": private_path_service_gateway_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.unpublish_private_path_service_gateway(**req_copy) + + def test_unpublish_private_path_service_gateway_value_error_with_retries(self): + # Enable retries and run test_unpublish_private_path_service_gateway_value_error. + _service.enable_retries() + self.test_unpublish_private_path_service_gateway_value_error() + + # Disable retries and run test_unpublish_private_path_service_gateway_value_error. + _service.disable_retries() + self.test_unpublish_private_path_service_gateway_value_error() + + +# endregion +############################################################################## +# End of Service: PrivatePathServiceGateways +############################################################################## + + +############################################################################## +# Start of Model Tests +############################################################################## +# region + + +class TestModel_AccountReference: + """ + Test Class for AccountReference + """ + + def test_account_reference_serialization(self): + """ + Test serialization/deserialization for AccountReference + """ + + # Construct a json representation of a AccountReference model + account_reference_model_json = {} + account_reference_model_json['id'] = 'bb1b52262f7441a586f49068482f1e60' + account_reference_model_json['resource_type'] = 'account' + + # Construct a model instance of AccountReference by calling from_dict on the json representation + account_reference_model = AccountReference.from_dict(account_reference_model_json) + assert account_reference_model != False + + # Construct a model instance of AccountReference by calling from_dict on the json representation + account_reference_model_dict = AccountReference.from_dict(account_reference_model_json).__dict__ + account_reference_model2 = AccountReference(**account_reference_model_dict) + + # Verify the model instances are equivalent + assert account_reference_model == account_reference_model2 + + # Convert model instance back to dict and verify no loss of data + account_reference_model_json2 = account_reference_model.to_dict() + assert account_reference_model_json2 == account_reference_model_json + + +class TestModel_AddressPrefix: + """ + Test Class for AddressPrefix + """ + + def test_address_prefix_serialization(self): + """ + Test serialization/deserialization for AddressPrefix + """ + + # Construct dict forms of any model objects needed in order to build this model. + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a AddressPrefix model + address_prefix_model_json = {} address_prefix_model_json['cidr'] = '192.168.3.0/24' address_prefix_model_json['created_at'] = '2019-01-01T12:00:00Z' address_prefix_model_json['has_subnets'] = True @@ -49822,30 +53628,502 @@ def test_address_prefix_serialization(self): address_prefix_model_json['name'] = 'my-address-prefix-1' address_prefix_model_json['zone'] = zone_reference_model - # Construct a model instance of AddressPrefix by calling from_dict on the json representation - address_prefix_model = AddressPrefix.from_dict(address_prefix_model_json) - assert address_prefix_model != False + # Construct a model instance of AddressPrefix by calling from_dict on the json representation + address_prefix_model = AddressPrefix.from_dict(address_prefix_model_json) + assert address_prefix_model != False + + # Construct a model instance of AddressPrefix by calling from_dict on the json representation + address_prefix_model_dict = AddressPrefix.from_dict(address_prefix_model_json).__dict__ + address_prefix_model2 = AddressPrefix(**address_prefix_model_dict) + + # Verify the model instances are equivalent + assert address_prefix_model == address_prefix_model2 + + # Convert model instance back to dict and verify no loss of data + address_prefix_model_json2 = address_prefix_model.to_dict() + assert address_prefix_model_json2 == address_prefix_model_json + + +class TestModel_AddressPrefixCollection: + """ + Test Class for AddressPrefixCollection + """ + + def test_address_prefix_collection_serialization(self): + """ + Test serialization/deserialization for AddressPrefixCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + address_prefix_model = {} # AddressPrefix + address_prefix_model['cidr'] = '192.168.3.0/24' + address_prefix_model['created_at'] = '2019-01-01T12:00:00Z' + address_prefix_model['has_subnets'] = True + address_prefix_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + address_prefix_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + address_prefix_model['is_default'] = False + address_prefix_model['name'] = 'my-address-prefix-1' + address_prefix_model['zone'] = zone_reference_model + + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20' + + # Construct a json representation of a AddressPrefixCollection model + address_prefix_collection_model_json = {} + address_prefix_collection_model_json['address_prefixes'] = [address_prefix_model] + address_prefix_collection_model_json['first'] = page_link_model + address_prefix_collection_model_json['limit'] = 20 + address_prefix_collection_model_json['next'] = page_link_model + address_prefix_collection_model_json['total_count'] = 132 + + # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation + address_prefix_collection_model = AddressPrefixCollection.from_dict(address_prefix_collection_model_json) + assert address_prefix_collection_model != False + + # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation + address_prefix_collection_model_dict = AddressPrefixCollection.from_dict(address_prefix_collection_model_json).__dict__ + address_prefix_collection_model2 = AddressPrefixCollection(**address_prefix_collection_model_dict) + + # Verify the model instances are equivalent + assert address_prefix_collection_model == address_prefix_collection_model2 + + # Convert model instance back to dict and verify no loss of data + address_prefix_collection_model_json2 = address_prefix_collection_model.to_dict() + assert address_prefix_collection_model_json2 == address_prefix_collection_model_json + + +class TestModel_AddressPrefixPatch: + """ + Test Class for AddressPrefixPatch + """ + + def test_address_prefix_patch_serialization(self): + """ + Test serialization/deserialization for AddressPrefixPatch + """ + + # Construct a json representation of a AddressPrefixPatch model + address_prefix_patch_model_json = {} + address_prefix_patch_model_json['is_default'] = False + address_prefix_patch_model_json['name'] = 'my-address-prefix-1' + + # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation + address_prefix_patch_model = AddressPrefixPatch.from_dict(address_prefix_patch_model_json) + assert address_prefix_patch_model != False - # Construct a model instance of AddressPrefix by calling from_dict on the json representation - address_prefix_model_dict = AddressPrefix.from_dict(address_prefix_model_json).__dict__ - address_prefix_model2 = AddressPrefix(**address_prefix_model_dict) + # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation + address_prefix_patch_model_dict = AddressPrefixPatch.from_dict(address_prefix_patch_model_json).__dict__ + address_prefix_patch_model2 = AddressPrefixPatch(**address_prefix_patch_model_dict) # Verify the model instances are equivalent - assert address_prefix_model == address_prefix_model2 + assert address_prefix_patch_model == address_prefix_patch_model2 # Convert model instance back to dict and verify no loss of data - address_prefix_model_json2 = address_prefix_model.to_dict() - assert address_prefix_model_json2 == address_prefix_model_json + address_prefix_patch_model_json2 = address_prefix_patch_model.to_dict() + assert address_prefix_patch_model_json2 == address_prefix_patch_model_json -class TestModel_AddressPrefixCollection: +class TestModel_BackupPolicyCollection: """ - Test Class for AddressPrefixCollection + Test Class for BackupPolicyCollection """ - def test_address_prefix_collection_serialization(self): + def test_backup_policy_collection_serialization(self): """ - Test serialization/deserialization for AddressPrefixCollection + Test serialization/deserialization for BackupPolicyCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + backup_policy_health_reason_model = {} # BackupPolicyHealthReason + backup_policy_health_reason_model['code'] = 'missing_service_authorization_policies' + backup_policy_health_reason_model['message'] = 'One or more accounts are missing service authorization policies' + backup_policy_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui' + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' + + backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote + backup_policy_plan_remote_model['region'] = region_reference_model + + backup_policy_plan_reference_model = {} # BackupPolicyPlanReference + backup_policy_plan_reference_model['deleted'] = deleted_model + backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['name'] = 'my-policy-plan' + backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model + backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['name'] = 'my-resource-group' + + backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference + backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce' + backup_policy_scope_model['id'] = 'ebc2b430240943458b9e91e1432cfcce' + backup_policy_scope_model['resource_type'] = 'enterprise' + + backup_policy_model = {} # BackupPolicyMatchResourceTypeInstance + backup_policy_model['created_at'] = '2019-01-01T12:00:00Z' + backup_policy_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6' + backup_policy_model['health_reasons'] = [backup_policy_health_reason_model] + backup_policy_model['health_state'] = 'ok' + backup_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6' + backup_policy_model['id'] = 'r134-076191ba-49c2-4763-94fd-c70de73ee2e6' + backup_policy_model['last_job_completed_at'] = '2019-01-01T12:00:00Z' + backup_policy_model['lifecycle_state'] = 'stable' + backup_policy_model['match_user_tags'] = ['my-daily-backup-policy'] + backup_policy_model['name'] = 'my-backup-policy' + backup_policy_model['plans'] = [backup_policy_plan_reference_model] + backup_policy_model['resource_group'] = resource_group_reference_model + backup_policy_model['resource_type'] = 'backup_policy' + backup_policy_model['scope'] = backup_policy_scope_model + backup_policy_model['included_content'] = ['data_volumes'] + backup_policy_model['match_resource_type'] = 'instance' + + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20' + + # Construct a json representation of a BackupPolicyCollection model + backup_policy_collection_model_json = {} + backup_policy_collection_model_json['backup_policies'] = [backup_policy_model] + backup_policy_collection_model_json['first'] = page_link_model + backup_policy_collection_model_json['limit'] = 20 + backup_policy_collection_model_json['next'] = page_link_model + backup_policy_collection_model_json['total_count'] = 132 + + # Construct a model instance of BackupPolicyCollection by calling from_dict on the json representation + backup_policy_collection_model = BackupPolicyCollection.from_dict(backup_policy_collection_model_json) + assert backup_policy_collection_model != False + + # Construct a model instance of BackupPolicyCollection by calling from_dict on the json representation + backup_policy_collection_model_dict = BackupPolicyCollection.from_dict(backup_policy_collection_model_json).__dict__ + backup_policy_collection_model2 = BackupPolicyCollection(**backup_policy_collection_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_collection_model == backup_policy_collection_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_collection_model_json2 = backup_policy_collection_model.to_dict() + assert backup_policy_collection_model_json2 == backup_policy_collection_model_json + + +class TestModel_BackupPolicyHealthReason: + """ + Test Class for BackupPolicyHealthReason + """ + + def test_backup_policy_health_reason_serialization(self): + """ + Test serialization/deserialization for BackupPolicyHealthReason + """ + + # Construct a json representation of a BackupPolicyHealthReason model + backup_policy_health_reason_model_json = {} + backup_policy_health_reason_model_json['code'] = 'missing_service_authorization_policies' + backup_policy_health_reason_model_json['message'] = 'One or more accounts are missing service authorization policies' + backup_policy_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui' + + # Construct a model instance of BackupPolicyHealthReason by calling from_dict on the json representation + backup_policy_health_reason_model = BackupPolicyHealthReason.from_dict(backup_policy_health_reason_model_json) + assert backup_policy_health_reason_model != False + + # Construct a model instance of BackupPolicyHealthReason by calling from_dict on the json representation + backup_policy_health_reason_model_dict = BackupPolicyHealthReason.from_dict(backup_policy_health_reason_model_json).__dict__ + backup_policy_health_reason_model2 = BackupPolicyHealthReason(**backup_policy_health_reason_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_health_reason_model == backup_policy_health_reason_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_health_reason_model_json2 = backup_policy_health_reason_model.to_dict() + assert backup_policy_health_reason_model_json2 == backup_policy_health_reason_model_json + + +class TestModel_BackupPolicyJob: + """ + Test Class for BackupPolicyJob + """ + + def test_backup_policy_job_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJob + """ + + # Construct dict forms of any model objects needed in order to build this model. + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' + + backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote + backup_policy_plan_remote_model['region'] = region_reference_model + + backup_policy_plan_reference_model = {} # BackupPolicyPlanReference + backup_policy_plan_reference_model['deleted'] = deleted_model + backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['name'] = 'my-policy-plan' + backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model + backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan' + + volume_remote_model = {} # VolumeRemote + volume_remote_model['region'] = region_reference_model + + backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference + backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['deleted'] = deleted_model + backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['id'] = 'r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['name'] = 'my-volume' + backup_policy_job_source_model['remote'] = volume_remote_model + backup_policy_job_source_model['resource_type'] = 'volume' + + backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason + backup_policy_job_status_reason_model['code'] = 'source_volume_busy' + backup_policy_job_status_reason_model['message'] = 'testString' + backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot' + + account_reference_model = {} # AccountReference + account_reference_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + account_reference_model['resource_type'] = 'account' + + snapshot_remote_model = {} # SnapshotRemote + snapshot_remote_model['account'] = account_reference_model + snapshot_remote_model['region'] = region_reference_model + + snapshot_reference_model = {} # SnapshotReference + snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['deleted'] = deleted_model + snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['name'] = 'my-snapshot' + snapshot_reference_model['remote'] = snapshot_remote_model + snapshot_reference_model['resource_type'] = 'snapshot' + + # Construct a json representation of a BackupPolicyJob model + backup_policy_job_model_json = {} + backup_policy_job_model_json['auto_delete'] = True + backup_policy_job_model_json['auto_delete_after'] = 90 + backup_policy_job_model_json['backup_policy_plan'] = backup_policy_plan_reference_model + backup_policy_job_model_json['completed_at'] = '2019-01-01T12:00:00Z' + backup_policy_job_model_json['created_at'] = '2019-01-01T12:00:00Z' + backup_policy_job_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c' + backup_policy_job_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + backup_policy_job_model_json['job_type'] = 'creation' + backup_policy_job_model_json['resource_type'] = 'backup_policy_job' + backup_policy_job_model_json['source'] = backup_policy_job_source_model + backup_policy_job_model_json['status'] = 'failed' + backup_policy_job_model_json['status_reasons'] = [backup_policy_job_status_reason_model] + backup_policy_job_model_json['target_snapshots'] = [snapshot_reference_model] + + # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation + backup_policy_job_model = BackupPolicyJob.from_dict(backup_policy_job_model_json) + assert backup_policy_job_model != False + + # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation + backup_policy_job_model_dict = BackupPolicyJob.from_dict(backup_policy_job_model_json).__dict__ + backup_policy_job_model2 = BackupPolicyJob(**backup_policy_job_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_model == backup_policy_job_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_model_json2 = backup_policy_job_model.to_dict() + assert backup_policy_job_model_json2 == backup_policy_job_model_json + + +class TestModel_BackupPolicyJobCollection: + """ + Test Class for BackupPolicyJobCollection + """ + + def test_backup_policy_job_collection_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJobCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20' + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' + + backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote + backup_policy_plan_remote_model['region'] = region_reference_model + + backup_policy_plan_reference_model = {} # BackupPolicyPlanReference + backup_policy_plan_reference_model['deleted'] = deleted_model + backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['name'] = 'my-policy-plan' + backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model + backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan' + + volume_remote_model = {} # VolumeRemote + volume_remote_model['region'] = region_reference_model + + backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference + backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['deleted'] = deleted_model + backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['id'] = 'r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['name'] = 'my-volume' + backup_policy_job_source_model['remote'] = volume_remote_model + backup_policy_job_source_model['resource_type'] = 'volume' + + backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason + backup_policy_job_status_reason_model['code'] = 'source_volume_busy' + backup_policy_job_status_reason_model['message'] = 'testString' + backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot' + + account_reference_model = {} # AccountReference + account_reference_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + account_reference_model['resource_type'] = 'account' + + snapshot_remote_model = {} # SnapshotRemote + snapshot_remote_model['account'] = account_reference_model + snapshot_remote_model['region'] = region_reference_model + + snapshot_reference_model = {} # SnapshotReference + snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['deleted'] = deleted_model + snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['name'] = 'my-snapshot' + snapshot_reference_model['remote'] = snapshot_remote_model + snapshot_reference_model['resource_type'] = 'snapshot' + + backup_policy_job_model = {} # BackupPolicyJob + backup_policy_job_model['auto_delete'] = True + backup_policy_job_model['auto_delete_after'] = 90 + backup_policy_job_model['backup_policy_plan'] = backup_policy_plan_reference_model + backup_policy_job_model['completed_at'] = '2019-01-01T12:00:00Z' + backup_policy_job_model['created_at'] = '2019-01-01T12:00:00Z' + backup_policy_job_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c' + backup_policy_job_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + backup_policy_job_model['job_type'] = 'creation' + backup_policy_job_model['resource_type'] = 'backup_policy_job' + backup_policy_job_model['source'] = backup_policy_job_source_model + backup_policy_job_model['status'] = 'failed' + backup_policy_job_model['status_reasons'] = [backup_policy_job_status_reason_model] + backup_policy_job_model['target_snapshots'] = [snapshot_reference_model] + + # Construct a json representation of a BackupPolicyJobCollection model + backup_policy_job_collection_model_json = {} + backup_policy_job_collection_model_json['first'] = page_link_model + backup_policy_job_collection_model_json['jobs'] = [backup_policy_job_model] + backup_policy_job_collection_model_json['limit'] = 20 + backup_policy_job_collection_model_json['next'] = page_link_model + backup_policy_job_collection_model_json['total_count'] = 132 + + # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation + backup_policy_job_collection_model = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json) + assert backup_policy_job_collection_model != False + + # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation + backup_policy_job_collection_model_dict = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json).__dict__ + backup_policy_job_collection_model2 = BackupPolicyJobCollection(**backup_policy_job_collection_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_collection_model == backup_policy_job_collection_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_collection_model_json2 = backup_policy_job_collection_model.to_dict() + assert backup_policy_job_collection_model_json2 == backup_policy_job_collection_model_json + + +class TestModel_BackupPolicyJobStatusReason: + """ + Test Class for BackupPolicyJobStatusReason + """ + + def test_backup_policy_job_status_reason_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJobStatusReason + """ + + # Construct a json representation of a BackupPolicyJobStatusReason model + backup_policy_job_status_reason_model_json = {} + backup_policy_job_status_reason_model_json['code'] = 'source_volume_busy' + backup_policy_job_status_reason_model_json['message'] = 'testString' + backup_policy_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot' + + # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation + backup_policy_job_status_reason_model = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json) + assert backup_policy_job_status_reason_model != False + + # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation + backup_policy_job_status_reason_model_dict = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json).__dict__ + backup_policy_job_status_reason_model2 = BackupPolicyJobStatusReason(**backup_policy_job_status_reason_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_status_reason_model == backup_policy_job_status_reason_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_status_reason_model_json2 = backup_policy_job_status_reason_model.to_dict() + assert backup_policy_job_status_reason_model_json2 == backup_policy_job_status_reason_model_json + + +class TestModel_BackupPolicyPatch: + """ + Test Class for BackupPolicyPatch + """ + + def test_backup_policy_patch_serialization(self): + """ + Test serialization/deserialization for BackupPolicyPatch + """ + + # Construct a json representation of a BackupPolicyPatch model + backup_policy_patch_model_json = {} + backup_policy_patch_model_json['included_content'] = ['data_volumes'] + backup_policy_patch_model_json['match_user_tags'] = ['my-daily-backup-policy'] + backup_policy_patch_model_json['name'] = 'my-backup-policy' + + # Construct a model instance of BackupPolicyPatch by calling from_dict on the json representation + backup_policy_patch_model = BackupPolicyPatch.from_dict(backup_policy_patch_model_json) + assert backup_policy_patch_model != False + + # Construct a model instance of BackupPolicyPatch by calling from_dict on the json representation + backup_policy_patch_model_dict = BackupPolicyPatch.from_dict(backup_policy_patch_model_json).__dict__ + backup_policy_patch_model2 = BackupPolicyPatch(**backup_policy_patch_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_patch_model == backup_policy_patch_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_patch_model_json2 = backup_policy_patch_model.to_dict() + assert backup_policy_patch_model_json2 == backup_policy_patch_model_json + + +class TestModel_BackupPolicyPlan: + """ + Test Class for BackupPolicyPlan + """ + + def test_backup_policy_plan_serialization(self): + """ + Test serialization/deserialization for BackupPolicyPlan """ # Construct dict forms of any model objects needed in order to build this model. @@ -49854,1401 +54132,1529 @@ def test_address_prefix_collection_serialization(self): zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - address_prefix_model = {} # AddressPrefix - address_prefix_model['cidr'] = '192.168.3.0/24' - address_prefix_model['created_at'] = '2019-01-01T12:00:00Z' - address_prefix_model['has_subnets'] = True - address_prefix_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531' - address_prefix_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - address_prefix_model['is_default'] = False - address_prefix_model['name'] = 'my-address-prefix-1' - address_prefix_model['zone'] = zone_reference_model + backup_policy_plan_clone_policy_model = {} # BackupPolicyPlanClonePolicy + backup_policy_plan_clone_policy_model['max_snapshots'] = 1 + backup_policy_plan_clone_policy_model['zones'] = [zone_reference_model] - address_prefix_collection_first_model = {} # AddressPrefixCollectionFirst - address_prefix_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20' + backup_policy_plan_deletion_trigger_model = {} # BackupPolicyPlanDeletionTrigger + backup_policy_plan_deletion_trigger_model['delete_after'] = 20 + backup_policy_plan_deletion_trigger_model['delete_over_count'] = 20 - address_prefix_collection_next_model = {} # AddressPrefixCollectionNext - address_prefix_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + encryption_key_reference_model = {} # EncryptionKeyReference + encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - # Construct a json representation of a AddressPrefixCollection model - address_prefix_collection_model_json = {} - address_prefix_collection_model_json['address_prefixes'] = [address_prefix_model] - address_prefix_collection_model_json['first'] = address_prefix_collection_first_model - address_prefix_collection_model_json['limit'] = 20 - address_prefix_collection_model_json['next'] = address_prefix_collection_next_model - address_prefix_collection_model_json['total_count'] = 132 + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' - # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation - address_prefix_collection_model = AddressPrefixCollection.from_dict(address_prefix_collection_model_json) - assert address_prefix_collection_model != False + backup_policy_plan_remote_region_policy_model = {} # BackupPolicyPlanRemoteRegionPolicy + backup_policy_plan_remote_region_policy_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_model['encryption_key'] = encryption_key_reference_model + backup_policy_plan_remote_region_policy_model['region'] = region_reference_model - # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation - address_prefix_collection_model_dict = AddressPrefixCollection.from_dict(address_prefix_collection_model_json).__dict__ - address_prefix_collection_model2 = AddressPrefixCollection(**address_prefix_collection_model_dict) + # Construct a json representation of a BackupPolicyPlan model + backup_policy_plan_model_json = {} + backup_policy_plan_model_json['active'] = True + backup_policy_plan_model_json['attach_user_tags'] = ['my-daily-backup-plan'] + backup_policy_plan_model_json['clone_policy'] = backup_policy_plan_clone_policy_model + backup_policy_plan_model_json['copy_user_tags'] = True + backup_policy_plan_model_json['created_at'] = '2019-01-01T12:00:00Z' + backup_policy_plan_model_json['cron_spec'] = '30 */2 * * 1-5' + backup_policy_plan_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_model + backup_policy_plan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_model_json['lifecycle_state'] = 'stable' + backup_policy_plan_model_json['name'] = 'my-policy-plan' + backup_policy_plan_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_model] + backup_policy_plan_model_json['resource_type'] = 'backup_policy_plan' + + # Construct a model instance of BackupPolicyPlan by calling from_dict on the json representation + backup_policy_plan_model = BackupPolicyPlan.from_dict(backup_policy_plan_model_json) + assert backup_policy_plan_model != False + + # Construct a model instance of BackupPolicyPlan by calling from_dict on the json representation + backup_policy_plan_model_dict = BackupPolicyPlan.from_dict(backup_policy_plan_model_json).__dict__ + backup_policy_plan_model2 = BackupPolicyPlan(**backup_policy_plan_model_dict) # Verify the model instances are equivalent - assert address_prefix_collection_model == address_prefix_collection_model2 + assert backup_policy_plan_model == backup_policy_plan_model2 # Convert model instance back to dict and verify no loss of data - address_prefix_collection_model_json2 = address_prefix_collection_model.to_dict() - assert address_prefix_collection_model_json2 == address_prefix_collection_model_json + backup_policy_plan_model_json2 = backup_policy_plan_model.to_dict() + assert backup_policy_plan_model_json2 == backup_policy_plan_model_json -class TestModel_AddressPrefixCollectionFirst: +class TestModel_BackupPolicyPlanClonePolicy: """ - Test Class for AddressPrefixCollectionFirst + Test Class for BackupPolicyPlanClonePolicy """ - def test_address_prefix_collection_first_serialization(self): + def test_backup_policy_plan_clone_policy_serialization(self): """ - Test serialization/deserialization for AddressPrefixCollectionFirst + Test serialization/deserialization for BackupPolicyPlanClonePolicy """ - # Construct a json representation of a AddressPrefixCollectionFirst model - address_prefix_collection_first_model_json = {} - address_prefix_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20' + # Construct dict forms of any model objects needed in order to build this model. + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a BackupPolicyPlanClonePolicy model + backup_policy_plan_clone_policy_model_json = {} + backup_policy_plan_clone_policy_model_json['max_snapshots'] = 1 + backup_policy_plan_clone_policy_model_json['zones'] = [zone_reference_model] - # Construct a model instance of AddressPrefixCollectionFirst by calling from_dict on the json representation - address_prefix_collection_first_model = AddressPrefixCollectionFirst.from_dict(address_prefix_collection_first_model_json) - assert address_prefix_collection_first_model != False + # Construct a model instance of BackupPolicyPlanClonePolicy by calling from_dict on the json representation + backup_policy_plan_clone_policy_model = BackupPolicyPlanClonePolicy.from_dict(backup_policy_plan_clone_policy_model_json) + assert backup_policy_plan_clone_policy_model != False - # Construct a model instance of AddressPrefixCollectionFirst by calling from_dict on the json representation - address_prefix_collection_first_model_dict = AddressPrefixCollectionFirst.from_dict(address_prefix_collection_first_model_json).__dict__ - address_prefix_collection_first_model2 = AddressPrefixCollectionFirst(**address_prefix_collection_first_model_dict) + # Construct a model instance of BackupPolicyPlanClonePolicy by calling from_dict on the json representation + backup_policy_plan_clone_policy_model_dict = BackupPolicyPlanClonePolicy.from_dict(backup_policy_plan_clone_policy_model_json).__dict__ + backup_policy_plan_clone_policy_model2 = BackupPolicyPlanClonePolicy(**backup_policy_plan_clone_policy_model_dict) # Verify the model instances are equivalent - assert address_prefix_collection_first_model == address_prefix_collection_first_model2 + assert backup_policy_plan_clone_policy_model == backup_policy_plan_clone_policy_model2 # Convert model instance back to dict and verify no loss of data - address_prefix_collection_first_model_json2 = address_prefix_collection_first_model.to_dict() - assert address_prefix_collection_first_model_json2 == address_prefix_collection_first_model_json + backup_policy_plan_clone_policy_model_json2 = backup_policy_plan_clone_policy_model.to_dict() + assert backup_policy_plan_clone_policy_model_json2 == backup_policy_plan_clone_policy_model_json -class TestModel_AddressPrefixCollectionNext: +class TestModel_BackupPolicyPlanClonePolicyPatch: """ - Test Class for AddressPrefixCollectionNext + Test Class for BackupPolicyPlanClonePolicyPatch """ - def test_address_prefix_collection_next_serialization(self): + def test_backup_policy_plan_clone_policy_patch_serialization(self): """ - Test serialization/deserialization for AddressPrefixCollectionNext + Test serialization/deserialization for BackupPolicyPlanClonePolicyPatch """ - # Construct a json representation of a AddressPrefixCollectionNext model - address_prefix_collection_next_model_json = {} - address_prefix_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + # 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 BackupPolicyPlanClonePolicyPatch model + backup_policy_plan_clone_policy_patch_model_json = {} + backup_policy_plan_clone_policy_patch_model_json['max_snapshots'] = 1 + backup_policy_plan_clone_policy_patch_model_json['zones'] = [zone_identity_model] - # Construct a model instance of AddressPrefixCollectionNext by calling from_dict on the json representation - address_prefix_collection_next_model = AddressPrefixCollectionNext.from_dict(address_prefix_collection_next_model_json) - assert address_prefix_collection_next_model != False + # Construct a model instance of BackupPolicyPlanClonePolicyPatch by calling from_dict on the json representation + backup_policy_plan_clone_policy_patch_model = BackupPolicyPlanClonePolicyPatch.from_dict(backup_policy_plan_clone_policy_patch_model_json) + assert backup_policy_plan_clone_policy_patch_model != False - # Construct a model instance of AddressPrefixCollectionNext by calling from_dict on the json representation - address_prefix_collection_next_model_dict = AddressPrefixCollectionNext.from_dict(address_prefix_collection_next_model_json).__dict__ - address_prefix_collection_next_model2 = AddressPrefixCollectionNext(**address_prefix_collection_next_model_dict) + # Construct a model instance of BackupPolicyPlanClonePolicyPatch by calling from_dict on the json representation + backup_policy_plan_clone_policy_patch_model_dict = BackupPolicyPlanClonePolicyPatch.from_dict(backup_policy_plan_clone_policy_patch_model_json).__dict__ + backup_policy_plan_clone_policy_patch_model2 = BackupPolicyPlanClonePolicyPatch(**backup_policy_plan_clone_policy_patch_model_dict) # Verify the model instances are equivalent - assert address_prefix_collection_next_model == address_prefix_collection_next_model2 + assert backup_policy_plan_clone_policy_patch_model == backup_policy_plan_clone_policy_patch_model2 # Convert model instance back to dict and verify no loss of data - address_prefix_collection_next_model_json2 = address_prefix_collection_next_model.to_dict() - assert address_prefix_collection_next_model_json2 == address_prefix_collection_next_model_json + backup_policy_plan_clone_policy_patch_model_json2 = backup_policy_plan_clone_policy_patch_model.to_dict() + assert backup_policy_plan_clone_policy_patch_model_json2 == backup_policy_plan_clone_policy_patch_model_json -class TestModel_AddressPrefixPatch: +class TestModel_BackupPolicyPlanClonePolicyPrototype: """ - Test Class for AddressPrefixPatch + Test Class for BackupPolicyPlanClonePolicyPrototype """ - def test_address_prefix_patch_serialization(self): + def test_backup_policy_plan_clone_policy_prototype_serialization(self): """ - Test serialization/deserialization for AddressPrefixPatch + Test serialization/deserialization for BackupPolicyPlanClonePolicyPrototype """ - # Construct a json representation of a AddressPrefixPatch model - address_prefix_patch_model_json = {} - address_prefix_patch_model_json['is_default'] = False - address_prefix_patch_model_json['name'] = 'my-address-prefix-1' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation - address_prefix_patch_model = AddressPrefixPatch.from_dict(address_prefix_patch_model_json) - assert address_prefix_patch_model != False + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' - # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation - address_prefix_patch_model_dict = AddressPrefixPatch.from_dict(address_prefix_patch_model_json).__dict__ - address_prefix_patch_model2 = AddressPrefixPatch(**address_prefix_patch_model_dict) + # Construct a json representation of a BackupPolicyPlanClonePolicyPrototype model + backup_policy_plan_clone_policy_prototype_model_json = {} + backup_policy_plan_clone_policy_prototype_model_json['max_snapshots'] = 5 + backup_policy_plan_clone_policy_prototype_model_json['zones'] = [zone_identity_model] + + # Construct a model instance of BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation + backup_policy_plan_clone_policy_prototype_model = BackupPolicyPlanClonePolicyPrototype.from_dict(backup_policy_plan_clone_policy_prototype_model_json) + assert backup_policy_plan_clone_policy_prototype_model != False + + # Construct a model instance of BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation + backup_policy_plan_clone_policy_prototype_model_dict = BackupPolicyPlanClonePolicyPrototype.from_dict(backup_policy_plan_clone_policy_prototype_model_json).__dict__ + backup_policy_plan_clone_policy_prototype_model2 = BackupPolicyPlanClonePolicyPrototype(**backup_policy_plan_clone_policy_prototype_model_dict) # Verify the model instances are equivalent - assert address_prefix_patch_model == address_prefix_patch_model2 + assert backup_policy_plan_clone_policy_prototype_model == backup_policy_plan_clone_policy_prototype_model2 # Convert model instance back to dict and verify no loss of data - address_prefix_patch_model_json2 = address_prefix_patch_model.to_dict() - assert address_prefix_patch_model_json2 == address_prefix_patch_model_json + backup_policy_plan_clone_policy_prototype_model_json2 = backup_policy_plan_clone_policy_prototype_model.to_dict() + assert backup_policy_plan_clone_policy_prototype_model_json2 == backup_policy_plan_clone_policy_prototype_model_json -class TestModel_BackupPolicyCollection: +class TestModel_BackupPolicyPlanCollection: """ - Test Class for BackupPolicyCollection + Test Class for BackupPolicyPlanCollection """ - def test_backup_policy_collection_serialization(self): + def test_backup_policy_plan_collection_serialization(self): """ - Test serialization/deserialization for BackupPolicyCollection + Test serialization/deserialization for BackupPolicyPlanCollection """ # Construct dict forms of any model objects needed in order to build this model. - backup_policy_health_reason_model = {} # BackupPolicyHealthReason - backup_policy_health_reason_model['code'] = 'missing_service_authorization_policies' - backup_policy_health_reason_model['message'] = 'One or more accounts are missing service authorization policies' - backup_policy_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui' - - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?limit=20' - backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote - backup_policy_plan_remote_model['region'] = region_reference_model + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' - backup_policy_plan_reference_model = {} # BackupPolicyPlanReference - backup_policy_plan_reference_model['deleted'] = deleted_model - backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_reference_model['name'] = 'my-policy-plan' - backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model - backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan' + backup_policy_plan_clone_policy_model = {} # BackupPolicyPlanClonePolicy + backup_policy_plan_clone_policy_model['max_snapshots'] = 1 + backup_policy_plan_clone_policy_model['zones'] = [zone_reference_model] - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + backup_policy_plan_deletion_trigger_model = {} # BackupPolicyPlanDeletionTrigger + backup_policy_plan_deletion_trigger_model['delete_after'] = 20 + backup_policy_plan_deletion_trigger_model['delete_over_count'] = 20 - backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference - backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce' - backup_policy_scope_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - backup_policy_scope_model['resource_type'] = 'enterprise' + encryption_key_reference_model = {} # EncryptionKeyReference + encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - backup_policy_model = {} # BackupPolicyMatchResourceTypeInstance - backup_policy_model['created_at'] = '2019-01-01T12:00:00Z' - backup_policy_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6' - backup_policy_model['health_reasons'] = [backup_policy_health_reason_model] - backup_policy_model['health_state'] = 'ok' - backup_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6' - backup_policy_model['id'] = 'r134-076191ba-49c2-4763-94fd-c70de73ee2e6' - backup_policy_model['last_job_completed_at'] = '2019-01-01T12:00:00Z' - backup_policy_model['lifecycle_state'] = 'stable' - backup_policy_model['match_user_tags'] = ['my-daily-backup-policy'] - backup_policy_model['name'] = 'my-backup-policy' - backup_policy_model['plans'] = [backup_policy_plan_reference_model] - backup_policy_model['resource_group'] = resource_group_reference_model - backup_policy_model['resource_type'] = 'backup_policy' - backup_policy_model['scope'] = backup_policy_scope_model - backup_policy_model['included_content'] = ['data_volumes'] - backup_policy_model['match_resource_type'] = 'instance' + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' - backup_policy_collection_first_model = {} # BackupPolicyCollectionFirst - backup_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20' + backup_policy_plan_remote_region_policy_model = {} # BackupPolicyPlanRemoteRegionPolicy + backup_policy_plan_remote_region_policy_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_model['encryption_key'] = encryption_key_reference_model + backup_policy_plan_remote_region_policy_model['region'] = region_reference_model - backup_policy_collection_next_model = {} # BackupPolicyCollectionNext - backup_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + backup_policy_plan_model = {} # BackupPolicyPlan + backup_policy_plan_model['active'] = True + backup_policy_plan_model['attach_user_tags'] = ['my-daily-backup-plan'] + backup_policy_plan_model['clone_policy'] = backup_policy_plan_clone_policy_model + backup_policy_plan_model['copy_user_tags'] = True + backup_policy_plan_model['created_at'] = '2019-01-01T12:00:00Z' + backup_policy_plan_model['cron_spec'] = '30 */2 * * 1-5' + backup_policy_plan_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_model + backup_policy_plan_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_model['lifecycle_state'] = 'stable' + backup_policy_plan_model['name'] = 'my-policy-plan' + backup_policy_plan_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_model] + backup_policy_plan_model['resource_type'] = 'backup_policy_plan' - # Construct a json representation of a BackupPolicyCollection model - backup_policy_collection_model_json = {} - backup_policy_collection_model_json['backup_policies'] = [backup_policy_model] - backup_policy_collection_model_json['first'] = backup_policy_collection_first_model - backup_policy_collection_model_json['limit'] = 20 - backup_policy_collection_model_json['next'] = backup_policy_collection_next_model - backup_policy_collection_model_json['total_count'] = 132 + # Construct a json representation of a BackupPolicyPlanCollection model + backup_policy_plan_collection_model_json = {} + backup_policy_plan_collection_model_json['first'] = page_link_model + backup_policy_plan_collection_model_json['limit'] = 20 + backup_policy_plan_collection_model_json['next'] = page_link_model + backup_policy_plan_collection_model_json['plans'] = [backup_policy_plan_model] + backup_policy_plan_collection_model_json['total_count'] = 132 - # Construct a model instance of BackupPolicyCollection by calling from_dict on the json representation - backup_policy_collection_model = BackupPolicyCollection.from_dict(backup_policy_collection_model_json) - assert backup_policy_collection_model != False + # Construct a model instance of BackupPolicyPlanCollection by calling from_dict on the json representation + backup_policy_plan_collection_model = BackupPolicyPlanCollection.from_dict(backup_policy_plan_collection_model_json) + assert backup_policy_plan_collection_model != False - # Construct a model instance of BackupPolicyCollection by calling from_dict on the json representation - backup_policy_collection_model_dict = BackupPolicyCollection.from_dict(backup_policy_collection_model_json).__dict__ - backup_policy_collection_model2 = BackupPolicyCollection(**backup_policy_collection_model_dict) + # Construct a model instance of BackupPolicyPlanCollection by calling from_dict on the json representation + backup_policy_plan_collection_model_dict = BackupPolicyPlanCollection.from_dict(backup_policy_plan_collection_model_json).__dict__ + backup_policy_plan_collection_model2 = BackupPolicyPlanCollection(**backup_policy_plan_collection_model_dict) # Verify the model instances are equivalent - assert backup_policy_collection_model == backup_policy_collection_model2 + assert backup_policy_plan_collection_model == backup_policy_plan_collection_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_collection_model_json2 = backup_policy_collection_model.to_dict() - assert backup_policy_collection_model_json2 == backup_policy_collection_model_json + backup_policy_plan_collection_model_json2 = backup_policy_plan_collection_model.to_dict() + assert backup_policy_plan_collection_model_json2 == backup_policy_plan_collection_model_json -class TestModel_BackupPolicyCollectionFirst: +class TestModel_BackupPolicyPlanDeletionTrigger: """ - Test Class for BackupPolicyCollectionFirst + Test Class for BackupPolicyPlanDeletionTrigger """ - def test_backup_policy_collection_first_serialization(self): + def test_backup_policy_plan_deletion_trigger_serialization(self): """ - Test serialization/deserialization for BackupPolicyCollectionFirst + Test serialization/deserialization for BackupPolicyPlanDeletionTrigger """ - # Construct a json representation of a BackupPolicyCollectionFirst model - backup_policy_collection_first_model_json = {} - backup_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20' + # Construct a json representation of a BackupPolicyPlanDeletionTrigger model + backup_policy_plan_deletion_trigger_model_json = {} + backup_policy_plan_deletion_trigger_model_json['delete_after'] = 20 + backup_policy_plan_deletion_trigger_model_json['delete_over_count'] = 20 - # Construct a model instance of BackupPolicyCollectionFirst by calling from_dict on the json representation - backup_policy_collection_first_model = BackupPolicyCollectionFirst.from_dict(backup_policy_collection_first_model_json) - assert backup_policy_collection_first_model != False + # Construct a model instance of BackupPolicyPlanDeletionTrigger by calling from_dict on the json representation + backup_policy_plan_deletion_trigger_model = BackupPolicyPlanDeletionTrigger.from_dict(backup_policy_plan_deletion_trigger_model_json) + assert backup_policy_plan_deletion_trigger_model != False - # Construct a model instance of BackupPolicyCollectionFirst by calling from_dict on the json representation - backup_policy_collection_first_model_dict = BackupPolicyCollectionFirst.from_dict(backup_policy_collection_first_model_json).__dict__ - backup_policy_collection_first_model2 = BackupPolicyCollectionFirst(**backup_policy_collection_first_model_dict) + # Construct a model instance of BackupPolicyPlanDeletionTrigger by calling from_dict on the json representation + backup_policy_plan_deletion_trigger_model_dict = BackupPolicyPlanDeletionTrigger.from_dict(backup_policy_plan_deletion_trigger_model_json).__dict__ + backup_policy_plan_deletion_trigger_model2 = BackupPolicyPlanDeletionTrigger(**backup_policy_plan_deletion_trigger_model_dict) # Verify the model instances are equivalent - assert backup_policy_collection_first_model == backup_policy_collection_first_model2 + assert backup_policy_plan_deletion_trigger_model == backup_policy_plan_deletion_trigger_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_collection_first_model_json2 = backup_policy_collection_first_model.to_dict() - assert backup_policy_collection_first_model_json2 == backup_policy_collection_first_model_json + backup_policy_plan_deletion_trigger_model_json2 = backup_policy_plan_deletion_trigger_model.to_dict() + assert backup_policy_plan_deletion_trigger_model_json2 == backup_policy_plan_deletion_trigger_model_json -class TestModel_BackupPolicyCollectionNext: +class TestModel_BackupPolicyPlanDeletionTriggerPatch: """ - Test Class for BackupPolicyCollectionNext + Test Class for BackupPolicyPlanDeletionTriggerPatch """ - def test_backup_policy_collection_next_serialization(self): + def test_backup_policy_plan_deletion_trigger_patch_serialization(self): """ - Test serialization/deserialization for BackupPolicyCollectionNext + Test serialization/deserialization for BackupPolicyPlanDeletionTriggerPatch """ - # Construct a json representation of a BackupPolicyCollectionNext model - backup_policy_collection_next_model_json = {} - backup_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + # Construct a json representation of a BackupPolicyPlanDeletionTriggerPatch model + backup_policy_plan_deletion_trigger_patch_model_json = {} + backup_policy_plan_deletion_trigger_patch_model_json['delete_after'] = 20 + backup_policy_plan_deletion_trigger_patch_model_json['delete_over_count'] = 1 - # Construct a model instance of BackupPolicyCollectionNext by calling from_dict on the json representation - backup_policy_collection_next_model = BackupPolicyCollectionNext.from_dict(backup_policy_collection_next_model_json) - assert backup_policy_collection_next_model != False + # Construct a model instance of BackupPolicyPlanDeletionTriggerPatch by calling from_dict on the json representation + backup_policy_plan_deletion_trigger_patch_model = BackupPolicyPlanDeletionTriggerPatch.from_dict(backup_policy_plan_deletion_trigger_patch_model_json) + assert backup_policy_plan_deletion_trigger_patch_model != False - # Construct a model instance of BackupPolicyCollectionNext by calling from_dict on the json representation - backup_policy_collection_next_model_dict = BackupPolicyCollectionNext.from_dict(backup_policy_collection_next_model_json).__dict__ - backup_policy_collection_next_model2 = BackupPolicyCollectionNext(**backup_policy_collection_next_model_dict) + # Construct a model instance of BackupPolicyPlanDeletionTriggerPatch by calling from_dict on the json representation + backup_policy_plan_deletion_trigger_patch_model_dict = BackupPolicyPlanDeletionTriggerPatch.from_dict(backup_policy_plan_deletion_trigger_patch_model_json).__dict__ + backup_policy_plan_deletion_trigger_patch_model2 = BackupPolicyPlanDeletionTriggerPatch(**backup_policy_plan_deletion_trigger_patch_model_dict) # Verify the model instances are equivalent - assert backup_policy_collection_next_model == backup_policy_collection_next_model2 + assert backup_policy_plan_deletion_trigger_patch_model == backup_policy_plan_deletion_trigger_patch_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_collection_next_model_json2 = backup_policy_collection_next_model.to_dict() - assert backup_policy_collection_next_model_json2 == backup_policy_collection_next_model_json + backup_policy_plan_deletion_trigger_patch_model_json2 = backup_policy_plan_deletion_trigger_patch_model.to_dict() + assert backup_policy_plan_deletion_trigger_patch_model_json2 == backup_policy_plan_deletion_trigger_patch_model_json -class TestModel_BackupPolicyHealthReason: +class TestModel_BackupPolicyPlanDeletionTriggerPrototype: """ - Test Class for BackupPolicyHealthReason + Test Class for BackupPolicyPlanDeletionTriggerPrototype """ - def test_backup_policy_health_reason_serialization(self): + def test_backup_policy_plan_deletion_trigger_prototype_serialization(self): """ - Test serialization/deserialization for BackupPolicyHealthReason + Test serialization/deserialization for BackupPolicyPlanDeletionTriggerPrototype """ - # Construct a json representation of a BackupPolicyHealthReason model - backup_policy_health_reason_model_json = {} - backup_policy_health_reason_model_json['code'] = 'missing_service_authorization_policies' - backup_policy_health_reason_model_json['message'] = 'One or more accounts are missing service authorization policies' - backup_policy_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui' + # Construct a json representation of a BackupPolicyPlanDeletionTriggerPrototype model + backup_policy_plan_deletion_trigger_prototype_model_json = {} + backup_policy_plan_deletion_trigger_prototype_model_json['delete_after'] = 20 + backup_policy_plan_deletion_trigger_prototype_model_json['delete_over_count'] = 20 - # Construct a model instance of BackupPolicyHealthReason by calling from_dict on the json representation - backup_policy_health_reason_model = BackupPolicyHealthReason.from_dict(backup_policy_health_reason_model_json) - assert backup_policy_health_reason_model != False + # Construct a model instance of BackupPolicyPlanDeletionTriggerPrototype by calling from_dict on the json representation + backup_policy_plan_deletion_trigger_prototype_model = BackupPolicyPlanDeletionTriggerPrototype.from_dict(backup_policy_plan_deletion_trigger_prototype_model_json) + assert backup_policy_plan_deletion_trigger_prototype_model != False - # Construct a model instance of BackupPolicyHealthReason by calling from_dict on the json representation - backup_policy_health_reason_model_dict = BackupPolicyHealthReason.from_dict(backup_policy_health_reason_model_json).__dict__ - backup_policy_health_reason_model2 = BackupPolicyHealthReason(**backup_policy_health_reason_model_dict) + # Construct a model instance of BackupPolicyPlanDeletionTriggerPrototype by calling from_dict on the json representation + backup_policy_plan_deletion_trigger_prototype_model_dict = BackupPolicyPlanDeletionTriggerPrototype.from_dict(backup_policy_plan_deletion_trigger_prototype_model_json).__dict__ + backup_policy_plan_deletion_trigger_prototype_model2 = BackupPolicyPlanDeletionTriggerPrototype(**backup_policy_plan_deletion_trigger_prototype_model_dict) # Verify the model instances are equivalent - assert backup_policy_health_reason_model == backup_policy_health_reason_model2 + assert backup_policy_plan_deletion_trigger_prototype_model == backup_policy_plan_deletion_trigger_prototype_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_health_reason_model_json2 = backup_policy_health_reason_model.to_dict() - assert backup_policy_health_reason_model_json2 == backup_policy_health_reason_model_json + backup_policy_plan_deletion_trigger_prototype_model_json2 = backup_policy_plan_deletion_trigger_prototype_model.to_dict() + assert backup_policy_plan_deletion_trigger_prototype_model_json2 == backup_policy_plan_deletion_trigger_prototype_model_json -class TestModel_BackupPolicyJob: +class TestModel_BackupPolicyPlanPatch: """ - Test Class for BackupPolicyJob + Test Class for BackupPolicyPlanPatch """ - def test_backup_policy_job_serialization(self): + def test_backup_policy_plan_patch_serialization(self): """ - Test serialization/deserialization for BackupPolicyJob + Test serialization/deserialization for BackupPolicyPlanPatch """ # Construct dict forms of any model objects needed in order to build this model. - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' - - backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote - backup_policy_plan_remote_model['region'] = region_reference_model - - backup_policy_plan_reference_model = {} # BackupPolicyPlanReference - backup_policy_plan_reference_model['deleted'] = deleted_model - backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_reference_model['name'] = 'my-policy-plan' - backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model - backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan' - - volume_remote_model = {} # VolumeRemote - volume_remote_model['region'] = region_reference_model + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' - backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference - backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - backup_policy_job_source_model['deleted'] = deleted_model - backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - backup_policy_job_source_model['id'] = 'r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - backup_policy_job_source_model['name'] = 'my-volume' - backup_policy_job_source_model['remote'] = volume_remote_model - backup_policy_job_source_model['resource_type'] = 'volume' + backup_policy_plan_clone_policy_patch_model = {} # BackupPolicyPlanClonePolicyPatch + backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1 + backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model] - backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason - backup_policy_job_status_reason_model['code'] = 'source_volume_busy' - backup_policy_job_status_reason_model['message'] = 'testString' - backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot' + backup_policy_plan_deletion_trigger_patch_model = {} # BackupPolicyPlanDeletionTriggerPatch + backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20 + backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 1 - account_reference_model = {} # AccountReference - account_reference_model['id'] = 'bb1b52262f7441a586f49068482f1e60' - account_reference_model['resource_type'] = 'account' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - snapshot_remote_model = {} # SnapshotRemote - snapshot_remote_model['account'] = account_reference_model - snapshot_remote_model['region'] = region_reference_model + region_identity_model = {} # RegionIdentityByName + region_identity_model['name'] = 'us-south' - snapshot_reference_model = {} # SnapshotReference - snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263' - snapshot_reference_model['deleted'] = deleted_model - snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263' - snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' - snapshot_reference_model['name'] = 'my-snapshot' - snapshot_reference_model['remote'] = snapshot_remote_model - snapshot_reference_model['resource_type'] = 'snapshot' + backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 + backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model + backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model - # Construct a json representation of a BackupPolicyJob model - backup_policy_job_model_json = {} - backup_policy_job_model_json['auto_delete'] = True - backup_policy_job_model_json['auto_delete_after'] = 90 - backup_policy_job_model_json['backup_policy_plan'] = backup_policy_plan_reference_model - backup_policy_job_model_json['completed_at'] = '2019-01-01T12:00:00Z' - backup_policy_job_model_json['created_at'] = '2019-01-01T12:00:00Z' - backup_policy_job_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c' - backup_policy_job_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' - backup_policy_job_model_json['job_type'] = 'creation' - backup_policy_job_model_json['resource_type'] = 'backup_policy_job' - backup_policy_job_model_json['source'] = backup_policy_job_source_model - backup_policy_job_model_json['status'] = 'failed' - backup_policy_job_model_json['status_reasons'] = [backup_policy_job_status_reason_model] - backup_policy_job_model_json['target_snapshots'] = [snapshot_reference_model] + # Construct a json representation of a BackupPolicyPlanPatch model + backup_policy_plan_patch_model_json = {} + backup_policy_plan_patch_model_json['active'] = True + backup_policy_plan_patch_model_json['attach_user_tags'] = ['my-daily-backup-plan'] + backup_policy_plan_patch_model_json['clone_policy'] = backup_policy_plan_clone_policy_patch_model + backup_policy_plan_patch_model_json['copy_user_tags'] = True + backup_policy_plan_patch_model_json['cron_spec'] = '30 */2 * * 1-5' + backup_policy_plan_patch_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model + backup_policy_plan_patch_model_json['name'] = 'my-policy-plan' + backup_policy_plan_patch_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model] - # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation - backup_policy_job_model = BackupPolicyJob.from_dict(backup_policy_job_model_json) - assert backup_policy_job_model != False + # Construct a model instance of BackupPolicyPlanPatch by calling from_dict on the json representation + backup_policy_plan_patch_model = BackupPolicyPlanPatch.from_dict(backup_policy_plan_patch_model_json) + assert backup_policy_plan_patch_model != False - # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation - backup_policy_job_model_dict = BackupPolicyJob.from_dict(backup_policy_job_model_json).__dict__ - backup_policy_job_model2 = BackupPolicyJob(**backup_policy_job_model_dict) + # Construct a model instance of BackupPolicyPlanPatch by calling from_dict on the json representation + backup_policy_plan_patch_model_dict = BackupPolicyPlanPatch.from_dict(backup_policy_plan_patch_model_json).__dict__ + backup_policy_plan_patch_model2 = BackupPolicyPlanPatch(**backup_policy_plan_patch_model_dict) # Verify the model instances are equivalent - assert backup_policy_job_model == backup_policy_job_model2 + assert backup_policy_plan_patch_model == backup_policy_plan_patch_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_job_model_json2 = backup_policy_job_model.to_dict() - assert backup_policy_job_model_json2 == backup_policy_job_model_json + backup_policy_plan_patch_model_json2 = backup_policy_plan_patch_model.to_dict() + assert backup_policy_plan_patch_model_json2 == backup_policy_plan_patch_model_json -class TestModel_BackupPolicyJobCollection: +class TestModel_BackupPolicyPlanPrototype: """ - Test Class for BackupPolicyJobCollection + Test Class for BackupPolicyPlanPrototype """ - def test_backup_policy_job_collection_serialization(self): + def test_backup_policy_plan_prototype_serialization(self): """ - Test serialization/deserialization for BackupPolicyJobCollection + Test serialization/deserialization for BackupPolicyPlanPrototype """ # Construct dict forms of any model objects needed in order to build this model. - backup_policy_job_collection_first_model = {} # BackupPolicyJobCollectionFirst - backup_policy_job_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20' - - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' - - backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote - backup_policy_plan_remote_model['region'] = region_reference_model - - backup_policy_plan_reference_model = {} # BackupPolicyPlanReference - backup_policy_plan_reference_model['deleted'] = deleted_model - backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_reference_model['name'] = 'my-policy-plan' - backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model - backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan' - - volume_remote_model = {} # VolumeRemote - volume_remote_model['region'] = region_reference_model - - backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference - backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - backup_policy_job_source_model['deleted'] = deleted_model - backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - backup_policy_job_source_model['id'] = 'r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - backup_policy_job_source_model['name'] = 'my-volume' - backup_policy_job_source_model['remote'] = volume_remote_model - backup_policy_job_source_model['resource_type'] = 'volume' - - backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason - backup_policy_job_status_reason_model['code'] = 'source_volume_busy' - backup_policy_job_status_reason_model['message'] = 'testString' - backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot' + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' - account_reference_model = {} # AccountReference - account_reference_model['id'] = 'bb1b52262f7441a586f49068482f1e60' - account_reference_model['resource_type'] = 'account' + backup_policy_plan_clone_policy_prototype_model = {} # BackupPolicyPlanClonePolicyPrototype + backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5 + backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model] - snapshot_remote_model = {} # SnapshotRemote - snapshot_remote_model['account'] = account_reference_model - snapshot_remote_model['region'] = region_reference_model + backup_policy_plan_deletion_trigger_prototype_model = {} # BackupPolicyPlanDeletionTriggerPrototype + backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20 + backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20 - snapshot_reference_model = {} # SnapshotReference - snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263' - snapshot_reference_model['deleted'] = deleted_model - snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263' - snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' - snapshot_reference_model['name'] = 'my-snapshot' - snapshot_reference_model['remote'] = snapshot_remote_model - snapshot_reference_model['resource_type'] = 'snapshot' + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - backup_policy_job_model = {} # BackupPolicyJob - backup_policy_job_model['auto_delete'] = True - backup_policy_job_model['auto_delete_after'] = 90 - backup_policy_job_model['backup_policy_plan'] = backup_policy_plan_reference_model - backup_policy_job_model['completed_at'] = '2019-01-01T12:00:00Z' - backup_policy_job_model['created_at'] = '2019-01-01T12:00:00Z' - backup_policy_job_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c' - backup_policy_job_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' - backup_policy_job_model['job_type'] = 'creation' - backup_policy_job_model['resource_type'] = 'backup_policy_job' - backup_policy_job_model['source'] = backup_policy_job_source_model - backup_policy_job_model['status'] = 'failed' - backup_policy_job_model['status_reasons'] = [backup_policy_job_status_reason_model] - backup_policy_job_model['target_snapshots'] = [snapshot_reference_model] + region_identity_model = {} # RegionIdentityByName + region_identity_model['name'] = 'us-south' - backup_policy_job_collection_next_model = {} # BackupPolicyJobCollectionNext - backup_policy_job_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 + backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model + backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model - # Construct a json representation of a BackupPolicyJobCollection model - backup_policy_job_collection_model_json = {} - backup_policy_job_collection_model_json['first'] = backup_policy_job_collection_first_model - backup_policy_job_collection_model_json['jobs'] = [backup_policy_job_model] - backup_policy_job_collection_model_json['limit'] = 20 - backup_policy_job_collection_model_json['next'] = backup_policy_job_collection_next_model - backup_policy_job_collection_model_json['total_count'] = 132 + # Construct a json representation of a BackupPolicyPlanPrototype model + backup_policy_plan_prototype_model_json = {} + backup_policy_plan_prototype_model_json['active'] = True + backup_policy_plan_prototype_model_json['attach_user_tags'] = ['my-daily-backup-plan'] + backup_policy_plan_prototype_model_json['clone_policy'] = backup_policy_plan_clone_policy_prototype_model + backup_policy_plan_prototype_model_json['copy_user_tags'] = True + backup_policy_plan_prototype_model_json['cron_spec'] = '30 */2 * * 1-5' + backup_policy_plan_prototype_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model + backup_policy_plan_prototype_model_json['name'] = 'my-policy-plan' + backup_policy_plan_prototype_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model] - # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation - backup_policy_job_collection_model = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json) - assert backup_policy_job_collection_model != False + # Construct a model instance of BackupPolicyPlanPrototype by calling from_dict on the json representation + backup_policy_plan_prototype_model = BackupPolicyPlanPrototype.from_dict(backup_policy_plan_prototype_model_json) + assert backup_policy_plan_prototype_model != False - # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation - backup_policy_job_collection_model_dict = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json).__dict__ - backup_policy_job_collection_model2 = BackupPolicyJobCollection(**backup_policy_job_collection_model_dict) + # Construct a model instance of BackupPolicyPlanPrototype by calling from_dict on the json representation + backup_policy_plan_prototype_model_dict = BackupPolicyPlanPrototype.from_dict(backup_policy_plan_prototype_model_json).__dict__ + backup_policy_plan_prototype_model2 = BackupPolicyPlanPrototype(**backup_policy_plan_prototype_model_dict) # Verify the model instances are equivalent - assert backup_policy_job_collection_model == backup_policy_job_collection_model2 + assert backup_policy_plan_prototype_model == backup_policy_plan_prototype_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_job_collection_model_json2 = backup_policy_job_collection_model.to_dict() - assert backup_policy_job_collection_model_json2 == backup_policy_job_collection_model_json + backup_policy_plan_prototype_model_json2 = backup_policy_plan_prototype_model.to_dict() + assert backup_policy_plan_prototype_model_json2 == backup_policy_plan_prototype_model_json -class TestModel_BackupPolicyJobCollectionFirst: +class TestModel_BackupPolicyPlanReference: """ - Test Class for BackupPolicyJobCollectionFirst + Test Class for BackupPolicyPlanReference """ - def test_backup_policy_job_collection_first_serialization(self): + def test_backup_policy_plan_reference_serialization(self): """ - Test serialization/deserialization for BackupPolicyJobCollectionFirst + Test serialization/deserialization for BackupPolicyPlanReference """ - # Construct a json representation of a BackupPolicyJobCollectionFirst model - backup_policy_job_collection_first_model_json = {} - backup_policy_job_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20' + # Construct dict forms of any model objects needed in order to build this model. + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' + + backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote + backup_policy_plan_remote_model['region'] = region_reference_model + + # Construct a json representation of a BackupPolicyPlanReference model + backup_policy_plan_reference_model_json = {} + backup_policy_plan_reference_model_json['deleted'] = deleted_model + backup_policy_plan_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model_json['name'] = 'my-policy-plan' + backup_policy_plan_reference_model_json['remote'] = backup_policy_plan_remote_model + backup_policy_plan_reference_model_json['resource_type'] = 'backup_policy_plan' - # Construct a model instance of BackupPolicyJobCollectionFirst by calling from_dict on the json representation - backup_policy_job_collection_first_model = BackupPolicyJobCollectionFirst.from_dict(backup_policy_job_collection_first_model_json) - assert backup_policy_job_collection_first_model != False + # Construct a model instance of BackupPolicyPlanReference by calling from_dict on the json representation + backup_policy_plan_reference_model = BackupPolicyPlanReference.from_dict(backup_policy_plan_reference_model_json) + assert backup_policy_plan_reference_model != False - # Construct a model instance of BackupPolicyJobCollectionFirst by calling from_dict on the json representation - backup_policy_job_collection_first_model_dict = BackupPolicyJobCollectionFirst.from_dict(backup_policy_job_collection_first_model_json).__dict__ - backup_policy_job_collection_first_model2 = BackupPolicyJobCollectionFirst(**backup_policy_job_collection_first_model_dict) + # Construct a model instance of BackupPolicyPlanReference by calling from_dict on the json representation + backup_policy_plan_reference_model_dict = BackupPolicyPlanReference.from_dict(backup_policy_plan_reference_model_json).__dict__ + backup_policy_plan_reference_model2 = BackupPolicyPlanReference(**backup_policy_plan_reference_model_dict) # Verify the model instances are equivalent - assert backup_policy_job_collection_first_model == backup_policy_job_collection_first_model2 + assert backup_policy_plan_reference_model == backup_policy_plan_reference_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_job_collection_first_model_json2 = backup_policy_job_collection_first_model.to_dict() - assert backup_policy_job_collection_first_model_json2 == backup_policy_job_collection_first_model_json + backup_policy_plan_reference_model_json2 = backup_policy_plan_reference_model.to_dict() + assert backup_policy_plan_reference_model_json2 == backup_policy_plan_reference_model_json -class TestModel_BackupPolicyJobCollectionNext: +class TestModel_BackupPolicyPlanRemote: """ - Test Class for BackupPolicyJobCollectionNext + Test Class for BackupPolicyPlanRemote """ - def test_backup_policy_job_collection_next_serialization(self): + def test_backup_policy_plan_remote_serialization(self): """ - Test serialization/deserialization for BackupPolicyJobCollectionNext + Test serialization/deserialization for BackupPolicyPlanRemote """ - # Construct a json representation of a BackupPolicyJobCollectionNext model - backup_policy_job_collection_next_model_json = {} - backup_policy_job_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + # Construct dict forms of any model objects needed in order to build this model. + + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' + + # Construct a json representation of a BackupPolicyPlanRemote model + backup_policy_plan_remote_model_json = {} + backup_policy_plan_remote_model_json['region'] = region_reference_model - # Construct a model instance of BackupPolicyJobCollectionNext by calling from_dict on the json representation - backup_policy_job_collection_next_model = BackupPolicyJobCollectionNext.from_dict(backup_policy_job_collection_next_model_json) - assert backup_policy_job_collection_next_model != False + # Construct a model instance of BackupPolicyPlanRemote by calling from_dict on the json representation + backup_policy_plan_remote_model = BackupPolicyPlanRemote.from_dict(backup_policy_plan_remote_model_json) + assert backup_policy_plan_remote_model != False - # Construct a model instance of BackupPolicyJobCollectionNext by calling from_dict on the json representation - backup_policy_job_collection_next_model_dict = BackupPolicyJobCollectionNext.from_dict(backup_policy_job_collection_next_model_json).__dict__ - backup_policy_job_collection_next_model2 = BackupPolicyJobCollectionNext(**backup_policy_job_collection_next_model_dict) + # Construct a model instance of BackupPolicyPlanRemote by calling from_dict on the json representation + backup_policy_plan_remote_model_dict = BackupPolicyPlanRemote.from_dict(backup_policy_plan_remote_model_json).__dict__ + backup_policy_plan_remote_model2 = BackupPolicyPlanRemote(**backup_policy_plan_remote_model_dict) # Verify the model instances are equivalent - assert backup_policy_job_collection_next_model == backup_policy_job_collection_next_model2 + assert backup_policy_plan_remote_model == backup_policy_plan_remote_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_job_collection_next_model_json2 = backup_policy_job_collection_next_model.to_dict() - assert backup_policy_job_collection_next_model_json2 == backup_policy_job_collection_next_model_json + backup_policy_plan_remote_model_json2 = backup_policy_plan_remote_model.to_dict() + assert backup_policy_plan_remote_model_json2 == backup_policy_plan_remote_model_json -class TestModel_BackupPolicyJobStatusReason: +class TestModel_BackupPolicyPlanRemoteRegionPolicy: """ - Test Class for BackupPolicyJobStatusReason + Test Class for BackupPolicyPlanRemoteRegionPolicy """ - def test_backup_policy_job_status_reason_serialization(self): + def test_backup_policy_plan_remote_region_policy_serialization(self): """ - Test serialization/deserialization for BackupPolicyJobStatusReason + Test serialization/deserialization for BackupPolicyPlanRemoteRegionPolicy """ - # Construct a json representation of a BackupPolicyJobStatusReason model - backup_policy_job_status_reason_model_json = {} - backup_policy_job_status_reason_model_json['code'] = 'source_volume_busy' - backup_policy_job_status_reason_model_json['message'] = 'testString' - backup_policy_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation - backup_policy_job_status_reason_model = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json) - assert backup_policy_job_status_reason_model != False + encryption_key_reference_model = {} # EncryptionKeyReference + encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation - backup_policy_job_status_reason_model_dict = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json).__dict__ - backup_policy_job_status_reason_model2 = BackupPolicyJobStatusReason(**backup_policy_job_status_reason_model_dict) + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' + + # Construct a json representation of a BackupPolicyPlanRemoteRegionPolicy model + backup_policy_plan_remote_region_policy_model_json = {} + backup_policy_plan_remote_region_policy_model_json['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_model_json['encryption_key'] = encryption_key_reference_model + backup_policy_plan_remote_region_policy_model_json['region'] = region_reference_model + + # Construct a model instance of BackupPolicyPlanRemoteRegionPolicy by calling from_dict on the json representation + backup_policy_plan_remote_region_policy_model = BackupPolicyPlanRemoteRegionPolicy.from_dict(backup_policy_plan_remote_region_policy_model_json) + assert backup_policy_plan_remote_region_policy_model != False + + # Construct a model instance of BackupPolicyPlanRemoteRegionPolicy by calling from_dict on the json representation + backup_policy_plan_remote_region_policy_model_dict = BackupPolicyPlanRemoteRegionPolicy.from_dict(backup_policy_plan_remote_region_policy_model_json).__dict__ + backup_policy_plan_remote_region_policy_model2 = BackupPolicyPlanRemoteRegionPolicy(**backup_policy_plan_remote_region_policy_model_dict) # Verify the model instances are equivalent - assert backup_policy_job_status_reason_model == backup_policy_job_status_reason_model2 + assert backup_policy_plan_remote_region_policy_model == backup_policy_plan_remote_region_policy_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_job_status_reason_model_json2 = backup_policy_job_status_reason_model.to_dict() - assert backup_policy_job_status_reason_model_json2 == backup_policy_job_status_reason_model_json + backup_policy_plan_remote_region_policy_model_json2 = backup_policy_plan_remote_region_policy_model.to_dict() + assert backup_policy_plan_remote_region_policy_model_json2 == backup_policy_plan_remote_region_policy_model_json -class TestModel_BackupPolicyPatch: +class TestModel_BackupPolicyPlanRemoteRegionPolicyPrototype: """ - Test Class for BackupPolicyPatch + Test Class for BackupPolicyPlanRemoteRegionPolicyPrototype """ - def test_backup_policy_patch_serialization(self): + def test_backup_policy_plan_remote_region_policy_prototype_serialization(self): """ - Test serialization/deserialization for BackupPolicyPatch + Test serialization/deserialization for BackupPolicyPlanRemoteRegionPolicyPrototype """ - # Construct a json representation of a BackupPolicyPatch model - backup_policy_patch_model_json = {} - backup_policy_patch_model_json['included_content'] = ['data_volumes'] - backup_policy_patch_model_json['match_user_tags'] = ['my-daily-backup-policy'] - backup_policy_patch_model_json['name'] = 'my-backup-policy' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BackupPolicyPatch by calling from_dict on the json representation - backup_policy_patch_model = BackupPolicyPatch.from_dict(backup_policy_patch_model_json) - assert backup_policy_patch_model != False + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - # Construct a model instance of BackupPolicyPatch by calling from_dict on the json representation - backup_policy_patch_model_dict = BackupPolicyPatch.from_dict(backup_policy_patch_model_json).__dict__ - backup_policy_patch_model2 = BackupPolicyPatch(**backup_policy_patch_model_dict) + region_identity_model = {} # RegionIdentityByName + region_identity_model['name'] = 'us-south' + + # Construct a json representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model + backup_policy_plan_remote_region_policy_prototype_model_json = {} + backup_policy_plan_remote_region_policy_prototype_model_json['delete_over_count'] = 5 + backup_policy_plan_remote_region_policy_prototype_model_json['encryption_key'] = encryption_key_identity_model + backup_policy_plan_remote_region_policy_prototype_model_json['region'] = region_identity_model + + # Construct a model instance of BackupPolicyPlanRemoteRegionPolicyPrototype by calling from_dict on the json representation + backup_policy_plan_remote_region_policy_prototype_model = BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(backup_policy_plan_remote_region_policy_prototype_model_json) + assert backup_policy_plan_remote_region_policy_prototype_model != False + + # Construct a model instance of BackupPolicyPlanRemoteRegionPolicyPrototype by calling from_dict on the json representation + backup_policy_plan_remote_region_policy_prototype_model_dict = BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(backup_policy_plan_remote_region_policy_prototype_model_json).__dict__ + backup_policy_plan_remote_region_policy_prototype_model2 = BackupPolicyPlanRemoteRegionPolicyPrototype(**backup_policy_plan_remote_region_policy_prototype_model_dict) # Verify the model instances are equivalent - assert backup_policy_patch_model == backup_policy_patch_model2 + assert backup_policy_plan_remote_region_policy_prototype_model == backup_policy_plan_remote_region_policy_prototype_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_patch_model_json2 = backup_policy_patch_model.to_dict() - assert backup_policy_patch_model_json2 == backup_policy_patch_model_json + backup_policy_plan_remote_region_policy_prototype_model_json2 = backup_policy_plan_remote_region_policy_prototype_model.to_dict() + assert backup_policy_plan_remote_region_policy_prototype_model_json2 == backup_policy_plan_remote_region_policy_prototype_model_json -class TestModel_BackupPolicyPlan: +class TestModel_BareMetalServer: """ - Test Class for BackupPolicyPlan + Test Class for BareMetalServer """ - def test_backup_policy_plan_serialization(self): + def test_bare_metal_server_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlan + Test serialization/deserialization for BareMetalServer """ # Construct dict forms of any model objects needed in order to build this model. - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' - zone_reference_model['name'] = 'us-south-1' + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - backup_policy_plan_clone_policy_model = {} # BackupPolicyPlanClonePolicy - backup_policy_plan_clone_policy_model['max_snapshots'] = 1 - backup_policy_plan_clone_policy_model['zones'] = [zone_reference_model] + bare_metal_server_boot_target_model = {} # BareMetalServerBootTargetBareMetalServerDiskReference + bare_metal_server_boot_target_model['deleted'] = deleted_model + bare_metal_server_boot_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_boot_target_model['id'] = '0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_boot_target_model['name'] = 'my-bare-metal-server-disk' + bare_metal_server_boot_target_model['resource_type'] = 'bare_metal_server_disk' - backup_policy_plan_deletion_trigger_model = {} # BackupPolicyPlanDeletionTrigger - backup_policy_plan_deletion_trigger_model['delete_after'] = 20 - backup_policy_plan_deletion_trigger_model['delete_over_count'] = 20 + bare_metal_server_cpu_model = {} # BareMetalServerCPU + bare_metal_server_cpu_model['architecture'] = 'amd64' + bare_metal_server_cpu_model['core_count'] = 96 + bare_metal_server_cpu_model['socket_count'] = 4 + bare_metal_server_cpu_model['threads_per_core'] = 2 - encryption_key_reference_model = {} # EncryptionKeyReference - encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + bare_metal_server_disk_model = {} # BareMetalServerDisk + bare_metal_server_disk_model['created_at'] = '2024-10-23T06:09:15Z' + bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_disk_model['id'] = '0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_disk_model['interface_type'] = 'sata' + bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk' + bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' + bare_metal_server_disk_model['size'] = 960 - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' + bare_metal_server_firmware_model = {} # BareMetalServerFirmware + bare_metal_server_firmware_model['update'] = 'none' - backup_policy_plan_remote_region_policy_model = {} # BackupPolicyPlanRemoteRegionPolicy - backup_policy_plan_remote_region_policy_model['delete_over_count'] = 1 - backup_policy_plan_remote_region_policy_model['encryption_key'] = encryption_key_reference_model - backup_policy_plan_remote_region_policy_model['region'] = region_reference_model + bare_metal_server_lifecycle_reason_model = {} # BareMetalServerLifecycleReason + bare_metal_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + bare_metal_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + bare_metal_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a json representation of a BackupPolicyPlan model - backup_policy_plan_model_json = {} - backup_policy_plan_model_json['active'] = True - backup_policy_plan_model_json['attach_user_tags'] = ['my-daily-backup-plan'] - backup_policy_plan_model_json['clone_policy'] = backup_policy_plan_clone_policy_model - backup_policy_plan_model_json['copy_user_tags'] = True - backup_policy_plan_model_json['created_at'] = '2019-01-01T12:00:00Z' - backup_policy_plan_model_json['cron_spec'] = '30 */2 * * 1-5' - backup_policy_plan_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_model - backup_policy_plan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_model_json['lifecycle_state'] = 'stable' - backup_policy_plan_model_json['name'] = 'my-policy-plan' - backup_policy_plan_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_model] - backup_policy_plan_model_json['resource_type'] = 'backup_policy_plan' + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '10.0.1.5' + reserved_ip_reference_model['deleted'] = deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - # Construct a model instance of BackupPolicyPlan by calling from_dict on the json representation - backup_policy_plan_model = BackupPolicyPlan.from_dict(backup_policy_plan_model_json) - assert backup_policy_plan_model != False + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' - # Construct a model instance of BackupPolicyPlan by calling from_dict on the json representation - backup_policy_plan_model_dict = BackupPolicyPlan.from_dict(backup_policy_plan_model_json).__dict__ - backup_policy_plan_model2 = BackupPolicyPlan(**backup_policy_plan_model_dict) + virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' + virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' - # Verify the model instances are equivalent - assert backup_policy_plan_model == backup_policy_plan_model2 + bare_metal_server_network_attachment_reference_model = {} # BareMetalServerNetworkAttachmentReference + bare_metal_server_network_attachment_reference_model['deleted'] = deleted_model + bare_metal_server_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_reference_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_reference_model['name'] = 'my-bare-metal-server-network-attachment' + bare_metal_server_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model + bare_metal_server_network_attachment_reference_model['resource_type'] = 'bare_metal_server_network_attachment' + bare_metal_server_network_attachment_reference_model['subnet'] = subnet_reference_model + bare_metal_server_network_attachment_reference_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model - # Convert model instance back to dict and verify no loss of data - backup_policy_plan_model_json2 = backup_policy_plan_model.to_dict() - assert backup_policy_plan_model_json2 == backup_policy_plan_model_json + network_interface_bare_metal_server_context_reference_model = {} # NetworkInterfaceBareMetalServerContextReference + network_interface_bare_metal_server_context_reference_model['deleted'] = deleted_model + network_interface_bare_metal_server_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + network_interface_bare_metal_server_context_reference_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + network_interface_bare_metal_server_context_reference_model['name'] = 'my-primary-network-interface' + network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model + network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface' + network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model + + bare_metal_server_profile_reference_model = {} # BareMetalServerProfileReference + bare_metal_server_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_server/profiles/bx2-metal-192x768' + bare_metal_server_profile_reference_model['name'] = 'bx2-metal-192x768' + bare_metal_server_profile_reference_model['resource_type'] = 'bare_metal_server_profile' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['name'] = 'Default' -class TestModel_BackupPolicyPlanClonePolicy: - """ - Test Class for BackupPolicyPlanClonePolicy - """ + bare_metal_server_status_reason_model = {} # BareMetalServerStatusReason + bare_metal_server_status_reason_model['code'] = 'cannot_start_capacity' + bare_metal_server_status_reason_model['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.' + bare_metal_server_status_reason_model['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html' - def test_backup_policy_plan_clone_policy_serialization(self): - """ - Test serialization/deserialization for BackupPolicyPlanClonePolicy - """ + bare_metal_server_trusted_platform_module_model = {} # BareMetalServerTrustedPlatformModule + bare_metal_server_trusted_platform_module_model['enabled'] = False + bare_metal_server_trusted_platform_module_model['mode'] = 'disabled' + bare_metal_server_trusted_platform_module_model['supported_modes'] = ['disabled', 'tpm_2'] - # Construct dict forms of any model objects needed in order to build this model. + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' zone_reference_model = {} # ZoneReference zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - # Construct a json representation of a BackupPolicyPlanClonePolicy model - backup_policy_plan_clone_policy_model_json = {} - backup_policy_plan_clone_policy_model_json['max_snapshots'] = 1 - backup_policy_plan_clone_policy_model_json['zones'] = [zone_reference_model] + # Construct a json representation of a BareMetalServer model + bare_metal_server_model_json = {} + bare_metal_server_model_json['bandwidth'] = 20000 + bare_metal_server_model_json['boot_target'] = bare_metal_server_boot_target_model + bare_metal_server_model_json['cpu'] = bare_metal_server_cpu_model + bare_metal_server_model_json['created_at'] = '2019-01-01T12:00:00Z' + bare_metal_server_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304' + bare_metal_server_model_json['disks'] = [bare_metal_server_disk_model] + bare_metal_server_model_json['enable_secure_boot'] = False + bare_metal_server_model_json['firmware'] = bare_metal_server_firmware_model + bare_metal_server_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304' + bare_metal_server_model_json['id'] = '0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304' + bare_metal_server_model_json['lifecycle_reasons'] = [bare_metal_server_lifecycle_reason_model] + bare_metal_server_model_json['lifecycle_state'] = 'stable' + bare_metal_server_model_json['memory'] = 1536 + bare_metal_server_model_json['name'] = 'my-bare-metal-server' + bare_metal_server_model_json['network_attachments'] = [bare_metal_server_network_attachment_reference_model] + bare_metal_server_model_json['network_interfaces'] = [network_interface_bare_metal_server_context_reference_model] + bare_metal_server_model_json['primary_network_attachment'] = bare_metal_server_network_attachment_reference_model + bare_metal_server_model_json['primary_network_interface'] = network_interface_bare_metal_server_context_reference_model + bare_metal_server_model_json['profile'] = bare_metal_server_profile_reference_model + bare_metal_server_model_json['resource_group'] = resource_group_reference_model + bare_metal_server_model_json['resource_type'] = 'bare_metal_server' + bare_metal_server_model_json['status'] = 'deleting' + bare_metal_server_model_json['status_reasons'] = [bare_metal_server_status_reason_model] + bare_metal_server_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_model + bare_metal_server_model_json['vpc'] = vpc_reference_model + bare_metal_server_model_json['zone'] = zone_reference_model - # Construct a model instance of BackupPolicyPlanClonePolicy by calling from_dict on the json representation - backup_policy_plan_clone_policy_model = BackupPolicyPlanClonePolicy.from_dict(backup_policy_plan_clone_policy_model_json) - assert backup_policy_plan_clone_policy_model != False + # Construct a model instance of BareMetalServer by calling from_dict on the json representation + bare_metal_server_model = BareMetalServer.from_dict(bare_metal_server_model_json) + assert bare_metal_server_model != False - # Construct a model instance of BackupPolicyPlanClonePolicy by calling from_dict on the json representation - backup_policy_plan_clone_policy_model_dict = BackupPolicyPlanClonePolicy.from_dict(backup_policy_plan_clone_policy_model_json).__dict__ - backup_policy_plan_clone_policy_model2 = BackupPolicyPlanClonePolicy(**backup_policy_plan_clone_policy_model_dict) + # Construct a model instance of BareMetalServer by calling from_dict on the json representation + bare_metal_server_model_dict = BareMetalServer.from_dict(bare_metal_server_model_json).__dict__ + bare_metal_server_model2 = BareMetalServer(**bare_metal_server_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_clone_policy_model == backup_policy_plan_clone_policy_model2 + assert bare_metal_server_model == bare_metal_server_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_clone_policy_model_json2 = backup_policy_plan_clone_policy_model.to_dict() - assert backup_policy_plan_clone_policy_model_json2 == backup_policy_plan_clone_policy_model_json + bare_metal_server_model_json2 = bare_metal_server_model.to_dict() + assert bare_metal_server_model_json2 == bare_metal_server_model_json -class TestModel_BackupPolicyPlanClonePolicyPatch: +class TestModel_BareMetalServerCPU: """ - Test Class for BackupPolicyPlanClonePolicyPatch + Test Class for BareMetalServerCPU """ - def test_backup_policy_plan_clone_policy_patch_serialization(self): + def test_bare_metal_server_cpu_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanClonePolicyPatch + Test serialization/deserialization for BareMetalServerCPU """ - # 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 BackupPolicyPlanClonePolicyPatch model - backup_policy_plan_clone_policy_patch_model_json = {} - backup_policy_plan_clone_policy_patch_model_json['max_snapshots'] = 1 - backup_policy_plan_clone_policy_patch_model_json['zones'] = [zone_identity_model] + # Construct a json representation of a BareMetalServerCPU model + bare_metal_server_cpu_model_json = {} + bare_metal_server_cpu_model_json['architecture'] = 'amd64' + bare_metal_server_cpu_model_json['core_count'] = 80 + bare_metal_server_cpu_model_json['socket_count'] = 4 + bare_metal_server_cpu_model_json['threads_per_core'] = 2 - # Construct a model instance of BackupPolicyPlanClonePolicyPatch by calling from_dict on the json representation - backup_policy_plan_clone_policy_patch_model = BackupPolicyPlanClonePolicyPatch.from_dict(backup_policy_plan_clone_policy_patch_model_json) - assert backup_policy_plan_clone_policy_patch_model != False + # Construct a model instance of BareMetalServerCPU by calling from_dict on the json representation + bare_metal_server_cpu_model = BareMetalServerCPU.from_dict(bare_metal_server_cpu_model_json) + assert bare_metal_server_cpu_model != False - # Construct a model instance of BackupPolicyPlanClonePolicyPatch by calling from_dict on the json representation - backup_policy_plan_clone_policy_patch_model_dict = BackupPolicyPlanClonePolicyPatch.from_dict(backup_policy_plan_clone_policy_patch_model_json).__dict__ - backup_policy_plan_clone_policy_patch_model2 = BackupPolicyPlanClonePolicyPatch(**backup_policy_plan_clone_policy_patch_model_dict) + # Construct a model instance of BareMetalServerCPU by calling from_dict on the json representation + bare_metal_server_cpu_model_dict = BareMetalServerCPU.from_dict(bare_metal_server_cpu_model_json).__dict__ + bare_metal_server_cpu_model2 = BareMetalServerCPU(**bare_metal_server_cpu_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_clone_policy_patch_model == backup_policy_plan_clone_policy_patch_model2 + assert bare_metal_server_cpu_model == bare_metal_server_cpu_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_clone_policy_patch_model_json2 = backup_policy_plan_clone_policy_patch_model.to_dict() - assert backup_policy_plan_clone_policy_patch_model_json2 == backup_policy_plan_clone_policy_patch_model_json + bare_metal_server_cpu_model_json2 = bare_metal_server_cpu_model.to_dict() + assert bare_metal_server_cpu_model_json2 == bare_metal_server_cpu_model_json -class TestModel_BackupPolicyPlanClonePolicyPrototype: +class TestModel_BareMetalServerCollection: """ - Test Class for BackupPolicyPlanClonePolicyPrototype + Test Class for BareMetalServerCollection """ - def test_backup_policy_plan_clone_policy_prototype_serialization(self): + def test_bare_metal_server_collection_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanClonePolicyPrototype + Test serialization/deserialization for BareMetalServerCollection """ # 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' + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a json representation of a BackupPolicyPlanClonePolicyPrototype model - backup_policy_plan_clone_policy_prototype_model_json = {} - backup_policy_plan_clone_policy_prototype_model_json['max_snapshots'] = 5 - backup_policy_plan_clone_policy_prototype_model_json['zones'] = [zone_identity_model] + bare_metal_server_boot_target_model = {} # BareMetalServerBootTargetBareMetalServerDiskReference + bare_metal_server_boot_target_model['deleted'] = deleted_model + bare_metal_server_boot_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_boot_target_model['id'] = '0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_boot_target_model['name'] = 'my-bare-metal-server-disk' + bare_metal_server_boot_target_model['resource_type'] = 'bare_metal_server_disk' - # Construct a model instance of BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation - backup_policy_plan_clone_policy_prototype_model = BackupPolicyPlanClonePolicyPrototype.from_dict(backup_policy_plan_clone_policy_prototype_model_json) - assert backup_policy_plan_clone_policy_prototype_model != False + bare_metal_server_cpu_model = {} # BareMetalServerCPU + bare_metal_server_cpu_model['architecture'] = 'amd64' + bare_metal_server_cpu_model['core_count'] = 96 + bare_metal_server_cpu_model['socket_count'] = 4 + bare_metal_server_cpu_model['threads_per_core'] = 2 - # Construct a model instance of BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation - backup_policy_plan_clone_policy_prototype_model_dict = BackupPolicyPlanClonePolicyPrototype.from_dict(backup_policy_plan_clone_policy_prototype_model_json).__dict__ - backup_policy_plan_clone_policy_prototype_model2 = BackupPolicyPlanClonePolicyPrototype(**backup_policy_plan_clone_policy_prototype_model_dict) + bare_metal_server_disk_model = {} # BareMetalServerDisk + bare_metal_server_disk_model['created_at'] = '2024-10-23T06:09:15Z' + bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_disk_model['id'] = '0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_disk_model['interface_type'] = 'sata' + bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk' + bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' + bare_metal_server_disk_model['size'] = 960 - # Verify the model instances are equivalent - assert backup_policy_plan_clone_policy_prototype_model == backup_policy_plan_clone_policy_prototype_model2 + bare_metal_server_firmware_model = {} # BareMetalServerFirmware + bare_metal_server_firmware_model['update'] = 'none' - # Convert model instance back to dict and verify no loss of data - backup_policy_plan_clone_policy_prototype_model_json2 = backup_policy_plan_clone_policy_prototype_model.to_dict() - assert backup_policy_plan_clone_policy_prototype_model_json2 == backup_policy_plan_clone_policy_prototype_model_json + bare_metal_server_lifecycle_reason_model = {} # BareMetalServerLifecycleReason + bare_metal_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + bare_metal_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + bare_metal_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '10.0.1.5' + reserved_ip_reference_model['deleted'] = deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' -class TestModel_BackupPolicyPlanCollection: - """ - Test Class for BackupPolicyPlanCollection - """ + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' - def test_backup_policy_plan_collection_serialization(self): - """ - Test serialization/deserialization for BackupPolicyPlanCollection - """ + virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' + virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' - # Construct dict forms of any model objects needed in order to build this model. + bare_metal_server_network_attachment_reference_model = {} # BareMetalServerNetworkAttachmentReference + bare_metal_server_network_attachment_reference_model['deleted'] = deleted_model + bare_metal_server_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_reference_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_reference_model['name'] = 'my-bare-metal-server-network-attachment' + bare_metal_server_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model + bare_metal_server_network_attachment_reference_model['resource_type'] = 'bare_metal_server_network_attachment' + bare_metal_server_network_attachment_reference_model['subnet'] = subnet_reference_model + bare_metal_server_network_attachment_reference_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model - backup_policy_plan_collection_first_model = {} # BackupPolicyPlanCollectionFirst - backup_policy_plan_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?limit=20' + network_interface_bare_metal_server_context_reference_model = {} # NetworkInterfaceBareMetalServerContextReference + network_interface_bare_metal_server_context_reference_model['deleted'] = deleted_model + network_interface_bare_metal_server_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + network_interface_bare_metal_server_context_reference_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + network_interface_bare_metal_server_context_reference_model['name'] = 'my-primary-network-interface' + network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model + network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface' + network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model - backup_policy_plan_collection_next_model = {} # BackupPolicyPlanCollectionNext - backup_policy_plan_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + bare_metal_server_profile_reference_model = {} # BareMetalServerProfileReference + bare_metal_server_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_server/profiles/bx2-metal-192x768' + bare_metal_server_profile_reference_model['name'] = 'bx2-metal-192x768' + bare_metal_server_profile_reference_model['resource_type'] = 'bare_metal_server_profile' - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' - zone_reference_model['name'] = 'us-south-1' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['name'] = 'Default' - backup_policy_plan_clone_policy_model = {} # BackupPolicyPlanClonePolicy - backup_policy_plan_clone_policy_model['max_snapshots'] = 1 - backup_policy_plan_clone_policy_model['zones'] = [zone_reference_model] + bare_metal_server_status_reason_model = {} # BareMetalServerStatusReason + bare_metal_server_status_reason_model['code'] = 'cannot_start_capacity' + bare_metal_server_status_reason_model['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.' + bare_metal_server_status_reason_model['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html' - backup_policy_plan_deletion_trigger_model = {} # BackupPolicyPlanDeletionTrigger - backup_policy_plan_deletion_trigger_model['delete_after'] = 20 - backup_policy_plan_deletion_trigger_model['delete_over_count'] = 20 + bare_metal_server_trusted_platform_module_model = {} # BareMetalServerTrustedPlatformModule + bare_metal_server_trusted_platform_module_model['enabled'] = False + bare_metal_server_trusted_platform_module_model['mode'] = 'disabled' + bare_metal_server_trusted_platform_module_model['supported_modes'] = ['disabled', 'tpm_2'] - encryption_key_reference_model = {} # EncryptionKeyReference - encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' - backup_policy_plan_remote_region_policy_model = {} # BackupPolicyPlanRemoteRegionPolicy - backup_policy_plan_remote_region_policy_model['delete_over_count'] = 1 - backup_policy_plan_remote_region_policy_model['encryption_key'] = encryption_key_reference_model - backup_policy_plan_remote_region_policy_model['region'] = region_reference_model + bare_metal_server_model = {} # BareMetalServer + bare_metal_server_model['bandwidth'] = 100000 + bare_metal_server_model['boot_target'] = bare_metal_server_boot_target_model + bare_metal_server_model['cpu'] = bare_metal_server_cpu_model + bare_metal_server_model['created_at'] = '2024-10-22T06:09:15Z' + bare_metal_server_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304' + bare_metal_server_model['disks'] = [bare_metal_server_disk_model] + bare_metal_server_model['enable_secure_boot'] = False + bare_metal_server_model['firmware'] = bare_metal_server_firmware_model + bare_metal_server_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304' + bare_metal_server_model['id'] = '0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304' + bare_metal_server_model['lifecycle_reasons'] = [bare_metal_server_lifecycle_reason_model] + bare_metal_server_model['lifecycle_state'] = 'stable' + bare_metal_server_model['memory'] = 768 + bare_metal_server_model['name'] = 'my-bare-metal-server' + bare_metal_server_model['network_attachments'] = [bare_metal_server_network_attachment_reference_model] + bare_metal_server_model['network_interfaces'] = [network_interface_bare_metal_server_context_reference_model] + bare_metal_server_model['primary_network_attachment'] = bare_metal_server_network_attachment_reference_model + bare_metal_server_model['primary_network_interface'] = network_interface_bare_metal_server_context_reference_model + bare_metal_server_model['profile'] = bare_metal_server_profile_reference_model + bare_metal_server_model['resource_group'] = resource_group_reference_model + bare_metal_server_model['resource_type'] = 'bare_metal_server' + bare_metal_server_model['status'] = 'running' + bare_metal_server_model['status_reasons'] = [bare_metal_server_status_reason_model] + bare_metal_server_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_model + bare_metal_server_model['vpc'] = vpc_reference_model + bare_metal_server_model['zone'] = zone_reference_model - backup_policy_plan_model = {} # BackupPolicyPlan - backup_policy_plan_model['active'] = True - backup_policy_plan_model['attach_user_tags'] = ['my-daily-backup-plan'] - backup_policy_plan_model['clone_policy'] = backup_policy_plan_clone_policy_model - backup_policy_plan_model['copy_user_tags'] = True - backup_policy_plan_model['created_at'] = '2019-01-01T12:00:00Z' - backup_policy_plan_model['cron_spec'] = '30 */2 * * 1-5' - backup_policy_plan_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_model - backup_policy_plan_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_model['lifecycle_state'] = 'stable' - backup_policy_plan_model['name'] = 'my-policy-plan' - backup_policy_plan_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_model] - backup_policy_plan_model['resource_type'] = 'backup_policy_plan' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=50' - # Construct a json representation of a BackupPolicyPlanCollection model - backup_policy_plan_collection_model_json = {} - backup_policy_plan_collection_model_json['first'] = backup_policy_plan_collection_first_model - backup_policy_plan_collection_model_json['limit'] = 20 - backup_policy_plan_collection_model_json['next'] = backup_policy_plan_collection_next_model - backup_policy_plan_collection_model_json['plans'] = [backup_policy_plan_model] - backup_policy_plan_collection_model_json['total_count'] = 132 + # Construct a json representation of a BareMetalServerCollection model + bare_metal_server_collection_model_json = {} + bare_metal_server_collection_model_json['bare_metal_servers'] = [bare_metal_server_model] + bare_metal_server_collection_model_json['first'] = page_link_model + bare_metal_server_collection_model_json['limit'] = 20 + bare_metal_server_collection_model_json['next'] = page_link_model + bare_metal_server_collection_model_json['total_count'] = 132 - # Construct a model instance of BackupPolicyPlanCollection by calling from_dict on the json representation - backup_policy_plan_collection_model = BackupPolicyPlanCollection.from_dict(backup_policy_plan_collection_model_json) - assert backup_policy_plan_collection_model != False + # Construct a model instance of BareMetalServerCollection by calling from_dict on the json representation + bare_metal_server_collection_model = BareMetalServerCollection.from_dict(bare_metal_server_collection_model_json) + assert bare_metal_server_collection_model != False - # Construct a model instance of BackupPolicyPlanCollection by calling from_dict on the json representation - backup_policy_plan_collection_model_dict = BackupPolicyPlanCollection.from_dict(backup_policy_plan_collection_model_json).__dict__ - backup_policy_plan_collection_model2 = BackupPolicyPlanCollection(**backup_policy_plan_collection_model_dict) + # Construct a model instance of BareMetalServerCollection by calling from_dict on the json representation + bare_metal_server_collection_model_dict = BareMetalServerCollection.from_dict(bare_metal_server_collection_model_json).__dict__ + bare_metal_server_collection_model2 = BareMetalServerCollection(**bare_metal_server_collection_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_collection_model == backup_policy_plan_collection_model2 + assert bare_metal_server_collection_model == bare_metal_server_collection_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_collection_model_json2 = backup_policy_plan_collection_model.to_dict() - assert backup_policy_plan_collection_model_json2 == backup_policy_plan_collection_model_json + bare_metal_server_collection_model_json2 = bare_metal_server_collection_model.to_dict() + assert bare_metal_server_collection_model_json2 == bare_metal_server_collection_model_json -class TestModel_BackupPolicyPlanCollectionFirst: +class TestModel_BareMetalServerConsoleAccessToken: """ - Test Class for BackupPolicyPlanCollectionFirst + Test Class for BareMetalServerConsoleAccessToken """ - def test_backup_policy_plan_collection_first_serialization(self): + def test_bare_metal_server_console_access_token_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanCollectionFirst + Test serialization/deserialization for BareMetalServerConsoleAccessToken """ - # Construct a json representation of a BackupPolicyPlanCollectionFirst model - backup_policy_plan_collection_first_model_json = {} - backup_policy_plan_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?limit=20' + # Construct a json representation of a BareMetalServerConsoleAccessToken model + bare_metal_server_console_access_token_model_json = {} + bare_metal_server_console_access_token_model_json['access_token'] = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI' + bare_metal_server_console_access_token_model_json['console_type'] = 'serial' + bare_metal_server_console_access_token_model_json['created_at'] = '2020-07-27T21:50:14Z' + bare_metal_server_console_access_token_model_json['expires_at'] = '2020-07-27T21:51:14Z' + bare_metal_server_console_access_token_model_json['force'] = False + bare_metal_server_console_access_token_model_json['href'] = 'wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI' - # Construct a model instance of BackupPolicyPlanCollectionFirst by calling from_dict on the json representation - backup_policy_plan_collection_first_model = BackupPolicyPlanCollectionFirst.from_dict(backup_policy_plan_collection_first_model_json) - assert backup_policy_plan_collection_first_model != False + # Construct a model instance of BareMetalServerConsoleAccessToken by calling from_dict on the json representation + bare_metal_server_console_access_token_model = BareMetalServerConsoleAccessToken.from_dict(bare_metal_server_console_access_token_model_json) + assert bare_metal_server_console_access_token_model != False - # Construct a model instance of BackupPolicyPlanCollectionFirst by calling from_dict on the json representation - backup_policy_plan_collection_first_model_dict = BackupPolicyPlanCollectionFirst.from_dict(backup_policy_plan_collection_first_model_json).__dict__ - backup_policy_plan_collection_first_model2 = BackupPolicyPlanCollectionFirst(**backup_policy_plan_collection_first_model_dict) + # Construct a model instance of BareMetalServerConsoleAccessToken by calling from_dict on the json representation + bare_metal_server_console_access_token_model_dict = BareMetalServerConsoleAccessToken.from_dict(bare_metal_server_console_access_token_model_json).__dict__ + bare_metal_server_console_access_token_model2 = BareMetalServerConsoleAccessToken(**bare_metal_server_console_access_token_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_collection_first_model == backup_policy_plan_collection_first_model2 + assert bare_metal_server_console_access_token_model == bare_metal_server_console_access_token_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_collection_first_model_json2 = backup_policy_plan_collection_first_model.to_dict() - assert backup_policy_plan_collection_first_model_json2 == backup_policy_plan_collection_first_model_json + bare_metal_server_console_access_token_model_json2 = bare_metal_server_console_access_token_model.to_dict() + assert bare_metal_server_console_access_token_model_json2 == bare_metal_server_console_access_token_model_json -class TestModel_BackupPolicyPlanCollectionNext: +class TestModel_BareMetalServerDisk: """ - Test Class for BackupPolicyPlanCollectionNext + Test Class for BareMetalServerDisk """ - def test_backup_policy_plan_collection_next_serialization(self): + def test_bare_metal_server_disk_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanCollectionNext + Test serialization/deserialization for BareMetalServerDisk """ - # Construct a json representation of a BackupPolicyPlanCollectionNext model - backup_policy_plan_collection_next_model_json = {} - backup_policy_plan_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + # Construct a json representation of a BareMetalServerDisk model + bare_metal_server_disk_model_json = {} + bare_metal_server_disk_model_json['created_at'] = '2019-01-01T12:00:00Z' + bare_metal_server_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_disk_model_json['interface_type'] = 'fcp' + bare_metal_server_disk_model_json['name'] = 'my-bare-metal-server-disk' + bare_metal_server_disk_model_json['resource_type'] = 'bare_metal_server_disk' + bare_metal_server_disk_model_json['size'] = 100 - # Construct a model instance of BackupPolicyPlanCollectionNext by calling from_dict on the json representation - backup_policy_plan_collection_next_model = BackupPolicyPlanCollectionNext.from_dict(backup_policy_plan_collection_next_model_json) - assert backup_policy_plan_collection_next_model != False + # Construct a model instance of BareMetalServerDisk by calling from_dict on the json representation + bare_metal_server_disk_model = BareMetalServerDisk.from_dict(bare_metal_server_disk_model_json) + assert bare_metal_server_disk_model != False - # Construct a model instance of BackupPolicyPlanCollectionNext by calling from_dict on the json representation - backup_policy_plan_collection_next_model_dict = BackupPolicyPlanCollectionNext.from_dict(backup_policy_plan_collection_next_model_json).__dict__ - backup_policy_plan_collection_next_model2 = BackupPolicyPlanCollectionNext(**backup_policy_plan_collection_next_model_dict) + # Construct a model instance of BareMetalServerDisk by calling from_dict on the json representation + bare_metal_server_disk_model_dict = BareMetalServerDisk.from_dict(bare_metal_server_disk_model_json).__dict__ + bare_metal_server_disk_model2 = BareMetalServerDisk(**bare_metal_server_disk_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_collection_next_model == backup_policy_plan_collection_next_model2 + assert bare_metal_server_disk_model == bare_metal_server_disk_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_collection_next_model_json2 = backup_policy_plan_collection_next_model.to_dict() - assert backup_policy_plan_collection_next_model_json2 == backup_policy_plan_collection_next_model_json + bare_metal_server_disk_model_json2 = bare_metal_server_disk_model.to_dict() + assert bare_metal_server_disk_model_json2 == bare_metal_server_disk_model_json -class TestModel_BackupPolicyPlanDeletionTrigger: +class TestModel_BareMetalServerDiskCollection: """ - Test Class for BackupPolicyPlanDeletionTrigger + Test Class for BareMetalServerDiskCollection """ - def test_backup_policy_plan_deletion_trigger_serialization(self): + def test_bare_metal_server_disk_collection_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanDeletionTrigger + Test serialization/deserialization for BareMetalServerDiskCollection """ - # Construct a json representation of a BackupPolicyPlanDeletionTrigger model - backup_policy_plan_deletion_trigger_model_json = {} - backup_policy_plan_deletion_trigger_model_json['delete_after'] = 20 - backup_policy_plan_deletion_trigger_model_json['delete_over_count'] = 20 + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BackupPolicyPlanDeletionTrigger by calling from_dict on the json representation - backup_policy_plan_deletion_trigger_model = BackupPolicyPlanDeletionTrigger.from_dict(backup_policy_plan_deletion_trigger_model_json) - assert backup_policy_plan_deletion_trigger_model != False + bare_metal_server_disk_model = {} # BareMetalServerDisk + bare_metal_server_disk_model['created_at'] = '2024-10-23T06:09:15Z' + bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_disk_model['id'] = '0717-3744f199-6ccc-4698-8772-bb3937348c96' + bare_metal_server_disk_model['interface_type'] = 'sata' + bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk' + bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' + bare_metal_server_disk_model['size'] = 960 - # Construct a model instance of BackupPolicyPlanDeletionTrigger by calling from_dict on the json representation - backup_policy_plan_deletion_trigger_model_dict = BackupPolicyPlanDeletionTrigger.from_dict(backup_policy_plan_deletion_trigger_model_json).__dict__ - backup_policy_plan_deletion_trigger_model2 = BackupPolicyPlanDeletionTrigger(**backup_policy_plan_deletion_trigger_model_dict) + # Construct a json representation of a BareMetalServerDiskCollection model + bare_metal_server_disk_collection_model_json = {} + bare_metal_server_disk_collection_model_json['disks'] = [bare_metal_server_disk_model] + + # Construct a model instance of BareMetalServerDiskCollection by calling from_dict on the json representation + bare_metal_server_disk_collection_model = BareMetalServerDiskCollection.from_dict(bare_metal_server_disk_collection_model_json) + assert bare_metal_server_disk_collection_model != False + + # Construct a model instance of BareMetalServerDiskCollection by calling from_dict on the json representation + bare_metal_server_disk_collection_model_dict = BareMetalServerDiskCollection.from_dict(bare_metal_server_disk_collection_model_json).__dict__ + bare_metal_server_disk_collection_model2 = BareMetalServerDiskCollection(**bare_metal_server_disk_collection_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_deletion_trigger_model == backup_policy_plan_deletion_trigger_model2 + assert bare_metal_server_disk_collection_model == bare_metal_server_disk_collection_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_deletion_trigger_model_json2 = backup_policy_plan_deletion_trigger_model.to_dict() - assert backup_policy_plan_deletion_trigger_model_json2 == backup_policy_plan_deletion_trigger_model_json + bare_metal_server_disk_collection_model_json2 = bare_metal_server_disk_collection_model.to_dict() + assert bare_metal_server_disk_collection_model_json2 == bare_metal_server_disk_collection_model_json -class TestModel_BackupPolicyPlanDeletionTriggerPatch: +class TestModel_BareMetalServerDiskPatch: """ - Test Class for BackupPolicyPlanDeletionTriggerPatch + Test Class for BareMetalServerDiskPatch """ - def test_backup_policy_plan_deletion_trigger_patch_serialization(self): + def test_bare_metal_server_disk_patch_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanDeletionTriggerPatch + Test serialization/deserialization for BareMetalServerDiskPatch """ - # Construct a json representation of a BackupPolicyPlanDeletionTriggerPatch model - backup_policy_plan_deletion_trigger_patch_model_json = {} - backup_policy_plan_deletion_trigger_patch_model_json['delete_after'] = 20 - backup_policy_plan_deletion_trigger_patch_model_json['delete_over_count'] = 1 + # Construct a json representation of a BareMetalServerDiskPatch model + bare_metal_server_disk_patch_model_json = {} + bare_metal_server_disk_patch_model_json['name'] = 'my-bare-metal-server-disk-updated' - # Construct a model instance of BackupPolicyPlanDeletionTriggerPatch by calling from_dict on the json representation - backup_policy_plan_deletion_trigger_patch_model = BackupPolicyPlanDeletionTriggerPatch.from_dict(backup_policy_plan_deletion_trigger_patch_model_json) - assert backup_policy_plan_deletion_trigger_patch_model != False + # Construct a model instance of BareMetalServerDiskPatch by calling from_dict on the json representation + bare_metal_server_disk_patch_model = BareMetalServerDiskPatch.from_dict(bare_metal_server_disk_patch_model_json) + assert bare_metal_server_disk_patch_model != False - # Construct a model instance of BackupPolicyPlanDeletionTriggerPatch by calling from_dict on the json representation - backup_policy_plan_deletion_trigger_patch_model_dict = BackupPolicyPlanDeletionTriggerPatch.from_dict(backup_policy_plan_deletion_trigger_patch_model_json).__dict__ - backup_policy_plan_deletion_trigger_patch_model2 = BackupPolicyPlanDeletionTriggerPatch(**backup_policy_plan_deletion_trigger_patch_model_dict) + # Construct a model instance of BareMetalServerDiskPatch by calling from_dict on the json representation + bare_metal_server_disk_patch_model_dict = BareMetalServerDiskPatch.from_dict(bare_metal_server_disk_patch_model_json).__dict__ + bare_metal_server_disk_patch_model2 = BareMetalServerDiskPatch(**bare_metal_server_disk_patch_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_deletion_trigger_patch_model == backup_policy_plan_deletion_trigger_patch_model2 + assert bare_metal_server_disk_patch_model == bare_metal_server_disk_patch_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_deletion_trigger_patch_model_json2 = backup_policy_plan_deletion_trigger_patch_model.to_dict() - assert backup_policy_plan_deletion_trigger_patch_model_json2 == backup_policy_plan_deletion_trigger_patch_model_json + bare_metal_server_disk_patch_model_json2 = bare_metal_server_disk_patch_model.to_dict() + assert bare_metal_server_disk_patch_model_json2 == bare_metal_server_disk_patch_model_json -class TestModel_BackupPolicyPlanDeletionTriggerPrototype: +class TestModel_BareMetalServerFirmware: """ - Test Class for BackupPolicyPlanDeletionTriggerPrototype + Test Class for BareMetalServerFirmware """ - def test_backup_policy_plan_deletion_trigger_prototype_serialization(self): + def test_bare_metal_server_firmware_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanDeletionTriggerPrototype + Test serialization/deserialization for BareMetalServerFirmware """ - # Construct a json representation of a BackupPolicyPlanDeletionTriggerPrototype model - backup_policy_plan_deletion_trigger_prototype_model_json = {} - backup_policy_plan_deletion_trigger_prototype_model_json['delete_after'] = 20 - backup_policy_plan_deletion_trigger_prototype_model_json['delete_over_count'] = 20 + # Construct a json representation of a BareMetalServerFirmware model + bare_metal_server_firmware_model_json = {} + bare_metal_server_firmware_model_json['update'] = 'none' - # Construct a model instance of BackupPolicyPlanDeletionTriggerPrototype by calling from_dict on the json representation - backup_policy_plan_deletion_trigger_prototype_model = BackupPolicyPlanDeletionTriggerPrototype.from_dict(backup_policy_plan_deletion_trigger_prototype_model_json) - assert backup_policy_plan_deletion_trigger_prototype_model != False + # Construct a model instance of BareMetalServerFirmware by calling from_dict on the json representation + bare_metal_server_firmware_model = BareMetalServerFirmware.from_dict(bare_metal_server_firmware_model_json) + assert bare_metal_server_firmware_model != False - # Construct a model instance of BackupPolicyPlanDeletionTriggerPrototype by calling from_dict on the json representation - backup_policy_plan_deletion_trigger_prototype_model_dict = BackupPolicyPlanDeletionTriggerPrototype.from_dict(backup_policy_plan_deletion_trigger_prototype_model_json).__dict__ - backup_policy_plan_deletion_trigger_prototype_model2 = BackupPolicyPlanDeletionTriggerPrototype(**backup_policy_plan_deletion_trigger_prototype_model_dict) + # Construct a model instance of BareMetalServerFirmware by calling from_dict on the json representation + bare_metal_server_firmware_model_dict = BareMetalServerFirmware.from_dict(bare_metal_server_firmware_model_json).__dict__ + bare_metal_server_firmware_model2 = BareMetalServerFirmware(**bare_metal_server_firmware_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_deletion_trigger_prototype_model == backup_policy_plan_deletion_trigger_prototype_model2 + assert bare_metal_server_firmware_model == bare_metal_server_firmware_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_deletion_trigger_prototype_model_json2 = backup_policy_plan_deletion_trigger_prototype_model.to_dict() - assert backup_policy_plan_deletion_trigger_prototype_model_json2 == backup_policy_plan_deletion_trigger_prototype_model_json + bare_metal_server_firmware_model_json2 = bare_metal_server_firmware_model.to_dict() + assert bare_metal_server_firmware_model_json2 == bare_metal_server_firmware_model_json -class TestModel_BackupPolicyPlanPatch: +class TestModel_BareMetalServerInitialization: """ - Test Class for BackupPolicyPlanPatch + Test Class for BareMetalServerInitialization """ - def test_backup_policy_plan_patch_serialization(self): + def test_bare_metal_server_initialization_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanPatch + Test serialization/deserialization for BareMetalServerInitialization """ # 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' + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - backup_policy_plan_clone_policy_patch_model = {} # BackupPolicyPlanClonePolicyPatch - backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1 - backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model] + account_reference_model = {} # AccountReference + account_reference_model['id'] = 'bb1b52262f7441a586f49068482f1e60' + account_reference_model['resource_type'] = 'account' - backup_policy_plan_deletion_trigger_patch_model = {} # BackupPolicyPlanDeletionTriggerPatch - backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20 - backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 1 + region_reference_model = {} # RegionReference + region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' + region_reference_model['name'] = 'us-south' - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + image_remote_model = {} # ImageRemote + image_remote_model['account'] = account_reference_model + image_remote_model['region'] = region_reference_model - region_identity_model = {} # RegionIdentityByName - region_identity_model['name'] = 'us-south' + image_reference_model = {} # ImageReference + image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model['deleted'] = deleted_model + image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model['id'] = 'r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_reference_model['name'] = 'my-image' + image_reference_model['remote'] = image_remote_model + image_reference_model['resource_type'] = 'image' - backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 - backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model - backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model + key_reference_model = {} # KeyReference + key_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['deleted'] = deleted_model + key_reference_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E' + key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['id'] = 'r006-82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['name'] = 'my-key-1' - # Construct a json representation of a BackupPolicyPlanPatch model - backup_policy_plan_patch_model_json = {} - backup_policy_plan_patch_model_json['active'] = True - backup_policy_plan_patch_model_json['attach_user_tags'] = ['my-daily-backup-plan'] - backup_policy_plan_patch_model_json['clone_policy'] = backup_policy_plan_clone_policy_patch_model - backup_policy_plan_patch_model_json['copy_user_tags'] = True - backup_policy_plan_patch_model_json['cron_spec'] = '30 */2 * * 1-5' - backup_policy_plan_patch_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model - backup_policy_plan_patch_model_json['name'] = 'my-policy-plan' - backup_policy_plan_patch_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model] + bare_metal_server_initialization_user_account_model = {} # BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount + bare_metal_server_initialization_user_account_model['encrypted_password'] = 'qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==' + bare_metal_server_initialization_user_account_model['encryption_key'] = key_reference_model + bare_metal_server_initialization_user_account_model['resource_type'] = 'host_user_account' + bare_metal_server_initialization_user_account_model['username'] = 'root' - # Construct a model instance of BackupPolicyPlanPatch by calling from_dict on the json representation - backup_policy_plan_patch_model = BackupPolicyPlanPatch.from_dict(backup_policy_plan_patch_model_json) - assert backup_policy_plan_patch_model != False + # Construct a json representation of a BareMetalServerInitialization model + bare_metal_server_initialization_model_json = {} + bare_metal_server_initialization_model_json['image'] = image_reference_model + bare_metal_server_initialization_model_json['keys'] = [key_reference_model] + bare_metal_server_initialization_model_json['user_accounts'] = [bare_metal_server_initialization_user_account_model] - # Construct a model instance of BackupPolicyPlanPatch by calling from_dict on the json representation - backup_policy_plan_patch_model_dict = BackupPolicyPlanPatch.from_dict(backup_policy_plan_patch_model_json).__dict__ - backup_policy_plan_patch_model2 = BackupPolicyPlanPatch(**backup_policy_plan_patch_model_dict) + # Construct a model instance of BareMetalServerInitialization by calling from_dict on the json representation + bare_metal_server_initialization_model = BareMetalServerInitialization.from_dict(bare_metal_server_initialization_model_json) + assert bare_metal_server_initialization_model != False + + # Construct a model instance of BareMetalServerInitialization by calling from_dict on the json representation + bare_metal_server_initialization_model_dict = BareMetalServerInitialization.from_dict(bare_metal_server_initialization_model_json).__dict__ + bare_metal_server_initialization_model2 = BareMetalServerInitialization(**bare_metal_server_initialization_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_patch_model == backup_policy_plan_patch_model2 + assert bare_metal_server_initialization_model == bare_metal_server_initialization_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_patch_model_json2 = backup_policy_plan_patch_model.to_dict() - assert backup_policy_plan_patch_model_json2 == backup_policy_plan_patch_model_json + bare_metal_server_initialization_model_json2 = bare_metal_server_initialization_model.to_dict() + assert bare_metal_server_initialization_model_json2 == bare_metal_server_initialization_model_json -class TestModel_BackupPolicyPlanPrototype: +class TestModel_BareMetalServerInitializationPrototype: """ - Test Class for BackupPolicyPlanPrototype + Test Class for BareMetalServerInitializationPrototype """ - def test_backup_policy_plan_prototype_serialization(self): + def test_bare_metal_server_initialization_prototype_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanPrototype + Test serialization/deserialization for BareMetalServerInitializationPrototype """ # 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' - - backup_policy_plan_clone_policy_prototype_model = {} # BackupPolicyPlanClonePolicyPrototype - backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5 - backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model] - - backup_policy_plan_deletion_trigger_prototype_model = {} # BackupPolicyPlanDeletionTriggerPrototype - backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20 - backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20 - - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - - region_identity_model = {} # RegionIdentityByName - region_identity_model['name'] = 'us-south' + image_identity_model = {} # ImageIdentityById + image_identity_model['id'] = 'r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 - backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model - backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model + key_identity_model = {} # KeyIdentityById + key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - # Construct a json representation of a BackupPolicyPlanPrototype model - backup_policy_plan_prototype_model_json = {} - backup_policy_plan_prototype_model_json['active'] = True - backup_policy_plan_prototype_model_json['attach_user_tags'] = ['my-daily-backup-plan'] - backup_policy_plan_prototype_model_json['clone_policy'] = backup_policy_plan_clone_policy_prototype_model - backup_policy_plan_prototype_model_json['copy_user_tags'] = True - backup_policy_plan_prototype_model_json['cron_spec'] = '30 */2 * * 1-5' - backup_policy_plan_prototype_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model - backup_policy_plan_prototype_model_json['name'] = 'my-policy-plan' - backup_policy_plan_prototype_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model] + # Construct a json representation of a BareMetalServerInitializationPrototype model + bare_metal_server_initialization_prototype_model_json = {} + bare_metal_server_initialization_prototype_model_json['image'] = image_identity_model + bare_metal_server_initialization_prototype_model_json['keys'] = [key_identity_model] + bare_metal_server_initialization_prototype_model_json['user_data'] = 'testString' - # Construct a model instance of BackupPolicyPlanPrototype by calling from_dict on the json representation - backup_policy_plan_prototype_model = BackupPolicyPlanPrototype.from_dict(backup_policy_plan_prototype_model_json) - assert backup_policy_plan_prototype_model != False + # Construct a model instance of BareMetalServerInitializationPrototype by calling from_dict on the json representation + bare_metal_server_initialization_prototype_model = BareMetalServerInitializationPrototype.from_dict(bare_metal_server_initialization_prototype_model_json) + assert bare_metal_server_initialization_prototype_model != False - # Construct a model instance of BackupPolicyPlanPrototype by calling from_dict on the json representation - backup_policy_plan_prototype_model_dict = BackupPolicyPlanPrototype.from_dict(backup_policy_plan_prototype_model_json).__dict__ - backup_policy_plan_prototype_model2 = BackupPolicyPlanPrototype(**backup_policy_plan_prototype_model_dict) + # Construct a model instance of BareMetalServerInitializationPrototype by calling from_dict on the json representation + bare_metal_server_initialization_prototype_model_dict = BareMetalServerInitializationPrototype.from_dict(bare_metal_server_initialization_prototype_model_json).__dict__ + bare_metal_server_initialization_prototype_model2 = BareMetalServerInitializationPrototype(**bare_metal_server_initialization_prototype_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_prototype_model == backup_policy_plan_prototype_model2 + assert bare_metal_server_initialization_prototype_model == bare_metal_server_initialization_prototype_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_prototype_model_json2 = backup_policy_plan_prototype_model.to_dict() - assert backup_policy_plan_prototype_model_json2 == backup_policy_plan_prototype_model_json + bare_metal_server_initialization_prototype_model_json2 = bare_metal_server_initialization_prototype_model.to_dict() + assert bare_metal_server_initialization_prototype_model_json2 == bare_metal_server_initialization_prototype_model_json -class TestModel_BackupPolicyPlanReference: +class TestModel_BareMetalServerLifecycleReason: """ - Test Class for BackupPolicyPlanReference + Test Class for BareMetalServerLifecycleReason """ - def test_backup_policy_plan_reference_serialization(self): + def test_bare_metal_server_lifecycle_reason_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanReference + Test serialization/deserialization for BareMetalServerLifecycleReason """ - # Construct dict forms of any model objects needed in order to build this model. - - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' - - backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote - backup_policy_plan_remote_model['region'] = region_reference_model - - # Construct a json representation of a BackupPolicyPlanReference model - backup_policy_plan_reference_model_json = {} - backup_policy_plan_reference_model_json['deleted'] = deleted_model - backup_policy_plan_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_reference_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' - backup_policy_plan_reference_model_json['name'] = 'my-policy-plan' - backup_policy_plan_reference_model_json['remote'] = backup_policy_plan_remote_model - backup_policy_plan_reference_model_json['resource_type'] = 'backup_policy_plan' + # Construct a json representation of a BareMetalServerLifecycleReason model + bare_metal_server_lifecycle_reason_model_json = {} + bare_metal_server_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider' + bare_metal_server_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + bare_metal_server_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a model instance of BackupPolicyPlanReference by calling from_dict on the json representation - backup_policy_plan_reference_model = BackupPolicyPlanReference.from_dict(backup_policy_plan_reference_model_json) - assert backup_policy_plan_reference_model != False + # Construct a model instance of BareMetalServerLifecycleReason by calling from_dict on the json representation + bare_metal_server_lifecycle_reason_model = BareMetalServerLifecycleReason.from_dict(bare_metal_server_lifecycle_reason_model_json) + assert bare_metal_server_lifecycle_reason_model != False - # Construct a model instance of BackupPolicyPlanReference by calling from_dict on the json representation - backup_policy_plan_reference_model_dict = BackupPolicyPlanReference.from_dict(backup_policy_plan_reference_model_json).__dict__ - backup_policy_plan_reference_model2 = BackupPolicyPlanReference(**backup_policy_plan_reference_model_dict) + # Construct a model instance of BareMetalServerLifecycleReason by calling from_dict on the json representation + bare_metal_server_lifecycle_reason_model_dict = BareMetalServerLifecycleReason.from_dict(bare_metal_server_lifecycle_reason_model_json).__dict__ + bare_metal_server_lifecycle_reason_model2 = BareMetalServerLifecycleReason(**bare_metal_server_lifecycle_reason_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_reference_model == backup_policy_plan_reference_model2 + assert bare_metal_server_lifecycle_reason_model == bare_metal_server_lifecycle_reason_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_reference_model_json2 = backup_policy_plan_reference_model.to_dict() - assert backup_policy_plan_reference_model_json2 == backup_policy_plan_reference_model_json + bare_metal_server_lifecycle_reason_model_json2 = bare_metal_server_lifecycle_reason_model.to_dict() + assert bare_metal_server_lifecycle_reason_model_json2 == bare_metal_server_lifecycle_reason_model_json -class TestModel_BackupPolicyPlanRemote: +class TestModel_BareMetalServerNetworkAttachmentCollection: """ - Test Class for BackupPolicyPlanRemote + Test Class for BareMetalServerNetworkAttachmentCollection """ - def test_backup_policy_plan_remote_serialization(self): + def test_bare_metal_server_network_attachment_collection_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanRemote + Test serialization/deserialization for BareMetalServerNetworkAttachmentCollection """ # Construct dict forms of any model objects needed in order to build this model. - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6?limit=20' - # Construct a json representation of a BackupPolicyPlanRemote model - backup_policy_plan_remote_model_json = {} - backup_policy_plan_remote_model_json['region'] = region_reference_model + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a model instance of BackupPolicyPlanRemote by calling from_dict on the json representation - backup_policy_plan_remote_model = BackupPolicyPlanRemote.from_dict(backup_policy_plan_remote_model_json) - assert backup_policy_plan_remote_model != False + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '10.0.1.5' + reserved_ip_reference_model['deleted'] = deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - # Construct a model instance of BackupPolicyPlanRemote by calling from_dict on the json representation - backup_policy_plan_remote_model_dict = BackupPolicyPlanRemote.from_dict(backup_policy_plan_remote_model_json).__dict__ - backup_policy_plan_remote_model2 = BackupPolicyPlanRemote(**backup_policy_plan_remote_model_dict) + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' + virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' + + bare_metal_server_network_attachment_model = {} # BareMetalServerNetworkAttachmentByVLAN + bare_metal_server_network_attachment_model['created_at'] = '2024-10-23T03:42:32.993000Z' + bare_metal_server_network_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_model['lifecycle_state'] = 'stable' + bare_metal_server_network_attachment_model['name'] = 'my-bare-metal-server-network-attachment' + bare_metal_server_network_attachment_model['port_speed'] = 1000 + bare_metal_server_network_attachment_model['primary_ip'] = reserved_ip_reference_model + bare_metal_server_network_attachment_model['resource_type'] = 'bare_metal_server_network_attachment' + bare_metal_server_network_attachment_model['subnet'] = subnet_reference_model + bare_metal_server_network_attachment_model['type'] = 'primary' + bare_metal_server_network_attachment_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model + bare_metal_server_network_attachment_model['allow_to_float'] = False + bare_metal_server_network_attachment_model['interface_type'] = 'vlan' + bare_metal_server_network_attachment_model['vlan'] = 4 + + # Construct a json representation of a BareMetalServerNetworkAttachmentCollection model + bare_metal_server_network_attachment_collection_model_json = {} + bare_metal_server_network_attachment_collection_model_json['first'] = page_link_model + bare_metal_server_network_attachment_collection_model_json['limit'] = 20 + bare_metal_server_network_attachment_collection_model_json['network_attachments'] = [bare_metal_server_network_attachment_model] + bare_metal_server_network_attachment_collection_model_json['next'] = page_link_model + bare_metal_server_network_attachment_collection_model_json['total_count'] = 132 + + # Construct a model instance of BareMetalServerNetworkAttachmentCollection by calling from_dict on the json representation + bare_metal_server_network_attachment_collection_model = BareMetalServerNetworkAttachmentCollection.from_dict(bare_metal_server_network_attachment_collection_model_json) + assert bare_metal_server_network_attachment_collection_model != False + + # Construct a model instance of BareMetalServerNetworkAttachmentCollection by calling from_dict on the json representation + bare_metal_server_network_attachment_collection_model_dict = BareMetalServerNetworkAttachmentCollection.from_dict(bare_metal_server_network_attachment_collection_model_json).__dict__ + bare_metal_server_network_attachment_collection_model2 = BareMetalServerNetworkAttachmentCollection(**bare_metal_server_network_attachment_collection_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_remote_model == backup_policy_plan_remote_model2 + assert bare_metal_server_network_attachment_collection_model == bare_metal_server_network_attachment_collection_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_remote_model_json2 = backup_policy_plan_remote_model.to_dict() - assert backup_policy_plan_remote_model_json2 == backup_policy_plan_remote_model_json + bare_metal_server_network_attachment_collection_model_json2 = bare_metal_server_network_attachment_collection_model.to_dict() + assert bare_metal_server_network_attachment_collection_model_json2 == bare_metal_server_network_attachment_collection_model_json -class TestModel_BackupPolicyPlanRemoteRegionPolicy: +class TestModel_BareMetalServerNetworkAttachmentPatch: """ - Test Class for BackupPolicyPlanRemoteRegionPolicy + Test Class for BareMetalServerNetworkAttachmentPatch """ - def test_backup_policy_plan_remote_region_policy_serialization(self): + def test_bare_metal_server_network_attachment_patch_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanRemoteRegionPolicy + Test serialization/deserialization for BareMetalServerNetworkAttachmentPatch """ - # Construct dict forms of any model objects needed in order to build this model. - - encryption_key_reference_model = {} # EncryptionKeyReference - encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' - - # Construct a json representation of a BackupPolicyPlanRemoteRegionPolicy model - backup_policy_plan_remote_region_policy_model_json = {} - backup_policy_plan_remote_region_policy_model_json['delete_over_count'] = 1 - backup_policy_plan_remote_region_policy_model_json['encryption_key'] = encryption_key_reference_model - backup_policy_plan_remote_region_policy_model_json['region'] = region_reference_model + # Construct a json representation of a BareMetalServerNetworkAttachmentPatch model + bare_metal_server_network_attachment_patch_model_json = {} + bare_metal_server_network_attachment_patch_model_json['allowed_vlans'] = [4] + bare_metal_server_network_attachment_patch_model_json['name'] = 'my-bare-metal-server-network-attachment-updated' - # Construct a model instance of BackupPolicyPlanRemoteRegionPolicy by calling from_dict on the json representation - backup_policy_plan_remote_region_policy_model = BackupPolicyPlanRemoteRegionPolicy.from_dict(backup_policy_plan_remote_region_policy_model_json) - assert backup_policy_plan_remote_region_policy_model != False + # Construct a model instance of BareMetalServerNetworkAttachmentPatch by calling from_dict on the json representation + bare_metal_server_network_attachment_patch_model = BareMetalServerNetworkAttachmentPatch.from_dict(bare_metal_server_network_attachment_patch_model_json) + assert bare_metal_server_network_attachment_patch_model != False - # Construct a model instance of BackupPolicyPlanRemoteRegionPolicy by calling from_dict on the json representation - backup_policy_plan_remote_region_policy_model_dict = BackupPolicyPlanRemoteRegionPolicy.from_dict(backup_policy_plan_remote_region_policy_model_json).__dict__ - backup_policy_plan_remote_region_policy_model2 = BackupPolicyPlanRemoteRegionPolicy(**backup_policy_plan_remote_region_policy_model_dict) + # Construct a model instance of BareMetalServerNetworkAttachmentPatch by calling from_dict on the json representation + bare_metal_server_network_attachment_patch_model_dict = BareMetalServerNetworkAttachmentPatch.from_dict(bare_metal_server_network_attachment_patch_model_json).__dict__ + bare_metal_server_network_attachment_patch_model2 = BareMetalServerNetworkAttachmentPatch(**bare_metal_server_network_attachment_patch_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_remote_region_policy_model == backup_policy_plan_remote_region_policy_model2 + assert bare_metal_server_network_attachment_patch_model == bare_metal_server_network_attachment_patch_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_remote_region_policy_model_json2 = backup_policy_plan_remote_region_policy_model.to_dict() - assert backup_policy_plan_remote_region_policy_model_json2 == backup_policy_plan_remote_region_policy_model_json + bare_metal_server_network_attachment_patch_model_json2 = bare_metal_server_network_attachment_patch_model.to_dict() + assert bare_metal_server_network_attachment_patch_model_json2 == bare_metal_server_network_attachment_patch_model_json -class TestModel_BackupPolicyPlanRemoteRegionPolicyPrototype: +class TestModel_BareMetalServerNetworkAttachmentReference: """ - Test Class for BackupPolicyPlanRemoteRegionPolicyPrototype + Test Class for BareMetalServerNetworkAttachmentReference """ - def test_backup_policy_plan_remote_region_policy_prototype_serialization(self): + def test_bare_metal_server_network_attachment_reference_serialization(self): """ - Test serialization/deserialization for BackupPolicyPlanRemoteRegionPolicyPrototype + Test serialization/deserialization for BareMetalServerNetworkAttachmentReference """ # Construct dict forms of any model objects needed in order to build this model. - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - region_identity_model = {} # RegionIdentityByName - region_identity_model['name'] = 'us-south' + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '10.0.1.5' + reserved_ip_reference_model['deleted'] = deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - # Construct a json representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model - backup_policy_plan_remote_region_policy_prototype_model_json = {} - backup_policy_plan_remote_region_policy_prototype_model_json['delete_over_count'] = 5 - backup_policy_plan_remote_region_policy_prototype_model_json['encryption_key'] = encryption_key_identity_model - backup_policy_plan_remote_region_policy_prototype_model_json['region'] = region_identity_model + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' - # Construct a model instance of BackupPolicyPlanRemoteRegionPolicyPrototype by calling from_dict on the json representation - backup_policy_plan_remote_region_policy_prototype_model = BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(backup_policy_plan_remote_region_policy_prototype_model_json) - assert backup_policy_plan_remote_region_policy_prototype_model != False + virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' + virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' - # Construct a model instance of BackupPolicyPlanRemoteRegionPolicyPrototype by calling from_dict on the json representation - backup_policy_plan_remote_region_policy_prototype_model_dict = BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(backup_policy_plan_remote_region_policy_prototype_model_json).__dict__ - backup_policy_plan_remote_region_policy_prototype_model2 = BackupPolicyPlanRemoteRegionPolicyPrototype(**backup_policy_plan_remote_region_policy_prototype_model_dict) + # Construct a json representation of a BareMetalServerNetworkAttachmentReference model + bare_metal_server_network_attachment_reference_model_json = {} + bare_metal_server_network_attachment_reference_model_json['deleted'] = deleted_model + bare_metal_server_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_reference_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_reference_model_json['name'] = 'my-bare-metal-server-network-attachment' + bare_metal_server_network_attachment_reference_model_json['primary_ip'] = reserved_ip_reference_model + bare_metal_server_network_attachment_reference_model_json['resource_type'] = 'bare_metal_server_network_attachment' + bare_metal_server_network_attachment_reference_model_json['subnet'] = subnet_reference_model + bare_metal_server_network_attachment_reference_model_json['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model + + # Construct a model instance of BareMetalServerNetworkAttachmentReference by calling from_dict on the json representation + bare_metal_server_network_attachment_reference_model = BareMetalServerNetworkAttachmentReference.from_dict(bare_metal_server_network_attachment_reference_model_json) + assert bare_metal_server_network_attachment_reference_model != False + + # Construct a model instance of BareMetalServerNetworkAttachmentReference by calling from_dict on the json representation + bare_metal_server_network_attachment_reference_model_dict = BareMetalServerNetworkAttachmentReference.from_dict(bare_metal_server_network_attachment_reference_model_json).__dict__ + bare_metal_server_network_attachment_reference_model2 = BareMetalServerNetworkAttachmentReference(**bare_metal_server_network_attachment_reference_model_dict) # Verify the model instances are equivalent - assert backup_policy_plan_remote_region_policy_prototype_model == backup_policy_plan_remote_region_policy_prototype_model2 + assert bare_metal_server_network_attachment_reference_model == bare_metal_server_network_attachment_reference_model2 # Convert model instance back to dict and verify no loss of data - backup_policy_plan_remote_region_policy_prototype_model_json2 = backup_policy_plan_remote_region_policy_prototype_model.to_dict() - assert backup_policy_plan_remote_region_policy_prototype_model_json2 == backup_policy_plan_remote_region_policy_prototype_model_json + bare_metal_server_network_attachment_reference_model_json2 = bare_metal_server_network_attachment_reference_model.to_dict() + assert bare_metal_server_network_attachment_reference_model_json2 == bare_metal_server_network_attachment_reference_model_json -class TestModel_BareMetalServer: +class TestModel_BareMetalServerNetworkInterfaceCollection: """ - Test Class for BareMetalServer + Test Class for BareMetalServerNetworkInterfaceCollection """ - def test_bare_metal_server_serialization(self): + def test_bare_metal_server_network_interface_collection_serialization(self): """ - Test serialization/deserialization for BareMetalServer + Test serialization/deserialization for BareMetalServerNetworkInterfaceCollection """ # Construct dict forms of any model objects needed in order to build this model. + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304?limit=20' + deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - bare_metal_server_boot_target_model = {} # BareMetalServerBootTargetBareMetalServerDiskReference - bare_metal_server_boot_target_model['deleted'] = deleted_model - bare_metal_server_boot_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/disks/2302-3744f199-6ccc-4698-8772-bb3937348c96' - bare_metal_server_boot_target_model['id'] = '2302-3744f199-6ccc-4698-8772-bb3937348c96' - bare_metal_server_boot_target_model['name'] = 'opponent-delude-slang-knoll' - bare_metal_server_boot_target_model['resource_type'] = 'bare_metal_server_disk' - - bare_metal_server_cpu_model = {} # BareMetalServerCPU - bare_metal_server_cpu_model['architecture'] = 'amd64' - bare_metal_server_cpu_model['core_count'] = 96 - bare_metal_server_cpu_model['socket_count'] = 4 - bare_metal_server_cpu_model['threads_per_core'] = 2 - - bare_metal_server_disk_model = {} # BareMetalServerDisk - bare_metal_server_disk_model['created_at'] = '2021-05-21T06:09:15Z' - bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/disks/2302-3744f199-6ccc-4698-8772-bb3937348c96' - bare_metal_server_disk_model['id'] = '2302-3744f199-6ccc-4698-8772-bb3937348c96' - bare_metal_server_disk_model['interface_type'] = 'sata' - bare_metal_server_disk_model['name'] = 'opponent-delude-slang-knoll' - bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' - bare_metal_server_disk_model['size'] = 960 - - bare_metal_server_firmware_model = {} # BareMetalServerFirmware - bare_metal_server_firmware_model['update'] = 'none' - - bare_metal_server_lifecycle_reason_model = {} # BareMetalServerLifecycleReason - bare_metal_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' - bare_metal_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' - bare_metal_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + floating_ip_reference_model = {} # FloatingIPReference + floating_ip_reference_model['address'] = '203.0.113.1' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['deleted'] = deleted_model + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['name'] = 'my-floating-ip' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['deleted'] = deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['name'] = 'my-security-group' + subnet_reference_model = {} # SubnetReference subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = deleted_model @@ -51257,2058 +55663,2156 @@ def test_bare_metal_server_serialization(self): subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' - virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' - virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' - - bare_metal_server_network_attachment_reference_model = {} # BareMetalServerNetworkAttachmentReference - bare_metal_server_network_attachment_reference_model['deleted'] = deleted_model - bare_metal_server_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_reference_model['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_reference_model['name'] = 'my-bare-metal-server-network-attachment' - bare_metal_server_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model - bare_metal_server_network_attachment_reference_model['resource_type'] = 'bare_metal_server_network_attachment' - bare_metal_server_network_attachment_reference_model['subnet'] = subnet_reference_model - bare_metal_server_network_attachment_reference_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model - - network_interface_bare_metal_server_context_reference_model = {} # NetworkInterfaceBareMetalServerContextReference - network_interface_bare_metal_server_context_reference_model['deleted'] = deleted_model - network_interface_bare_metal_server_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_interfaces/2302-63209fe4-0168-4b8f-9618-3e30f7118cdf' - network_interface_bare_metal_server_context_reference_model['id'] = '2302-63209fe4-0168-4b8f-9618-3e30f7118cdf' - network_interface_bare_metal_server_context_reference_model['name'] = 'my-primary-network-interface' - network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model - network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface' - network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model - - bare_metal_server_profile_reference_model = {} # BareMetalServerProfileReference - bare_metal_server_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_server/profiles/bx2d-metal-192x768' - bare_metal_server_profile_reference_model['name'] = 'bx2d-metal-192x768' - bare_metal_server_profile_reference_model['resource_type'] = 'bare_metal_server_profile' - - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/resource_groups/823edda102129f3232a0dc0655fcff94' - resource_group_reference_model['id'] = '823edda102129f3232a0dc0655fcff94' - resource_group_reference_model['name'] = 'Default' - - bare_metal_server_status_reason_model = {} # BareMetalServerStatusReason - bare_metal_server_status_reason_model['code'] = 'cannot_start_capacity' - bare_metal_server_status_reason_model['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.' - bare_metal_server_status_reason_model['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html' - - bare_metal_server_trusted_platform_module_model = {} # BareMetalServerTrustedPlatformModule - bare_metal_server_trusted_platform_module_model['enabled'] = False - bare_metal_server_trusted_platform_module_model['mode'] = 'disabled' - bare_metal_server_trusted_platform_module_model['supported_modes'] = ['disabled', 'tpm_2'] - - vpc_reference_model = {} # VPCReference - vpc_reference_model['crn'] = 'crn:[...]' - vpc_reference_model['deleted'] = deleted_model - vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r134-bba5c798-447e-490d-b622-dd4cdd8027f6' - vpc_reference_model['id'] = 'r134-bba5c798-447e-490d-b622-dd4cdd8027f6' - vpc_reference_model['name'] = 'my-vpc' - vpc_reference_model['resource_type'] = 'vpc' - - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-3' - zone_reference_model['name'] = 'us-south-3' + bare_metal_server_network_interface_model = {} # BareMetalServerNetworkInterfaceByPCI + bare_metal_server_network_interface_model['allow_ip_spoofing'] = False + bare_metal_server_network_interface_model['created_at'] = '2021-05-21T06:09:15Z' + bare_metal_server_network_interface_model['enable_infrastructure_nat'] = False + bare_metal_server_network_interface_model['floating_ips'] = [floating_ip_reference_model] + bare_metal_server_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_interface_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_interface_model['mac_address'] = '02:09:04:00:C4:6A' + bare_metal_server_network_interface_model['name'] = 'my-primary-network-interface' + bare_metal_server_network_interface_model['port_speed'] = 100000 + bare_metal_server_network_interface_model['primary_ip'] = reserved_ip_reference_model + bare_metal_server_network_interface_model['resource_type'] = 'network_interface' + bare_metal_server_network_interface_model['security_groups'] = [security_group_reference_model] + bare_metal_server_network_interface_model['status'] = 'available' + bare_metal_server_network_interface_model['subnet'] = subnet_reference_model + bare_metal_server_network_interface_model['type'] = 'primary' + bare_metal_server_network_interface_model['allowed_vlans'] = [4] + bare_metal_server_network_interface_model['interface_type'] = 'pci' - # Construct a json representation of a BareMetalServer model - bare_metal_server_model_json = {} - bare_metal_server_model_json['bandwidth'] = 20000 - bare_metal_server_model_json['boot_target'] = bare_metal_server_boot_target_model - bare_metal_server_model_json['cpu'] = bare_metal_server_cpu_model - bare_metal_server_model_json['created_at'] = '2019-01-01T12:00:00Z' - bare_metal_server_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a' - bare_metal_server_model_json['disks'] = [bare_metal_server_disk_model] - bare_metal_server_model_json['enable_secure_boot'] = False - bare_metal_server_model_json['firmware'] = bare_metal_server_firmware_model - bare_metal_server_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a' - bare_metal_server_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - bare_metal_server_model_json['lifecycle_reasons'] = [bare_metal_server_lifecycle_reason_model] - bare_metal_server_model_json['lifecycle_state'] = 'stable' - bare_metal_server_model_json['memory'] = 1536 - bare_metal_server_model_json['name'] = 'my-bare-metal-server' - bare_metal_server_model_json['network_attachments'] = [bare_metal_server_network_attachment_reference_model] - bare_metal_server_model_json['network_interfaces'] = [network_interface_bare_metal_server_context_reference_model] - bare_metal_server_model_json['primary_network_attachment'] = bare_metal_server_network_attachment_reference_model - bare_metal_server_model_json['primary_network_interface'] = network_interface_bare_metal_server_context_reference_model - bare_metal_server_model_json['profile'] = bare_metal_server_profile_reference_model - bare_metal_server_model_json['resource_group'] = resource_group_reference_model - bare_metal_server_model_json['resource_type'] = 'bare_metal_server' - bare_metal_server_model_json['status'] = 'deleting' - bare_metal_server_model_json['status_reasons'] = [bare_metal_server_status_reason_model] - bare_metal_server_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_model - bare_metal_server_model_json['vpc'] = vpc_reference_model - bare_metal_server_model_json['zone'] = zone_reference_model + # Construct a json representation of a BareMetalServerNetworkInterfaceCollection model + bare_metal_server_network_interface_collection_model_json = {} + bare_metal_server_network_interface_collection_model_json['first'] = page_link_model + bare_metal_server_network_interface_collection_model_json['limit'] = 20 + bare_metal_server_network_interface_collection_model_json['network_interfaces'] = [bare_metal_server_network_interface_model] + bare_metal_server_network_interface_collection_model_json['next'] = page_link_model + bare_metal_server_network_interface_collection_model_json['total_count'] = 132 - # Construct a model instance of BareMetalServer by calling from_dict on the json representation - bare_metal_server_model = BareMetalServer.from_dict(bare_metal_server_model_json) - assert bare_metal_server_model != False + # Construct a model instance of BareMetalServerNetworkInterfaceCollection by calling from_dict on the json representation + bare_metal_server_network_interface_collection_model = BareMetalServerNetworkInterfaceCollection.from_dict(bare_metal_server_network_interface_collection_model_json) + assert bare_metal_server_network_interface_collection_model != False - # Construct a model instance of BareMetalServer by calling from_dict on the json representation - bare_metal_server_model_dict = BareMetalServer.from_dict(bare_metal_server_model_json).__dict__ - bare_metal_server_model2 = BareMetalServer(**bare_metal_server_model_dict) + # Construct a model instance of BareMetalServerNetworkInterfaceCollection by calling from_dict on the json representation + bare_metal_server_network_interface_collection_model_dict = BareMetalServerNetworkInterfaceCollection.from_dict(bare_metal_server_network_interface_collection_model_json).__dict__ + bare_metal_server_network_interface_collection_model2 = BareMetalServerNetworkInterfaceCollection(**bare_metal_server_network_interface_collection_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_model == bare_metal_server_model2 + assert bare_metal_server_network_interface_collection_model == bare_metal_server_network_interface_collection_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_model_json2 = bare_metal_server_model.to_dict() - assert bare_metal_server_model_json2 == bare_metal_server_model_json + bare_metal_server_network_interface_collection_model_json2 = bare_metal_server_network_interface_collection_model.to_dict() + assert bare_metal_server_network_interface_collection_model_json2 == bare_metal_server_network_interface_collection_model_json -class TestModel_BareMetalServerCPU: +class TestModel_BareMetalServerNetworkInterfacePatch: """ - Test Class for BareMetalServerCPU + Test Class for BareMetalServerNetworkInterfacePatch """ - def test_bare_metal_server_cpu_serialization(self): + def test_bare_metal_server_network_interface_patch_serialization(self): """ - Test serialization/deserialization for BareMetalServerCPU + Test serialization/deserialization for BareMetalServerNetworkInterfacePatch """ - # Construct a json representation of a BareMetalServerCPU model - bare_metal_server_cpu_model_json = {} - bare_metal_server_cpu_model_json['architecture'] = 'amd64' - bare_metal_server_cpu_model_json['core_count'] = 80 - bare_metal_server_cpu_model_json['socket_count'] = 4 - bare_metal_server_cpu_model_json['threads_per_core'] = 2 + # Construct a json representation of a BareMetalServerNetworkInterfacePatch model + bare_metal_server_network_interface_patch_model_json = {} + bare_metal_server_network_interface_patch_model_json['allow_ip_spoofing'] = True + bare_metal_server_network_interface_patch_model_json['allowed_vlans'] = [4] + bare_metal_server_network_interface_patch_model_json['enable_infrastructure_nat'] = True + bare_metal_server_network_interface_patch_model_json['name'] = 'my-bare-metal-server-network-interface' - # Construct a model instance of BareMetalServerCPU by calling from_dict on the json representation - bare_metal_server_cpu_model = BareMetalServerCPU.from_dict(bare_metal_server_cpu_model_json) - assert bare_metal_server_cpu_model != False + # Construct a model instance of BareMetalServerNetworkInterfacePatch by calling from_dict on the json representation + bare_metal_server_network_interface_patch_model = BareMetalServerNetworkInterfacePatch.from_dict(bare_metal_server_network_interface_patch_model_json) + assert bare_metal_server_network_interface_patch_model != False - # Construct a model instance of BareMetalServerCPU by calling from_dict on the json representation - bare_metal_server_cpu_model_dict = BareMetalServerCPU.from_dict(bare_metal_server_cpu_model_json).__dict__ - bare_metal_server_cpu_model2 = BareMetalServerCPU(**bare_metal_server_cpu_model_dict) + # Construct a model instance of BareMetalServerNetworkInterfacePatch by calling from_dict on the json representation + bare_metal_server_network_interface_patch_model_dict = BareMetalServerNetworkInterfacePatch.from_dict(bare_metal_server_network_interface_patch_model_json).__dict__ + bare_metal_server_network_interface_patch_model2 = BareMetalServerNetworkInterfacePatch(**bare_metal_server_network_interface_patch_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_cpu_model == bare_metal_server_cpu_model2 + assert bare_metal_server_network_interface_patch_model == bare_metal_server_network_interface_patch_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_cpu_model_json2 = bare_metal_server_cpu_model.to_dict() - assert bare_metal_server_cpu_model_json2 == bare_metal_server_cpu_model_json + bare_metal_server_network_interface_patch_model_json2 = bare_metal_server_network_interface_patch_model.to_dict() + assert bare_metal_server_network_interface_patch_model_json2 == bare_metal_server_network_interface_patch_model_json -class TestModel_BareMetalServerCollection: +class TestModel_BareMetalServerPatch: """ - Test Class for BareMetalServerCollection + Test Class for BareMetalServerPatch """ - def test_bare_metal_server_collection_serialization(self): + def test_bare_metal_server_patch_serialization(self): """ - Test serialization/deserialization for BareMetalServerCollection + Test serialization/deserialization for BareMetalServerPatch """ # Construct dict forms of any model objects needed in order to build this model. - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + bare_metal_server_trusted_platform_module_patch_model = {} # BareMetalServerTrustedPlatformModulePatch + bare_metal_server_trusted_platform_module_patch_model['mode'] = 'disabled' - bare_metal_server_boot_target_model = {} # BareMetalServerBootTargetBareMetalServerDiskReference - bare_metal_server_boot_target_model['deleted'] = deleted_model - bare_metal_server_boot_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/disks/2302-3744f199-6ccc-4698-8772-bb3937348c96' - bare_metal_server_boot_target_model['id'] = '2302-3744f199-6ccc-4698-8772-bb3937348c96' - bare_metal_server_boot_target_model['name'] = 'opponent-delude-slang-knoll' - bare_metal_server_boot_target_model['resource_type'] = 'bare_metal_server_disk' + # Construct a json representation of a BareMetalServerPatch model + bare_metal_server_patch_model_json = {} + bare_metal_server_patch_model_json['bandwidth'] = 20000 + bare_metal_server_patch_model_json['enable_secure_boot'] = False + bare_metal_server_patch_model_json['name'] = 'my-bare-metal-server' + bare_metal_server_patch_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_patch_model - bare_metal_server_cpu_model = {} # BareMetalServerCPU - bare_metal_server_cpu_model['architecture'] = 'amd64' - bare_metal_server_cpu_model['core_count'] = 96 - bare_metal_server_cpu_model['socket_count'] = 4 - bare_metal_server_cpu_model['threads_per_core'] = 2 + # Construct a model instance of BareMetalServerPatch by calling from_dict on the json representation + bare_metal_server_patch_model = BareMetalServerPatch.from_dict(bare_metal_server_patch_model_json) + assert bare_metal_server_patch_model != False - bare_metal_server_disk_model = {} # BareMetalServerDisk - bare_metal_server_disk_model['created_at'] = '2021-05-21T06:09:15Z' - bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/disks/2302-3744f199-6ccc-4698-8772-bb3937348c96' - bare_metal_server_disk_model['id'] = '2302-3744f199-6ccc-4698-8772-bb3937348c96' - bare_metal_server_disk_model['interface_type'] = 'sata' - bare_metal_server_disk_model['name'] = 'opponent-delude-slang-knoll' - bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' - bare_metal_server_disk_model['size'] = 960 + # Construct a model instance of BareMetalServerPatch by calling from_dict on the json representation + bare_metal_server_patch_model_dict = BareMetalServerPatch.from_dict(bare_metal_server_patch_model_json).__dict__ + bare_metal_server_patch_model2 = BareMetalServerPatch(**bare_metal_server_patch_model_dict) - bare_metal_server_firmware_model = {} # BareMetalServerFirmware - bare_metal_server_firmware_model['update'] = 'none' + # Verify the model instances are equivalent + assert bare_metal_server_patch_model == bare_metal_server_patch_model2 - bare_metal_server_lifecycle_reason_model = {} # BareMetalServerLifecycleReason - bare_metal_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' - bare_metal_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' - bare_metal_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + # Convert model instance back to dict and verify no loss of data + bare_metal_server_patch_model_json2 = bare_metal_server_patch_model.to_dict() + assert bare_metal_server_patch_model_json2 == bare_metal_server_patch_model_json - reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' - reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model['name'] = 'my-reserved-ip' - reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['name'] = 'my-subnet' - subnet_reference_model['resource_type'] = 'subnet' +class TestModel_BareMetalServerPrimaryNetworkInterfacePrototype: + """ + Test Class for BareMetalServerPrimaryNetworkInterfacePrototype + """ - virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' - virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' + def test_bare_metal_server_primary_network_interface_prototype_serialization(self): + """ + Test serialization/deserialization for BareMetalServerPrimaryNetworkInterfacePrototype + """ - bare_metal_server_network_attachment_reference_model = {} # BareMetalServerNetworkAttachmentReference - bare_metal_server_network_attachment_reference_model['deleted'] = deleted_model - bare_metal_server_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_reference_model['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_reference_model['name'] = 'my-bare-metal-server-network-attachment' - bare_metal_server_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model - bare_metal_server_network_attachment_reference_model['resource_type'] = 'bare_metal_server_network_attachment' - bare_metal_server_network_attachment_reference_model['subnet'] = subnet_reference_model - bare_metal_server_network_attachment_reference_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model + # Construct dict forms of any model objects needed in order to build this model. - network_interface_bare_metal_server_context_reference_model = {} # NetworkInterfaceBareMetalServerContextReference - network_interface_bare_metal_server_context_reference_model['deleted'] = deleted_model - network_interface_bare_metal_server_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_interfaces/2302-63209fe4-0168-4b8f-9618-3e30f7118cdf' - network_interface_bare_metal_server_context_reference_model['id'] = '2302-63209fe4-0168-4b8f-9618-3e30f7118cdf' - network_interface_bare_metal_server_context_reference_model['name'] = 'my-primary-network-interface' - network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model - network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface' - network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model + network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext + network_interface_ip_prototype_model['address'] = '10.0.0.5' + network_interface_ip_prototype_model['auto_delete'] = False + network_interface_ip_prototype_model['name'] = 'my-reserved-ip' - bare_metal_server_profile_reference_model = {} # BareMetalServerProfileReference - bare_metal_server_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_server/profiles/bx2d-metal-192x768' - bare_metal_server_profile_reference_model['name'] = 'bx2d-metal-192x768' - bare_metal_server_profile_reference_model['resource_type'] = 'bare_metal_server_profile' + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' - resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/resource_groups/823edda102129f3232a0dc0655fcff94' - resource_group_reference_model['id'] = '823edda102129f3232a0dc0655fcff94' - resource_group_reference_model['name'] = 'Default' + subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - bare_metal_server_status_reason_model = {} # BareMetalServerStatusReason - bare_metal_server_status_reason_model['code'] = 'cannot_start_capacity' - bare_metal_server_status_reason_model['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.' - bare_metal_server_status_reason_model['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html' + # Construct a json representation of a BareMetalServerPrimaryNetworkInterfacePrototype model + bare_metal_server_primary_network_interface_prototype_model_json = {} + bare_metal_server_primary_network_interface_prototype_model_json['allow_ip_spoofing'] = True + bare_metal_server_primary_network_interface_prototype_model_json['allowed_vlans'] = [4] + bare_metal_server_primary_network_interface_prototype_model_json['enable_infrastructure_nat'] = True + bare_metal_server_primary_network_interface_prototype_model_json['interface_type'] = 'pci' + bare_metal_server_primary_network_interface_prototype_model_json['name'] = 'my-bare-metal-server-network-interface' + bare_metal_server_primary_network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model + bare_metal_server_primary_network_interface_prototype_model_json['security_groups'] = [security_group_identity_model] + bare_metal_server_primary_network_interface_prototype_model_json['subnet'] = subnet_identity_model - bare_metal_server_trusted_platform_module_model = {} # BareMetalServerTrustedPlatformModule - bare_metal_server_trusted_platform_module_model['enabled'] = False - bare_metal_server_trusted_platform_module_model['mode'] = 'disabled' - bare_metal_server_trusted_platform_module_model['supported_modes'] = ['disabled', 'tpm_2'] + # Construct a model instance of BareMetalServerPrimaryNetworkInterfacePrototype by calling from_dict on the json representation + bare_metal_server_primary_network_interface_prototype_model = BareMetalServerPrimaryNetworkInterfacePrototype.from_dict(bare_metal_server_primary_network_interface_prototype_model_json) + assert bare_metal_server_primary_network_interface_prototype_model != False - vpc_reference_model = {} # VPCReference - vpc_reference_model['crn'] = 'crn:[...]' - vpc_reference_model['deleted'] = deleted_model - vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r134-bba5c798-447e-490d-b622-dd4cdd8027f6' - vpc_reference_model['id'] = 'r134-bba5c798-447e-490d-b622-dd4cdd8027f6' - vpc_reference_model['name'] = 'my-vpc' - vpc_reference_model['resource_type'] = 'vpc' + # Construct a model instance of BareMetalServerPrimaryNetworkInterfacePrototype by calling from_dict on the json representation + bare_metal_server_primary_network_interface_prototype_model_dict = BareMetalServerPrimaryNetworkInterfacePrototype.from_dict(bare_metal_server_primary_network_interface_prototype_model_json).__dict__ + bare_metal_server_primary_network_interface_prototype_model2 = BareMetalServerPrimaryNetworkInterfacePrototype(**bare_metal_server_primary_network_interface_prototype_model_dict) - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-3' - zone_reference_model['name'] = 'us-south-3' + # Verify the model instances are equivalent + assert bare_metal_server_primary_network_interface_prototype_model == bare_metal_server_primary_network_interface_prototype_model2 - bare_metal_server_model = {} # BareMetalServer - bare_metal_server_model['bandwidth'] = 100000 - bare_metal_server_model['boot_target'] = bare_metal_server_boot_target_model - bare_metal_server_model['cpu'] = bare_metal_server_cpu_model - bare_metal_server_model['created_at'] = '2021-05-21T06:09:15Z' - bare_metal_server_model['crn'] = 'crn:[...]' - bare_metal_server_model['disks'] = [bare_metal_server_disk_model] - bare_metal_server_model['enable_secure_boot'] = False - bare_metal_server_model['firmware'] = bare_metal_server_firmware_model - bare_metal_server_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c' - bare_metal_server_model['id'] = '2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c' - bare_metal_server_model['lifecycle_reasons'] = [bare_metal_server_lifecycle_reason_model] - bare_metal_server_model['lifecycle_state'] = 'stable' - bare_metal_server_model['memory'] = 768 - bare_metal_server_model['name'] = 'my-bare-metal-server' - bare_metal_server_model['network_attachments'] = [bare_metal_server_network_attachment_reference_model] - bare_metal_server_model['network_interfaces'] = [network_interface_bare_metal_server_context_reference_model] - bare_metal_server_model['primary_network_attachment'] = bare_metal_server_network_attachment_reference_model - bare_metal_server_model['primary_network_interface'] = network_interface_bare_metal_server_context_reference_model - bare_metal_server_model['profile'] = bare_metal_server_profile_reference_model - bare_metal_server_model['resource_group'] = resource_group_reference_model - bare_metal_server_model['resource_type'] = 'bare_metal_server' - bare_metal_server_model['status'] = 'running' - bare_metal_server_model['status_reasons'] = [bare_metal_server_status_reason_model] - bare_metal_server_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_model - bare_metal_server_model['vpc'] = vpc_reference_model - bare_metal_server_model['zone'] = zone_reference_model + # Convert model instance back to dict and verify no loss of data + bare_metal_server_primary_network_interface_prototype_model_json2 = bare_metal_server_primary_network_interface_prototype_model.to_dict() + assert bare_metal_server_primary_network_interface_prototype_model_json2 == bare_metal_server_primary_network_interface_prototype_model_json - bare_metal_server_collection_first_model = {} # BareMetalServerCollectionFirst - bare_metal_server_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=50' - bare_metal_server_collection_next_model = {} # BareMetalServerCollectionNext - bare_metal_server_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' +class TestModel_BareMetalServerProfile: + """ + Test Class for BareMetalServerProfile + """ - # Construct a json representation of a BareMetalServerCollection model - bare_metal_server_collection_model_json = {} - bare_metal_server_collection_model_json['bare_metal_servers'] = [bare_metal_server_model] - bare_metal_server_collection_model_json['first'] = bare_metal_server_collection_first_model - bare_metal_server_collection_model_json['limit'] = 20 - bare_metal_server_collection_model_json['next'] = bare_metal_server_collection_next_model - bare_metal_server_collection_model_json['total_count'] = 132 + def test_bare_metal_server_profile_serialization(self): + """ + Test serialization/deserialization for BareMetalServerProfile + """ - # Construct a model instance of BareMetalServerCollection by calling from_dict on the json representation - bare_metal_server_collection_model = BareMetalServerCollection.from_dict(bare_metal_server_collection_model_json) - assert bare_metal_server_collection_model != False + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BareMetalServerCollection by calling from_dict on the json representation - bare_metal_server_collection_model_dict = BareMetalServerCollection.from_dict(bare_metal_server_collection_model_json).__dict__ - bare_metal_server_collection_model2 = BareMetalServerCollection(**bare_metal_server_collection_model_dict) + bare_metal_server_profile_bandwidth_model = {} # BareMetalServerProfileBandwidthFixed + bare_metal_server_profile_bandwidth_model['type'] = 'fixed' + bare_metal_server_profile_bandwidth_model['value'] = 100000 - # Verify the model instances are equivalent - assert bare_metal_server_collection_model == bare_metal_server_collection_model2 + bare_metal_server_profile_console_types_model = {} # BareMetalServerProfileConsoleTypes + bare_metal_server_profile_console_types_model['type'] = 'enum' + bare_metal_server_profile_console_types_model['values'] = ['serial', 'vnc'] - # Convert model instance back to dict and verify no loss of data - bare_metal_server_collection_model_json2 = bare_metal_server_collection_model.to_dict() - assert bare_metal_server_collection_model_json2 == bare_metal_server_collection_model_json + bare_metal_server_profile_cpu_architecture_model = {} # BareMetalServerProfileCPUArchitecture + bare_metal_server_profile_cpu_architecture_model['default'] = 'amd64' + bare_metal_server_profile_cpu_architecture_model['type'] = 'fixed' + bare_metal_server_profile_cpu_architecture_model['value'] = 'amd64' + bare_metal_server_profile_cpu_core_count_model = {} # BareMetalServerProfileCPUCoreCountFixed + bare_metal_server_profile_cpu_core_count_model['type'] = 'fixed' + bare_metal_server_profile_cpu_core_count_model['value'] = 96 -class TestModel_BareMetalServerCollectionFirst: - """ - Test Class for BareMetalServerCollectionFirst - """ + bare_metal_server_profile_cpu_socket_count_model = {} # BareMetalServerProfileCPUSocketCountFixed + bare_metal_server_profile_cpu_socket_count_model['type'] = 'fixed' + bare_metal_server_profile_cpu_socket_count_model['value'] = 4 - def test_bare_metal_server_collection_first_serialization(self): - """ - Test serialization/deserialization for BareMetalServerCollectionFirst - """ + bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed + bare_metal_server_profile_disk_quantity_model['type'] = 'fixed' + bare_metal_server_profile_disk_quantity_model['value'] = 1 - # Construct a json representation of a BareMetalServerCollectionFirst model - bare_metal_server_collection_first_model_json = {} - bare_metal_server_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20' + bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed + bare_metal_server_profile_disk_size_model['type'] = 'fixed' + bare_metal_server_profile_disk_size_model['value'] = 960 - # Construct a model instance of BareMetalServerCollectionFirst by calling from_dict on the json representation - bare_metal_server_collection_first_model = BareMetalServerCollectionFirst.from_dict(bare_metal_server_collection_first_model_json) - assert bare_metal_server_collection_first_model != False + bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces + bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'sata' + bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' + bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['sata'] - # Construct a model instance of BareMetalServerCollectionFirst by calling from_dict on the json representation - bare_metal_server_collection_first_model_dict = BareMetalServerCollectionFirst.from_dict(bare_metal_server_collection_first_model_json).__dict__ - bare_metal_server_collection_first_model2 = BareMetalServerCollectionFirst(**bare_metal_server_collection_first_model_dict) + bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk + bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model + bare_metal_server_profile_disk_model['size'] = bare_metal_server_profile_disk_size_model + bare_metal_server_profile_disk_model['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model - # Verify the model instances are equivalent - assert bare_metal_server_collection_first_model == bare_metal_server_collection_first_model2 + bare_metal_server_profile_memory_model = {} # BareMetalServerProfileMemoryFixed + bare_metal_server_profile_memory_model['type'] = 'fixed' + bare_metal_server_profile_memory_model['value'] = 768 - # Convert model instance back to dict and verify no loss of data - bare_metal_server_collection_first_model_json2 = bare_metal_server_collection_first_model.to_dict() - assert bare_metal_server_collection_first_model_json2 == bare_metal_server_collection_first_model_json + bare_metal_server_profile_network_attachment_count_model = {} # BareMetalServerProfileNetworkAttachmentCountRange + bare_metal_server_profile_network_attachment_count_model['max'] = 128 + bare_metal_server_profile_network_attachment_count_model['min'] = 1 + bare_metal_server_profile_network_attachment_count_model['type'] = 'range' + bare_metal_server_profile_network_interface_count_model = {} # BareMetalServerProfileNetworkInterfaceCountRange + bare_metal_server_profile_network_interface_count_model['max'] = 128 + bare_metal_server_profile_network_interface_count_model['min'] = 1 + bare_metal_server_profile_network_interface_count_model['type'] = 'range' -class TestModel_BareMetalServerCollectionNext: - """ - Test Class for BareMetalServerCollectionNext - """ + bare_metal_server_profile_os_architecture_model = {} # BareMetalServerProfileOSArchitecture + bare_metal_server_profile_os_architecture_model['default'] = 'amd64' + bare_metal_server_profile_os_architecture_model['type'] = 'enum' + bare_metal_server_profile_os_architecture_model['values'] = ['amd64'] - def test_bare_metal_server_collection_next_serialization(self): - """ - Test serialization/deserialization for BareMetalServerCollectionNext - """ + bare_metal_server_profile_supported_trusted_platform_module_modes_model = {} # BareMetalServerProfileSupportedTrustedPlatformModuleModes + bare_metal_server_profile_supported_trusted_platform_module_modes_model['default'] = 'disabled' + bare_metal_server_profile_supported_trusted_platform_module_modes_model['type'] = 'enum' + bare_metal_server_profile_supported_trusted_platform_module_modes_model['values'] = ['disabled', 'tpm_2'] + + bare_metal_server_profile_virtual_network_interfaces_supported_model = {} # BareMetalServerProfileVirtualNetworkInterfacesSupported + bare_metal_server_profile_virtual_network_interfaces_supported_model['type'] = 'fixed' + bare_metal_server_profile_virtual_network_interfaces_supported_model['value'] = True - # Construct a json representation of a BareMetalServerCollectionNext model - bare_metal_server_collection_next_model_json = {} - bare_metal_server_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + # Construct a json representation of a BareMetalServerProfile model + bare_metal_server_profile_model_json = {} + bare_metal_server_profile_model_json['bandwidth'] = bare_metal_server_profile_bandwidth_model + bare_metal_server_profile_model_json['console_types'] = bare_metal_server_profile_console_types_model + bare_metal_server_profile_model_json['cpu_architecture'] = bare_metal_server_profile_cpu_architecture_model + bare_metal_server_profile_model_json['cpu_core_count'] = bare_metal_server_profile_cpu_core_count_model + bare_metal_server_profile_model_json['cpu_socket_count'] = bare_metal_server_profile_cpu_socket_count_model + bare_metal_server_profile_model_json['disks'] = [bare_metal_server_profile_disk_model] + bare_metal_server_profile_model_json['family'] = 'balanced' + bare_metal_server_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768' + bare_metal_server_profile_model_json['memory'] = bare_metal_server_profile_memory_model + bare_metal_server_profile_model_json['name'] = 'bx2-metal-192x768' + bare_metal_server_profile_model_json['network_attachment_count'] = bare_metal_server_profile_network_attachment_count_model + bare_metal_server_profile_model_json['network_interface_count'] = bare_metal_server_profile_network_interface_count_model + bare_metal_server_profile_model_json['os_architecture'] = bare_metal_server_profile_os_architecture_model + bare_metal_server_profile_model_json['resource_type'] = 'bare_metal_server_profile' + bare_metal_server_profile_model_json['supported_trusted_platform_module_modes'] = bare_metal_server_profile_supported_trusted_platform_module_modes_model + bare_metal_server_profile_model_json['virtual_network_interfaces_supported'] = bare_metal_server_profile_virtual_network_interfaces_supported_model - # Construct a model instance of BareMetalServerCollectionNext by calling from_dict on the json representation - bare_metal_server_collection_next_model = BareMetalServerCollectionNext.from_dict(bare_metal_server_collection_next_model_json) - assert bare_metal_server_collection_next_model != False + # Construct a model instance of BareMetalServerProfile by calling from_dict on the json representation + bare_metal_server_profile_model = BareMetalServerProfile.from_dict(bare_metal_server_profile_model_json) + assert bare_metal_server_profile_model != False - # Construct a model instance of BareMetalServerCollectionNext by calling from_dict on the json representation - bare_metal_server_collection_next_model_dict = BareMetalServerCollectionNext.from_dict(bare_metal_server_collection_next_model_json).__dict__ - bare_metal_server_collection_next_model2 = BareMetalServerCollectionNext(**bare_metal_server_collection_next_model_dict) + # Construct a model instance of BareMetalServerProfile by calling from_dict on the json representation + bare_metal_server_profile_model_dict = BareMetalServerProfile.from_dict(bare_metal_server_profile_model_json).__dict__ + bare_metal_server_profile_model2 = BareMetalServerProfile(**bare_metal_server_profile_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_collection_next_model == bare_metal_server_collection_next_model2 + assert bare_metal_server_profile_model == bare_metal_server_profile_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_collection_next_model_json2 = bare_metal_server_collection_next_model.to_dict() - assert bare_metal_server_collection_next_model_json2 == bare_metal_server_collection_next_model_json + bare_metal_server_profile_model_json2 = bare_metal_server_profile_model.to_dict() + assert bare_metal_server_profile_model_json2 == bare_metal_server_profile_model_json -class TestModel_BareMetalServerConsoleAccessToken: +class TestModel_BareMetalServerProfileCPUArchitecture: """ - Test Class for BareMetalServerConsoleAccessToken + Test Class for BareMetalServerProfileCPUArchitecture """ - def test_bare_metal_server_console_access_token_serialization(self): + def test_bare_metal_server_profile_cpu_architecture_serialization(self): """ - Test serialization/deserialization for BareMetalServerConsoleAccessToken + Test serialization/deserialization for BareMetalServerProfileCPUArchitecture """ - # Construct a json representation of a BareMetalServerConsoleAccessToken model - bare_metal_server_console_access_token_model_json = {} - bare_metal_server_console_access_token_model_json['access_token'] = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI' - bare_metal_server_console_access_token_model_json['console_type'] = 'serial' - bare_metal_server_console_access_token_model_json['created_at'] = '2020-07-27T21:50:14Z' - bare_metal_server_console_access_token_model_json['expires_at'] = '2020-07-27T21:51:14Z' - bare_metal_server_console_access_token_model_json['force'] = False - bare_metal_server_console_access_token_model_json['href'] = 'wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI' + # Construct a json representation of a BareMetalServerProfileCPUArchitecture model + bare_metal_server_profile_cpu_architecture_model_json = {} + bare_metal_server_profile_cpu_architecture_model_json['default'] = 'amd64' + bare_metal_server_profile_cpu_architecture_model_json['type'] = 'fixed' + bare_metal_server_profile_cpu_architecture_model_json['value'] = 'amd64' - # Construct a model instance of BareMetalServerConsoleAccessToken by calling from_dict on the json representation - bare_metal_server_console_access_token_model = BareMetalServerConsoleAccessToken.from_dict(bare_metal_server_console_access_token_model_json) - assert bare_metal_server_console_access_token_model != False + # Construct a model instance of BareMetalServerProfileCPUArchitecture by calling from_dict on the json representation + bare_metal_server_profile_cpu_architecture_model = BareMetalServerProfileCPUArchitecture.from_dict(bare_metal_server_profile_cpu_architecture_model_json) + assert bare_metal_server_profile_cpu_architecture_model != False - # Construct a model instance of BareMetalServerConsoleAccessToken by calling from_dict on the json representation - bare_metal_server_console_access_token_model_dict = BareMetalServerConsoleAccessToken.from_dict(bare_metal_server_console_access_token_model_json).__dict__ - bare_metal_server_console_access_token_model2 = BareMetalServerConsoleAccessToken(**bare_metal_server_console_access_token_model_dict) + # Construct a model instance of BareMetalServerProfileCPUArchitecture by calling from_dict on the json representation + bare_metal_server_profile_cpu_architecture_model_dict = BareMetalServerProfileCPUArchitecture.from_dict(bare_metal_server_profile_cpu_architecture_model_json).__dict__ + bare_metal_server_profile_cpu_architecture_model2 = BareMetalServerProfileCPUArchitecture(**bare_metal_server_profile_cpu_architecture_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_console_access_token_model == bare_metal_server_console_access_token_model2 + assert bare_metal_server_profile_cpu_architecture_model == bare_metal_server_profile_cpu_architecture_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_console_access_token_model_json2 = bare_metal_server_console_access_token_model.to_dict() - assert bare_metal_server_console_access_token_model_json2 == bare_metal_server_console_access_token_model_json + bare_metal_server_profile_cpu_architecture_model_json2 = bare_metal_server_profile_cpu_architecture_model.to_dict() + assert bare_metal_server_profile_cpu_architecture_model_json2 == bare_metal_server_profile_cpu_architecture_model_json -class TestModel_BareMetalServerDisk: +class TestModel_BareMetalServerProfileCollection: """ - Test Class for BareMetalServerDisk + Test Class for BareMetalServerProfileCollection """ - def test_bare_metal_server_disk_serialization(self): + def test_bare_metal_server_profile_collection_serialization(self): """ - Test serialization/deserialization for BareMetalServerDisk + Test serialization/deserialization for BareMetalServerProfileCollection """ - # Construct a json representation of a BareMetalServerDisk model - bare_metal_server_disk_model_json = {} - bare_metal_server_disk_model_json['created_at'] = '2019-01-01T12:00:00Z' - bare_metal_server_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_disk_model_json['interface_type'] = 'fcp' - bare_metal_server_disk_model_json['name'] = 'my-bare-metal-server-disk' - bare_metal_server_disk_model_json['resource_type'] = 'bare_metal_server_disk' - bare_metal_server_disk_model_json['size'] = 100 + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BareMetalServerDisk by calling from_dict on the json representation - bare_metal_server_disk_model = BareMetalServerDisk.from_dict(bare_metal_server_disk_model_json) - assert bare_metal_server_disk_model != False + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_server/profiles/bx2d-metal-192x768?limit=50' - # Construct a model instance of BareMetalServerDisk by calling from_dict on the json representation - bare_metal_server_disk_model_dict = BareMetalServerDisk.from_dict(bare_metal_server_disk_model_json).__dict__ - bare_metal_server_disk_model2 = BareMetalServerDisk(**bare_metal_server_disk_model_dict) + bare_metal_server_profile_bandwidth_model = {} # BareMetalServerProfileBandwidthFixed + bare_metal_server_profile_bandwidth_model['type'] = 'fixed' + bare_metal_server_profile_bandwidth_model['value'] = 100000 - # Verify the model instances are equivalent - assert bare_metal_server_disk_model == bare_metal_server_disk_model2 + bare_metal_server_profile_console_types_model = {} # BareMetalServerProfileConsoleTypes + bare_metal_server_profile_console_types_model['type'] = 'enum' + bare_metal_server_profile_console_types_model['values'] = ['serial', 'vnc'] - # Convert model instance back to dict and verify no loss of data - bare_metal_server_disk_model_json2 = bare_metal_server_disk_model.to_dict() - assert bare_metal_server_disk_model_json2 == bare_metal_server_disk_model_json + bare_metal_server_profile_cpu_architecture_model = {} # BareMetalServerProfileCPUArchitecture + bare_metal_server_profile_cpu_architecture_model['default'] = 'amd64' + bare_metal_server_profile_cpu_architecture_model['type'] = 'fixed' + bare_metal_server_profile_cpu_architecture_model['value'] = 'amd64' + bare_metal_server_profile_cpu_core_count_model = {} # BareMetalServerProfileCPUCoreCountFixed + bare_metal_server_profile_cpu_core_count_model['type'] = 'fixed' + bare_metal_server_profile_cpu_core_count_model['value'] = 96 -class TestModel_BareMetalServerDiskCollection: - """ - Test Class for BareMetalServerDiskCollection - """ + bare_metal_server_profile_cpu_socket_count_model = {} # BareMetalServerProfileCPUSocketCountFixed + bare_metal_server_profile_cpu_socket_count_model['type'] = 'fixed' + bare_metal_server_profile_cpu_socket_count_model['value'] = 4 - def test_bare_metal_server_disk_collection_serialization(self): - """ - Test serialization/deserialization for BareMetalServerDiskCollection - """ + bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed + bare_metal_server_profile_disk_quantity_model['type'] = 'fixed' + bare_metal_server_profile_disk_quantity_model['value'] = 1 - # Construct dict forms of any model objects needed in order to build this model. + bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed + bare_metal_server_profile_disk_size_model['type'] = 'fixed' + bare_metal_server_profile_disk_size_model['value'] = 960 - bare_metal_server_disk_model = {} # BareMetalServerDisk - bare_metal_server_disk_model['created_at'] = '2019-01-01T12:00:00Z' - bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_disk_model['interface_type'] = 'fcp' - bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk' - bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' - bare_metal_server_disk_model['size'] = 100 + bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces + bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'sata' + bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' + bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['sata'] - # Construct a json representation of a BareMetalServerDiskCollection model - bare_metal_server_disk_collection_model_json = {} - bare_metal_server_disk_collection_model_json['disks'] = [bare_metal_server_disk_model] + bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk + bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model + bare_metal_server_profile_disk_model['size'] = bare_metal_server_profile_disk_size_model + bare_metal_server_profile_disk_model['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model - # Construct a model instance of BareMetalServerDiskCollection by calling from_dict on the json representation - bare_metal_server_disk_collection_model = BareMetalServerDiskCollection.from_dict(bare_metal_server_disk_collection_model_json) - assert bare_metal_server_disk_collection_model != False + bare_metal_server_profile_memory_model = {} # BareMetalServerProfileMemoryFixed + bare_metal_server_profile_memory_model['type'] = 'fixed' + bare_metal_server_profile_memory_model['value'] = 768 - # Construct a model instance of BareMetalServerDiskCollection by calling from_dict on the json representation - bare_metal_server_disk_collection_model_dict = BareMetalServerDiskCollection.from_dict(bare_metal_server_disk_collection_model_json).__dict__ - bare_metal_server_disk_collection_model2 = BareMetalServerDiskCollection(**bare_metal_server_disk_collection_model_dict) + bare_metal_server_profile_network_attachment_count_model = {} # BareMetalServerProfileNetworkAttachmentCountRange + bare_metal_server_profile_network_attachment_count_model['max'] = 128 + bare_metal_server_profile_network_attachment_count_model['min'] = 1 + bare_metal_server_profile_network_attachment_count_model['type'] = 'range' - # Verify the model instances are equivalent - assert bare_metal_server_disk_collection_model == bare_metal_server_disk_collection_model2 + bare_metal_server_profile_network_interface_count_model = {} # BareMetalServerProfileNetworkInterfaceCountRange + bare_metal_server_profile_network_interface_count_model['max'] = 128 + bare_metal_server_profile_network_interface_count_model['min'] = 1 + bare_metal_server_profile_network_interface_count_model['type'] = 'range' - # Convert model instance back to dict and verify no loss of data - bare_metal_server_disk_collection_model_json2 = bare_metal_server_disk_collection_model.to_dict() - assert bare_metal_server_disk_collection_model_json2 == bare_metal_server_disk_collection_model_json + bare_metal_server_profile_os_architecture_model = {} # BareMetalServerProfileOSArchitecture + bare_metal_server_profile_os_architecture_model['default'] = 'amd64' + bare_metal_server_profile_os_architecture_model['type'] = 'enum' + bare_metal_server_profile_os_architecture_model['values'] = ['amd64'] + bare_metal_server_profile_supported_trusted_platform_module_modes_model = {} # BareMetalServerProfileSupportedTrustedPlatformModuleModes + bare_metal_server_profile_supported_trusted_platform_module_modes_model['default'] = 'disabled' + bare_metal_server_profile_supported_trusted_platform_module_modes_model['type'] = 'enum' + bare_metal_server_profile_supported_trusted_platform_module_modes_model['values'] = ['disabled', 'tpm_2'] -class TestModel_BareMetalServerDiskPatch: - """ - Test Class for BareMetalServerDiskPatch - """ + bare_metal_server_profile_virtual_network_interfaces_supported_model = {} # BareMetalServerProfileVirtualNetworkInterfacesSupported + bare_metal_server_profile_virtual_network_interfaces_supported_model['type'] = 'fixed' + bare_metal_server_profile_virtual_network_interfaces_supported_model['value'] = True - def test_bare_metal_server_disk_patch_serialization(self): - """ - Test serialization/deserialization for BareMetalServerDiskPatch - """ + bare_metal_server_profile_model = {} # BareMetalServerProfile + bare_metal_server_profile_model['bandwidth'] = bare_metal_server_profile_bandwidth_model + bare_metal_server_profile_model['console_types'] = bare_metal_server_profile_console_types_model + bare_metal_server_profile_model['cpu_architecture'] = bare_metal_server_profile_cpu_architecture_model + bare_metal_server_profile_model['cpu_core_count'] = bare_metal_server_profile_cpu_core_count_model + bare_metal_server_profile_model['cpu_socket_count'] = bare_metal_server_profile_cpu_socket_count_model + bare_metal_server_profile_model['disks'] = [bare_metal_server_profile_disk_model] + bare_metal_server_profile_model['family'] = 'balanced' + bare_metal_server_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_server/profiles/bx2-metal-192x768' + bare_metal_server_profile_model['memory'] = bare_metal_server_profile_memory_model + bare_metal_server_profile_model['name'] = 'bx2-metal-192x768' + bare_metal_server_profile_model['network_attachment_count'] = bare_metal_server_profile_network_attachment_count_model + bare_metal_server_profile_model['network_interface_count'] = bare_metal_server_profile_network_interface_count_model + bare_metal_server_profile_model['os_architecture'] = bare_metal_server_profile_os_architecture_model + bare_metal_server_profile_model['resource_type'] = 'bare_metal_server_profile' + bare_metal_server_profile_model['supported_trusted_platform_module_modes'] = bare_metal_server_profile_supported_trusted_platform_module_modes_model + bare_metal_server_profile_model['virtual_network_interfaces_supported'] = bare_metal_server_profile_virtual_network_interfaces_supported_model - # Construct a json representation of a BareMetalServerDiskPatch model - bare_metal_server_disk_patch_model_json = {} - bare_metal_server_disk_patch_model_json['name'] = 'my-bare-metal-server-disk-updated' + # Construct a json representation of a BareMetalServerProfileCollection model + bare_metal_server_profile_collection_model_json = {} + bare_metal_server_profile_collection_model_json['first'] = page_link_model + bare_metal_server_profile_collection_model_json['limit'] = 20 + bare_metal_server_profile_collection_model_json['next'] = page_link_model + bare_metal_server_profile_collection_model_json['profiles'] = [bare_metal_server_profile_model] + bare_metal_server_profile_collection_model_json['total_count'] = 132 - # Construct a model instance of BareMetalServerDiskPatch by calling from_dict on the json representation - bare_metal_server_disk_patch_model = BareMetalServerDiskPatch.from_dict(bare_metal_server_disk_patch_model_json) - assert bare_metal_server_disk_patch_model != False + # Construct a model instance of BareMetalServerProfileCollection by calling from_dict on the json representation + bare_metal_server_profile_collection_model = BareMetalServerProfileCollection.from_dict(bare_metal_server_profile_collection_model_json) + assert bare_metal_server_profile_collection_model != False - # Construct a model instance of BareMetalServerDiskPatch by calling from_dict on the json representation - bare_metal_server_disk_patch_model_dict = BareMetalServerDiskPatch.from_dict(bare_metal_server_disk_patch_model_json).__dict__ - bare_metal_server_disk_patch_model2 = BareMetalServerDiskPatch(**bare_metal_server_disk_patch_model_dict) + # Construct a model instance of BareMetalServerProfileCollection by calling from_dict on the json representation + bare_metal_server_profile_collection_model_dict = BareMetalServerProfileCollection.from_dict(bare_metal_server_profile_collection_model_json).__dict__ + bare_metal_server_profile_collection_model2 = BareMetalServerProfileCollection(**bare_metal_server_profile_collection_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_disk_patch_model == bare_metal_server_disk_patch_model2 + assert bare_metal_server_profile_collection_model == bare_metal_server_profile_collection_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_disk_patch_model_json2 = bare_metal_server_disk_patch_model.to_dict() - assert bare_metal_server_disk_patch_model_json2 == bare_metal_server_disk_patch_model_json + bare_metal_server_profile_collection_model_json2 = bare_metal_server_profile_collection_model.to_dict() + assert bare_metal_server_profile_collection_model_json2 == bare_metal_server_profile_collection_model_json -class TestModel_BareMetalServerFirmware: +class TestModel_BareMetalServerProfileConsoleTypes: """ - Test Class for BareMetalServerFirmware + Test Class for BareMetalServerProfileConsoleTypes """ - def test_bare_metal_server_firmware_serialization(self): + def test_bare_metal_server_profile_console_types_serialization(self): """ - Test serialization/deserialization for BareMetalServerFirmware + Test serialization/deserialization for BareMetalServerProfileConsoleTypes """ - # Construct a json representation of a BareMetalServerFirmware model - bare_metal_server_firmware_model_json = {} - bare_metal_server_firmware_model_json['update'] = 'none' + # Construct a json representation of a BareMetalServerProfileConsoleTypes model + bare_metal_server_profile_console_types_model_json = {} + bare_metal_server_profile_console_types_model_json['type'] = 'enum' + bare_metal_server_profile_console_types_model_json['values'] = ['serial'] - # Construct a model instance of BareMetalServerFirmware by calling from_dict on the json representation - bare_metal_server_firmware_model = BareMetalServerFirmware.from_dict(bare_metal_server_firmware_model_json) - assert bare_metal_server_firmware_model != False + # Construct a model instance of BareMetalServerProfileConsoleTypes by calling from_dict on the json representation + bare_metal_server_profile_console_types_model = BareMetalServerProfileConsoleTypes.from_dict(bare_metal_server_profile_console_types_model_json) + assert bare_metal_server_profile_console_types_model != False - # Construct a model instance of BareMetalServerFirmware by calling from_dict on the json representation - bare_metal_server_firmware_model_dict = BareMetalServerFirmware.from_dict(bare_metal_server_firmware_model_json).__dict__ - bare_metal_server_firmware_model2 = BareMetalServerFirmware(**bare_metal_server_firmware_model_dict) + # Construct a model instance of BareMetalServerProfileConsoleTypes by calling from_dict on the json representation + bare_metal_server_profile_console_types_model_dict = BareMetalServerProfileConsoleTypes.from_dict(bare_metal_server_profile_console_types_model_json).__dict__ + bare_metal_server_profile_console_types_model2 = BareMetalServerProfileConsoleTypes(**bare_metal_server_profile_console_types_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_firmware_model == bare_metal_server_firmware_model2 + assert bare_metal_server_profile_console_types_model == bare_metal_server_profile_console_types_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_firmware_model_json2 = bare_metal_server_firmware_model.to_dict() - assert bare_metal_server_firmware_model_json2 == bare_metal_server_firmware_model_json + bare_metal_server_profile_console_types_model_json2 = bare_metal_server_profile_console_types_model.to_dict() + assert bare_metal_server_profile_console_types_model_json2 == bare_metal_server_profile_console_types_model_json -class TestModel_BareMetalServerInitialization: +class TestModel_BareMetalServerProfileDisk: """ - Test Class for BareMetalServerInitialization + Test Class for BareMetalServerProfileDisk """ - def test_bare_metal_server_initialization_serialization(self): + def test_bare_metal_server_profile_disk_serialization(self): """ - Test serialization/deserialization for BareMetalServerInitialization + Test serialization/deserialization for BareMetalServerProfileDisk """ # Construct dict forms of any model objects needed in order to build this model. - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - account_reference_model = {} # AccountReference - account_reference_model['id'] = 'bb1b52262f7441a586f49068482f1e60' - account_reference_model['resource_type'] = 'account' - - region_reference_model = {} # RegionReference - region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' - region_reference_model['name'] = 'us-south' - - image_remote_model = {} # ImageRemote - image_remote_model['account'] = account_reference_model - image_remote_model['region'] = region_reference_model - - image_reference_model = {} # ImageReference - image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - image_reference_model['deleted'] = deleted_model - image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - image_reference_model['id'] = 'r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - image_reference_model['name'] = 'my-image' - image_reference_model['remote'] = image_remote_model - image_reference_model['resource_type'] = 'image' + bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed + bare_metal_server_profile_disk_quantity_model['type'] = 'fixed' + bare_metal_server_profile_disk_quantity_model['value'] = 4 - key_reference_model = {} # KeyReference - key_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45' - key_reference_model['deleted'] = deleted_model - key_reference_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' - key_reference_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' - key_reference_model['name'] = 'my-key-1' + bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed + bare_metal_server_profile_disk_size_model['type'] = 'fixed' + bare_metal_server_profile_disk_size_model['value'] = 100 - bare_metal_server_initialization_user_account_model = {} # BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount - bare_metal_server_initialization_user_account_model['encrypted_password'] = 'qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==' - bare_metal_server_initialization_user_account_model['encryption_key'] = key_reference_model - bare_metal_server_initialization_user_account_model['resource_type'] = 'host_user_account' - bare_metal_server_initialization_user_account_model['username'] = 'Administrator' + bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces + bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp' + bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' + bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp'] - # Construct a json representation of a BareMetalServerInitialization model - bare_metal_server_initialization_model_json = {} - bare_metal_server_initialization_model_json['image'] = image_reference_model - bare_metal_server_initialization_model_json['keys'] = [key_reference_model] - bare_metal_server_initialization_model_json['user_accounts'] = [bare_metal_server_initialization_user_account_model] + # Construct a json representation of a BareMetalServerProfileDisk model + bare_metal_server_profile_disk_model_json = {} + bare_metal_server_profile_disk_model_json['quantity'] = bare_metal_server_profile_disk_quantity_model + bare_metal_server_profile_disk_model_json['size'] = bare_metal_server_profile_disk_size_model + bare_metal_server_profile_disk_model_json['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model - # Construct a model instance of BareMetalServerInitialization by calling from_dict on the json representation - bare_metal_server_initialization_model = BareMetalServerInitialization.from_dict(bare_metal_server_initialization_model_json) - assert bare_metal_server_initialization_model != False + # Construct a model instance of BareMetalServerProfileDisk by calling from_dict on the json representation + bare_metal_server_profile_disk_model = BareMetalServerProfileDisk.from_dict(bare_metal_server_profile_disk_model_json) + assert bare_metal_server_profile_disk_model != False - # Construct a model instance of BareMetalServerInitialization by calling from_dict on the json representation - bare_metal_server_initialization_model_dict = BareMetalServerInitialization.from_dict(bare_metal_server_initialization_model_json).__dict__ - bare_metal_server_initialization_model2 = BareMetalServerInitialization(**bare_metal_server_initialization_model_dict) + # Construct a model instance of BareMetalServerProfileDisk by calling from_dict on the json representation + bare_metal_server_profile_disk_model_dict = BareMetalServerProfileDisk.from_dict(bare_metal_server_profile_disk_model_json).__dict__ + bare_metal_server_profile_disk_model2 = BareMetalServerProfileDisk(**bare_metal_server_profile_disk_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_initialization_model == bare_metal_server_initialization_model2 + assert bare_metal_server_profile_disk_model == bare_metal_server_profile_disk_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_initialization_model_json2 = bare_metal_server_initialization_model.to_dict() - assert bare_metal_server_initialization_model_json2 == bare_metal_server_initialization_model_json + bare_metal_server_profile_disk_model_json2 = bare_metal_server_profile_disk_model.to_dict() + assert bare_metal_server_profile_disk_model_json2 == bare_metal_server_profile_disk_model_json -class TestModel_BareMetalServerInitializationPrototype: +class TestModel_BareMetalServerProfileDiskSupportedInterfaces: """ - Test Class for BareMetalServerInitializationPrototype + Test Class for BareMetalServerProfileDiskSupportedInterfaces """ - def test_bare_metal_server_initialization_prototype_serialization(self): + def test_bare_metal_server_profile_disk_supported_interfaces_serialization(self): """ - Test serialization/deserialization for BareMetalServerInitializationPrototype + Test serialization/deserialization for BareMetalServerProfileDiskSupportedInterfaces """ - # Construct dict forms of any model objects needed in order to build this model. - - image_identity_model = {} # ImageIdentityById - image_identity_model['id'] = 'r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - - key_identity_model = {} # KeyIdentityById - key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - - # Construct a json representation of a BareMetalServerInitializationPrototype model - bare_metal_server_initialization_prototype_model_json = {} - bare_metal_server_initialization_prototype_model_json['image'] = image_identity_model - bare_metal_server_initialization_prototype_model_json['keys'] = [key_identity_model] - bare_metal_server_initialization_prototype_model_json['user_data'] = 'testString' + # Construct a json representation of a BareMetalServerProfileDiskSupportedInterfaces model + bare_metal_server_profile_disk_supported_interfaces_model_json = {} + bare_metal_server_profile_disk_supported_interfaces_model_json['default'] = 'fcp' + bare_metal_server_profile_disk_supported_interfaces_model_json['type'] = 'enum' + bare_metal_server_profile_disk_supported_interfaces_model_json['values'] = ['fcp'] - # Construct a model instance of BareMetalServerInitializationPrototype by calling from_dict on the json representation - bare_metal_server_initialization_prototype_model = BareMetalServerInitializationPrototype.from_dict(bare_metal_server_initialization_prototype_model_json) - assert bare_metal_server_initialization_prototype_model != False + # Construct a model instance of BareMetalServerProfileDiskSupportedInterfaces by calling from_dict on the json representation + bare_metal_server_profile_disk_supported_interfaces_model = BareMetalServerProfileDiskSupportedInterfaces.from_dict(bare_metal_server_profile_disk_supported_interfaces_model_json) + assert bare_metal_server_profile_disk_supported_interfaces_model != False - # Construct a model instance of BareMetalServerInitializationPrototype by calling from_dict on the json representation - bare_metal_server_initialization_prototype_model_dict = BareMetalServerInitializationPrototype.from_dict(bare_metal_server_initialization_prototype_model_json).__dict__ - bare_metal_server_initialization_prototype_model2 = BareMetalServerInitializationPrototype(**bare_metal_server_initialization_prototype_model_dict) + # Construct a model instance of BareMetalServerProfileDiskSupportedInterfaces by calling from_dict on the json representation + bare_metal_server_profile_disk_supported_interfaces_model_dict = BareMetalServerProfileDiskSupportedInterfaces.from_dict(bare_metal_server_profile_disk_supported_interfaces_model_json).__dict__ + bare_metal_server_profile_disk_supported_interfaces_model2 = BareMetalServerProfileDiskSupportedInterfaces(**bare_metal_server_profile_disk_supported_interfaces_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_initialization_prototype_model == bare_metal_server_initialization_prototype_model2 + assert bare_metal_server_profile_disk_supported_interfaces_model == bare_metal_server_profile_disk_supported_interfaces_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_initialization_prototype_model_json2 = bare_metal_server_initialization_prototype_model.to_dict() - assert bare_metal_server_initialization_prototype_model_json2 == bare_metal_server_initialization_prototype_model_json + bare_metal_server_profile_disk_supported_interfaces_model_json2 = bare_metal_server_profile_disk_supported_interfaces_model.to_dict() + assert bare_metal_server_profile_disk_supported_interfaces_model_json2 == bare_metal_server_profile_disk_supported_interfaces_model_json -class TestModel_BareMetalServerLifecycleReason: +class TestModel_BareMetalServerProfileOSArchitecture: """ - Test Class for BareMetalServerLifecycleReason + Test Class for BareMetalServerProfileOSArchitecture """ - def test_bare_metal_server_lifecycle_reason_serialization(self): + def test_bare_metal_server_profile_os_architecture_serialization(self): """ - Test serialization/deserialization for BareMetalServerLifecycleReason + Test serialization/deserialization for BareMetalServerProfileOSArchitecture """ - # Construct a json representation of a BareMetalServerLifecycleReason model - bare_metal_server_lifecycle_reason_model_json = {} - bare_metal_server_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider' - bare_metal_server_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' - bare_metal_server_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + # Construct a json representation of a BareMetalServerProfileOSArchitecture model + bare_metal_server_profile_os_architecture_model_json = {} + bare_metal_server_profile_os_architecture_model_json['default'] = 'amd64' + bare_metal_server_profile_os_architecture_model_json['type'] = 'enum' + bare_metal_server_profile_os_architecture_model_json['values'] = ['amd64'] - # Construct a model instance of BareMetalServerLifecycleReason by calling from_dict on the json representation - bare_metal_server_lifecycle_reason_model = BareMetalServerLifecycleReason.from_dict(bare_metal_server_lifecycle_reason_model_json) - assert bare_metal_server_lifecycle_reason_model != False + # Construct a model instance of BareMetalServerProfileOSArchitecture by calling from_dict on the json representation + bare_metal_server_profile_os_architecture_model = BareMetalServerProfileOSArchitecture.from_dict(bare_metal_server_profile_os_architecture_model_json) + assert bare_metal_server_profile_os_architecture_model != False - # Construct a model instance of BareMetalServerLifecycleReason by calling from_dict on the json representation - bare_metal_server_lifecycle_reason_model_dict = BareMetalServerLifecycleReason.from_dict(bare_metal_server_lifecycle_reason_model_json).__dict__ - bare_metal_server_lifecycle_reason_model2 = BareMetalServerLifecycleReason(**bare_metal_server_lifecycle_reason_model_dict) + # Construct a model instance of BareMetalServerProfileOSArchitecture by calling from_dict on the json representation + bare_metal_server_profile_os_architecture_model_dict = BareMetalServerProfileOSArchitecture.from_dict(bare_metal_server_profile_os_architecture_model_json).__dict__ + bare_metal_server_profile_os_architecture_model2 = BareMetalServerProfileOSArchitecture(**bare_metal_server_profile_os_architecture_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_lifecycle_reason_model == bare_metal_server_lifecycle_reason_model2 + assert bare_metal_server_profile_os_architecture_model == bare_metal_server_profile_os_architecture_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_lifecycle_reason_model_json2 = bare_metal_server_lifecycle_reason_model.to_dict() - assert bare_metal_server_lifecycle_reason_model_json2 == bare_metal_server_lifecycle_reason_model_json + bare_metal_server_profile_os_architecture_model_json2 = bare_metal_server_profile_os_architecture_model.to_dict() + assert bare_metal_server_profile_os_architecture_model_json2 == bare_metal_server_profile_os_architecture_model_json -class TestModel_BareMetalServerNetworkAttachmentCollection: +class TestModel_BareMetalServerProfileReference: """ - Test Class for BareMetalServerNetworkAttachmentCollection + Test Class for BareMetalServerProfileReference """ - def test_bare_metal_server_network_attachment_collection_serialization(self): + def test_bare_metal_server_profile_reference_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkAttachmentCollection + Test serialization/deserialization for BareMetalServerProfileReference """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a BareMetalServerProfileReference model + bare_metal_server_profile_reference_model_json = {} + bare_metal_server_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768' + bare_metal_server_profile_reference_model_json['name'] = 'bx2-metal-192x768' + bare_metal_server_profile_reference_model_json['resource_type'] = 'bare_metal_server_profile' - bare_metal_server_network_attachment_collection_first_model = {} # BareMetalServerNetworkAttachmentCollectionFirst - bare_metal_server_network_attachment_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20' + # Construct a model instance of BareMetalServerProfileReference by calling from_dict on the json representation + bare_metal_server_profile_reference_model = BareMetalServerProfileReference.from_dict(bare_metal_server_profile_reference_model_json) + assert bare_metal_server_profile_reference_model != False - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + # Construct a model instance of BareMetalServerProfileReference by calling from_dict on the json representation + bare_metal_server_profile_reference_model_dict = BareMetalServerProfileReference.from_dict(bare_metal_server_profile_reference_model_json).__dict__ + bare_metal_server_profile_reference_model2 = BareMetalServerProfileReference(**bare_metal_server_profile_reference_model_dict) - reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '192.168.3.4' - reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model['name'] = 'my-reserved-ip' - reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + # Verify the model instances are equivalent + assert bare_metal_server_profile_reference_model == bare_metal_server_profile_reference_model2 - subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['name'] = 'my-subnet' - subnet_reference_model['resource_type'] = 'subnet' + # Convert model instance back to dict and verify no loss of data + bare_metal_server_profile_reference_model_json2 = bare_metal_server_profile_reference_model.to_dict() + assert bare_metal_server_profile_reference_model_json2 == bare_metal_server_profile_reference_model_json - virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' - virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' - bare_metal_server_network_attachment_model = {} # BareMetalServerNetworkAttachmentByPCI - bare_metal_server_network_attachment_model['created_at'] = '2019-01-01T12:00:00Z' - bare_metal_server_network_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_model['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_model['lifecycle_state'] = 'stable' - bare_metal_server_network_attachment_model['name'] = 'my-bare-metal-server-network-attachment' - bare_metal_server_network_attachment_model['port_speed'] = 1000 - bare_metal_server_network_attachment_model['primary_ip'] = reserved_ip_reference_model - bare_metal_server_network_attachment_model['resource_type'] = 'bare_metal_server_network_attachment' - bare_metal_server_network_attachment_model['subnet'] = subnet_reference_model - bare_metal_server_network_attachment_model['type'] = 'primary' - bare_metal_server_network_attachment_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model - bare_metal_server_network_attachment_model['allowed_vlans'] = [4] - bare_metal_server_network_attachment_model['interface_type'] = 'pci' +class TestModel_BareMetalServerProfileSupportedTrustedPlatformModuleModes: + """ + Test Class for BareMetalServerProfileSupportedTrustedPlatformModuleModes + """ - bare_metal_server_network_attachment_collection_next_model = {} # BareMetalServerNetworkAttachmentCollectionNext - bare_metal_server_network_attachment_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' + def test_bare_metal_server_profile_supported_trusted_platform_module_modes_serialization(self): + """ + Test serialization/deserialization for BareMetalServerProfileSupportedTrustedPlatformModuleModes + """ - # Construct a json representation of a BareMetalServerNetworkAttachmentCollection model - bare_metal_server_network_attachment_collection_model_json = {} - bare_metal_server_network_attachment_collection_model_json['first'] = bare_metal_server_network_attachment_collection_first_model - bare_metal_server_network_attachment_collection_model_json['limit'] = 20 - bare_metal_server_network_attachment_collection_model_json['network_attachments'] = [bare_metal_server_network_attachment_model] - bare_metal_server_network_attachment_collection_model_json['next'] = bare_metal_server_network_attachment_collection_next_model - bare_metal_server_network_attachment_collection_model_json['total_count'] = 132 + # Construct a json representation of a BareMetalServerProfileSupportedTrustedPlatformModuleModes model + bare_metal_server_profile_supported_trusted_platform_module_modes_model_json = {} + bare_metal_server_profile_supported_trusted_platform_module_modes_model_json['default'] = 'disabled' + bare_metal_server_profile_supported_trusted_platform_module_modes_model_json['type'] = 'enum' + bare_metal_server_profile_supported_trusted_platform_module_modes_model_json['values'] = ['disabled'] - # Construct a model instance of BareMetalServerNetworkAttachmentCollection by calling from_dict on the json representation - bare_metal_server_network_attachment_collection_model = BareMetalServerNetworkAttachmentCollection.from_dict(bare_metal_server_network_attachment_collection_model_json) - assert bare_metal_server_network_attachment_collection_model != False + # Construct a model instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes by calling from_dict on the json representation + bare_metal_server_profile_supported_trusted_platform_module_modes_model = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(bare_metal_server_profile_supported_trusted_platform_module_modes_model_json) + assert bare_metal_server_profile_supported_trusted_platform_module_modes_model != False - # Construct a model instance of BareMetalServerNetworkAttachmentCollection by calling from_dict on the json representation - bare_metal_server_network_attachment_collection_model_dict = BareMetalServerNetworkAttachmentCollection.from_dict(bare_metal_server_network_attachment_collection_model_json).__dict__ - bare_metal_server_network_attachment_collection_model2 = BareMetalServerNetworkAttachmentCollection(**bare_metal_server_network_attachment_collection_model_dict) + # Construct a model instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes by calling from_dict on the json representation + bare_metal_server_profile_supported_trusted_platform_module_modes_model_dict = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(bare_metal_server_profile_supported_trusted_platform_module_modes_model_json).__dict__ + bare_metal_server_profile_supported_trusted_platform_module_modes_model2 = BareMetalServerProfileSupportedTrustedPlatformModuleModes(**bare_metal_server_profile_supported_trusted_platform_module_modes_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_attachment_collection_model == bare_metal_server_network_attachment_collection_model2 + assert bare_metal_server_profile_supported_trusted_platform_module_modes_model == bare_metal_server_profile_supported_trusted_platform_module_modes_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_attachment_collection_model_json2 = bare_metal_server_network_attachment_collection_model.to_dict() - assert bare_metal_server_network_attachment_collection_model_json2 == bare_metal_server_network_attachment_collection_model_json + bare_metal_server_profile_supported_trusted_platform_module_modes_model_json2 = bare_metal_server_profile_supported_trusted_platform_module_modes_model.to_dict() + assert bare_metal_server_profile_supported_trusted_platform_module_modes_model_json2 == bare_metal_server_profile_supported_trusted_platform_module_modes_model_json -class TestModel_BareMetalServerNetworkAttachmentCollectionFirst: +class TestModel_BareMetalServerProfileVirtualNetworkInterfacesSupported: """ - Test Class for BareMetalServerNetworkAttachmentCollectionFirst + Test Class for BareMetalServerProfileVirtualNetworkInterfacesSupported """ - def test_bare_metal_server_network_attachment_collection_first_serialization(self): + def test_bare_metal_server_profile_virtual_network_interfaces_supported_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkAttachmentCollectionFirst + Test serialization/deserialization for BareMetalServerProfileVirtualNetworkInterfacesSupported """ - # Construct a json representation of a BareMetalServerNetworkAttachmentCollectionFirst model - bare_metal_server_network_attachment_collection_first_model_json = {} - bare_metal_server_network_attachment_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20' + # Construct a json representation of a BareMetalServerProfileVirtualNetworkInterfacesSupported model + bare_metal_server_profile_virtual_network_interfaces_supported_model_json = {} + bare_metal_server_profile_virtual_network_interfaces_supported_model_json['type'] = 'fixed' + bare_metal_server_profile_virtual_network_interfaces_supported_model_json['value'] = True - # Construct a model instance of BareMetalServerNetworkAttachmentCollectionFirst by calling from_dict on the json representation - bare_metal_server_network_attachment_collection_first_model = BareMetalServerNetworkAttachmentCollectionFirst.from_dict(bare_metal_server_network_attachment_collection_first_model_json) - assert bare_metal_server_network_attachment_collection_first_model != False + # Construct a model instance of BareMetalServerProfileVirtualNetworkInterfacesSupported by calling from_dict on the json representation + bare_metal_server_profile_virtual_network_interfaces_supported_model = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(bare_metal_server_profile_virtual_network_interfaces_supported_model_json) + assert bare_metal_server_profile_virtual_network_interfaces_supported_model != False - # Construct a model instance of BareMetalServerNetworkAttachmentCollectionFirst by calling from_dict on the json representation - bare_metal_server_network_attachment_collection_first_model_dict = BareMetalServerNetworkAttachmentCollectionFirst.from_dict(bare_metal_server_network_attachment_collection_first_model_json).__dict__ - bare_metal_server_network_attachment_collection_first_model2 = BareMetalServerNetworkAttachmentCollectionFirst(**bare_metal_server_network_attachment_collection_first_model_dict) + # Construct a model instance of BareMetalServerProfileVirtualNetworkInterfacesSupported by calling from_dict on the json representation + bare_metal_server_profile_virtual_network_interfaces_supported_model_dict = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(bare_metal_server_profile_virtual_network_interfaces_supported_model_json).__dict__ + bare_metal_server_profile_virtual_network_interfaces_supported_model2 = BareMetalServerProfileVirtualNetworkInterfacesSupported(**bare_metal_server_profile_virtual_network_interfaces_supported_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_attachment_collection_first_model == bare_metal_server_network_attachment_collection_first_model2 + assert bare_metal_server_profile_virtual_network_interfaces_supported_model == bare_metal_server_profile_virtual_network_interfaces_supported_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_attachment_collection_first_model_json2 = bare_metal_server_network_attachment_collection_first_model.to_dict() - assert bare_metal_server_network_attachment_collection_first_model_json2 == bare_metal_server_network_attachment_collection_first_model_json + bare_metal_server_profile_virtual_network_interfaces_supported_model_json2 = bare_metal_server_profile_virtual_network_interfaces_supported_model.to_dict() + assert bare_metal_server_profile_virtual_network_interfaces_supported_model_json2 == bare_metal_server_profile_virtual_network_interfaces_supported_model_json -class TestModel_BareMetalServerNetworkAttachmentCollectionNext: +class TestModel_BareMetalServerStatusReason: """ - Test Class for BareMetalServerNetworkAttachmentCollectionNext + Test Class for BareMetalServerStatusReason """ - def test_bare_metal_server_network_attachment_collection_next_serialization(self): + def test_bare_metal_server_status_reason_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkAttachmentCollectionNext + Test serialization/deserialization for BareMetalServerStatusReason """ - # Construct a json representation of a BareMetalServerNetworkAttachmentCollectionNext model - bare_metal_server_network_attachment_collection_next_model_json = {} - bare_metal_server_network_attachment_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' + # Construct a json representation of a BareMetalServerStatusReason model + bare_metal_server_status_reason_model_json = {} + bare_metal_server_status_reason_model_json['code'] = 'cannot_start_capacity' + bare_metal_server_status_reason_model_json['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.' + bare_metal_server_status_reason_model_json['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html' - # Construct a model instance of BareMetalServerNetworkAttachmentCollectionNext by calling from_dict on the json representation - bare_metal_server_network_attachment_collection_next_model = BareMetalServerNetworkAttachmentCollectionNext.from_dict(bare_metal_server_network_attachment_collection_next_model_json) - assert bare_metal_server_network_attachment_collection_next_model != False + # Construct a model instance of BareMetalServerStatusReason by calling from_dict on the json representation + bare_metal_server_status_reason_model = BareMetalServerStatusReason.from_dict(bare_metal_server_status_reason_model_json) + assert bare_metal_server_status_reason_model != False - # Construct a model instance of BareMetalServerNetworkAttachmentCollectionNext by calling from_dict on the json representation - bare_metal_server_network_attachment_collection_next_model_dict = BareMetalServerNetworkAttachmentCollectionNext.from_dict(bare_metal_server_network_attachment_collection_next_model_json).__dict__ - bare_metal_server_network_attachment_collection_next_model2 = BareMetalServerNetworkAttachmentCollectionNext(**bare_metal_server_network_attachment_collection_next_model_dict) + # Construct a model instance of BareMetalServerStatusReason by calling from_dict on the json representation + bare_metal_server_status_reason_model_dict = BareMetalServerStatusReason.from_dict(bare_metal_server_status_reason_model_json).__dict__ + bare_metal_server_status_reason_model2 = BareMetalServerStatusReason(**bare_metal_server_status_reason_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_attachment_collection_next_model == bare_metal_server_network_attachment_collection_next_model2 + assert bare_metal_server_status_reason_model == bare_metal_server_status_reason_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_attachment_collection_next_model_json2 = bare_metal_server_network_attachment_collection_next_model.to_dict() - assert bare_metal_server_network_attachment_collection_next_model_json2 == bare_metal_server_network_attachment_collection_next_model_json + bare_metal_server_status_reason_model_json2 = bare_metal_server_status_reason_model.to_dict() + assert bare_metal_server_status_reason_model_json2 == bare_metal_server_status_reason_model_json -class TestModel_BareMetalServerNetworkAttachmentPatch: +class TestModel_BareMetalServerTrustedPlatformModule: """ - Test Class for BareMetalServerNetworkAttachmentPatch + Test Class for BareMetalServerTrustedPlatformModule """ - def test_bare_metal_server_network_attachment_patch_serialization(self): + def test_bare_metal_server_trusted_platform_module_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkAttachmentPatch + Test serialization/deserialization for BareMetalServerTrustedPlatformModule """ - # Construct a json representation of a BareMetalServerNetworkAttachmentPatch model - bare_metal_server_network_attachment_patch_model_json = {} - bare_metal_server_network_attachment_patch_model_json['allowed_vlans'] = [4] - bare_metal_server_network_attachment_patch_model_json['name'] = 'my-bare-metal-server-network-attachment-updated' + # Construct a json representation of a BareMetalServerTrustedPlatformModule model + bare_metal_server_trusted_platform_module_model_json = {} + bare_metal_server_trusted_platform_module_model_json['enabled'] = True + bare_metal_server_trusted_platform_module_model_json['mode'] = 'disabled' + bare_metal_server_trusted_platform_module_model_json['supported_modes'] = ['disabled'] - # Construct a model instance of BareMetalServerNetworkAttachmentPatch by calling from_dict on the json representation - bare_metal_server_network_attachment_patch_model = BareMetalServerNetworkAttachmentPatch.from_dict(bare_metal_server_network_attachment_patch_model_json) - assert bare_metal_server_network_attachment_patch_model != False + # Construct a model instance of BareMetalServerTrustedPlatformModule by calling from_dict on the json representation + bare_metal_server_trusted_platform_module_model = BareMetalServerTrustedPlatformModule.from_dict(bare_metal_server_trusted_platform_module_model_json) + assert bare_metal_server_trusted_platform_module_model != False - # Construct a model instance of BareMetalServerNetworkAttachmentPatch by calling from_dict on the json representation - bare_metal_server_network_attachment_patch_model_dict = BareMetalServerNetworkAttachmentPatch.from_dict(bare_metal_server_network_attachment_patch_model_json).__dict__ - bare_metal_server_network_attachment_patch_model2 = BareMetalServerNetworkAttachmentPatch(**bare_metal_server_network_attachment_patch_model_dict) + # Construct a model instance of BareMetalServerTrustedPlatformModule by calling from_dict on the json representation + bare_metal_server_trusted_platform_module_model_dict = BareMetalServerTrustedPlatformModule.from_dict(bare_metal_server_trusted_platform_module_model_json).__dict__ + bare_metal_server_trusted_platform_module_model2 = BareMetalServerTrustedPlatformModule(**bare_metal_server_trusted_platform_module_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_attachment_patch_model == bare_metal_server_network_attachment_patch_model2 + assert bare_metal_server_trusted_platform_module_model == bare_metal_server_trusted_platform_module_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_attachment_patch_model_json2 = bare_metal_server_network_attachment_patch_model.to_dict() - assert bare_metal_server_network_attachment_patch_model_json2 == bare_metal_server_network_attachment_patch_model_json + bare_metal_server_trusted_platform_module_model_json2 = bare_metal_server_trusted_platform_module_model.to_dict() + assert bare_metal_server_trusted_platform_module_model_json2 == bare_metal_server_trusted_platform_module_model_json -class TestModel_BareMetalServerNetworkAttachmentReference: +class TestModel_BareMetalServerTrustedPlatformModulePatch: """ - Test Class for BareMetalServerNetworkAttachmentReference + Test Class for BareMetalServerTrustedPlatformModulePatch """ - def test_bare_metal_server_network_attachment_reference_serialization(self): + def test_bare_metal_server_trusted_platform_module_patch_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkAttachmentReference + Test serialization/deserialization for BareMetalServerTrustedPlatformModulePatch """ - # Construct dict forms of any model objects needed in order to build this model. + # Construct a json representation of a BareMetalServerTrustedPlatformModulePatch model + bare_metal_server_trusted_platform_module_patch_model_json = {} + bare_metal_server_trusted_platform_module_patch_model_json['mode'] = 'disabled' - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + # Construct a model instance of BareMetalServerTrustedPlatformModulePatch by calling from_dict on the json representation + bare_metal_server_trusted_platform_module_patch_model = BareMetalServerTrustedPlatformModulePatch.from_dict(bare_metal_server_trusted_platform_module_patch_model_json) + assert bare_metal_server_trusted_platform_module_patch_model != False - reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' - reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model['name'] = 'my-reserved-ip' - reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + # Construct a model instance of BareMetalServerTrustedPlatformModulePatch by calling from_dict on the json representation + bare_metal_server_trusted_platform_module_patch_model_dict = BareMetalServerTrustedPlatformModulePatch.from_dict(bare_metal_server_trusted_platform_module_patch_model_json).__dict__ + bare_metal_server_trusted_platform_module_patch_model2 = BareMetalServerTrustedPlatformModulePatch(**bare_metal_server_trusted_platform_module_patch_model_dict) - subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['name'] = 'my-subnet' - subnet_reference_model['resource_type'] = 'subnet' + # Verify the model instances are equivalent + assert bare_metal_server_trusted_platform_module_patch_model == bare_metal_server_trusted_platform_module_patch_model2 - virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' - virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' + # Convert model instance back to dict and verify no loss of data + bare_metal_server_trusted_platform_module_patch_model_json2 = bare_metal_server_trusted_platform_module_patch_model.to_dict() + assert bare_metal_server_trusted_platform_module_patch_model_json2 == bare_metal_server_trusted_platform_module_patch_model_json - # Construct a json representation of a BareMetalServerNetworkAttachmentReference model - bare_metal_server_network_attachment_reference_model_json = {} - bare_metal_server_network_attachment_reference_model_json['deleted'] = deleted_model - bare_metal_server_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_reference_model_json['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_reference_model_json['name'] = 'my-bare-metal-server-network-attachment' - bare_metal_server_network_attachment_reference_model_json['primary_ip'] = reserved_ip_reference_model - bare_metal_server_network_attachment_reference_model_json['resource_type'] = 'bare_metal_server_network_attachment' - bare_metal_server_network_attachment_reference_model_json['subnet'] = subnet_reference_model - bare_metal_server_network_attachment_reference_model_json['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model - # Construct a model instance of BareMetalServerNetworkAttachmentReference by calling from_dict on the json representation - bare_metal_server_network_attachment_reference_model = BareMetalServerNetworkAttachmentReference.from_dict(bare_metal_server_network_attachment_reference_model_json) - assert bare_metal_server_network_attachment_reference_model != False +class TestModel_BareMetalServerTrustedPlatformModulePrototype: + """ + Test Class for BareMetalServerTrustedPlatformModulePrototype + """ + + def test_bare_metal_server_trusted_platform_module_prototype_serialization(self): + """ + Test serialization/deserialization for BareMetalServerTrustedPlatformModulePrototype + """ - # Construct a model instance of BareMetalServerNetworkAttachmentReference by calling from_dict on the json representation - bare_metal_server_network_attachment_reference_model_dict = BareMetalServerNetworkAttachmentReference.from_dict(bare_metal_server_network_attachment_reference_model_json).__dict__ - bare_metal_server_network_attachment_reference_model2 = BareMetalServerNetworkAttachmentReference(**bare_metal_server_network_attachment_reference_model_dict) + # Construct a json representation of a BareMetalServerTrustedPlatformModulePrototype model + bare_metal_server_trusted_platform_module_prototype_model_json = {} + bare_metal_server_trusted_platform_module_prototype_model_json['mode'] = 'disabled' + + # Construct a model instance of BareMetalServerTrustedPlatformModulePrototype by calling from_dict on the json representation + bare_metal_server_trusted_platform_module_prototype_model = BareMetalServerTrustedPlatformModulePrototype.from_dict(bare_metal_server_trusted_platform_module_prototype_model_json) + assert bare_metal_server_trusted_platform_module_prototype_model != False + + # Construct a model instance of BareMetalServerTrustedPlatformModulePrototype by calling from_dict on the json representation + bare_metal_server_trusted_platform_module_prototype_model_dict = BareMetalServerTrustedPlatformModulePrototype.from_dict(bare_metal_server_trusted_platform_module_prototype_model_json).__dict__ + bare_metal_server_trusted_platform_module_prototype_model2 = BareMetalServerTrustedPlatformModulePrototype(**bare_metal_server_trusted_platform_module_prototype_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_attachment_reference_model == bare_metal_server_network_attachment_reference_model2 + assert bare_metal_server_trusted_platform_module_prototype_model == bare_metal_server_trusted_platform_module_prototype_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_attachment_reference_model_json2 = bare_metal_server_network_attachment_reference_model.to_dict() - assert bare_metal_server_network_attachment_reference_model_json2 == bare_metal_server_network_attachment_reference_model_json + bare_metal_server_trusted_platform_module_prototype_model_json2 = bare_metal_server_trusted_platform_module_prototype_model.to_dict() + assert bare_metal_server_trusted_platform_module_prototype_model_json2 == bare_metal_server_trusted_platform_module_prototype_model_json -class TestModel_BareMetalServerNetworkInterfaceCollection: +class TestModel_CatalogOfferingVersionPlanReference: """ - Test Class for BareMetalServerNetworkInterfaceCollection + Test Class for CatalogOfferingVersionPlanReference """ - def test_bare_metal_server_network_interface_collection_serialization(self): + def test_catalog_offering_version_plan_reference_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkInterfaceCollection + Test serialization/deserialization for CatalogOfferingVersionPlanReference """ # Construct dict forms of any model objects needed in order to build this model. - bare_metal_server_network_interface_collection_first_model = {} # BareMetalServerNetworkInterfaceCollectionFirst - bare_metal_server_network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20' - deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - floating_ip_reference_model = {} # FloatingIPReference - floating_ip_reference_model['address'] = '203.0.113.1' - floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model['deleted'] = deleted_model - floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model['name'] = 'my-floating-ip' + # Construct a json representation of a CatalogOfferingVersionPlanReference model + catalog_offering_version_plan_reference_model_json = {} + catalog_offering_version_plan_reference_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e' + catalog_offering_version_plan_reference_model_json['deleted'] = deleted_model - reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '192.168.3.4' - reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' - reserved_ip_reference_model['name'] = 'my-reserved-ip' - reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + # Construct a model instance of CatalogOfferingVersionPlanReference by calling from_dict on the json representation + catalog_offering_version_plan_reference_model = CatalogOfferingVersionPlanReference.from_dict(catalog_offering_version_plan_reference_model_json) + assert catalog_offering_version_plan_reference_model != False - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model['deleted'] = deleted_model - security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model['name'] = 'my-security-group' + # Construct a model instance of CatalogOfferingVersionPlanReference by calling from_dict on the json representation + catalog_offering_version_plan_reference_model_dict = CatalogOfferingVersionPlanReference.from_dict(catalog_offering_version_plan_reference_model_json).__dict__ + catalog_offering_version_plan_reference_model2 = CatalogOfferingVersionPlanReference(**catalog_offering_version_plan_reference_model_dict) - subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['name'] = 'my-subnet' - subnet_reference_model['resource_type'] = 'subnet' + # Verify the model instances are equivalent + assert catalog_offering_version_plan_reference_model == catalog_offering_version_plan_reference_model2 - bare_metal_server_network_interface_model = {} # BareMetalServerNetworkInterfaceByHiperSocket - bare_metal_server_network_interface_model['allow_ip_spoofing'] = True - bare_metal_server_network_interface_model['created_at'] = '2019-01-01T12:00:00Z' - bare_metal_server_network_interface_model['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_model['floating_ips'] = [floating_ip_reference_model] - bare_metal_server_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_model['mac_address'] = '02:00:04:00:C4:6A' - bare_metal_server_network_interface_model['name'] = 'my-bare-metal-server-network-interface' - bare_metal_server_network_interface_model['port_speed'] = 1000 - bare_metal_server_network_interface_model['primary_ip'] = reserved_ip_reference_model - bare_metal_server_network_interface_model['resource_type'] = 'network_interface' - bare_metal_server_network_interface_model['security_groups'] = [security_group_reference_model] - bare_metal_server_network_interface_model['status'] = 'available' - bare_metal_server_network_interface_model['subnet'] = subnet_reference_model - bare_metal_server_network_interface_model['type'] = 'primary' - bare_metal_server_network_interface_model['interface_type'] = 'hipersocket' + # Convert model instance back to dict and verify no loss of data + catalog_offering_version_plan_reference_model_json2 = catalog_offering_version_plan_reference_model.to_dict() + assert catalog_offering_version_plan_reference_model_json2 == catalog_offering_version_plan_reference_model_json - bare_metal_server_network_interface_collection_next_model = {} # BareMetalServerNetworkInterfaceCollectionNext - bare_metal_server_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' - # Construct a json representation of a BareMetalServerNetworkInterfaceCollection model - bare_metal_server_network_interface_collection_model_json = {} - bare_metal_server_network_interface_collection_model_json['first'] = bare_metal_server_network_interface_collection_first_model - bare_metal_server_network_interface_collection_model_json['limit'] = 20 - bare_metal_server_network_interface_collection_model_json['network_interfaces'] = [bare_metal_server_network_interface_model] - bare_metal_server_network_interface_collection_model_json['next'] = bare_metal_server_network_interface_collection_next_model - bare_metal_server_network_interface_collection_model_json['total_count'] = 132 +class TestModel_CatalogOfferingVersionReference: + """ + Test Class for CatalogOfferingVersionReference + """ - # Construct a model instance of BareMetalServerNetworkInterfaceCollection by calling from_dict on the json representation - bare_metal_server_network_interface_collection_model = BareMetalServerNetworkInterfaceCollection.from_dict(bare_metal_server_network_interface_collection_model_json) - assert bare_metal_server_network_interface_collection_model != False + def test_catalog_offering_version_reference_serialization(self): + """ + Test serialization/deserialization for CatalogOfferingVersionReference + """ - # Construct a model instance of BareMetalServerNetworkInterfaceCollection by calling from_dict on the json representation - bare_metal_server_network_interface_collection_model_dict = BareMetalServerNetworkInterfaceCollection.from_dict(bare_metal_server_network_interface_collection_model_json).__dict__ - bare_metal_server_network_interface_collection_model2 = BareMetalServerNetworkInterfaceCollection(**bare_metal_server_network_interface_collection_model_dict) + # Construct a json representation of a CatalogOfferingVersionReference model + catalog_offering_version_reference_model_json = {} + catalog_offering_version_reference_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation + catalog_offering_version_reference_model = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json) + assert catalog_offering_version_reference_model != False + + # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation + catalog_offering_version_reference_model_dict = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json).__dict__ + catalog_offering_version_reference_model2 = CatalogOfferingVersionReference(**catalog_offering_version_reference_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_interface_collection_model == bare_metal_server_network_interface_collection_model2 + assert catalog_offering_version_reference_model == catalog_offering_version_reference_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_interface_collection_model_json2 = bare_metal_server_network_interface_collection_model.to_dict() - assert bare_metal_server_network_interface_collection_model_json2 == bare_metal_server_network_interface_collection_model_json + catalog_offering_version_reference_model_json2 = catalog_offering_version_reference_model.to_dict() + assert catalog_offering_version_reference_model_json2 == catalog_offering_version_reference_model_json -class TestModel_BareMetalServerNetworkInterfaceCollectionFirst: +class TestModel_CertificateInstanceReference: """ - Test Class for BareMetalServerNetworkInterfaceCollectionFirst + Test Class for CertificateInstanceReference """ - def test_bare_metal_server_network_interface_collection_first_serialization(self): + def test_certificate_instance_reference_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkInterfaceCollectionFirst + Test serialization/deserialization for CertificateInstanceReference """ - # Construct a json representation of a BareMetalServerNetworkInterfaceCollectionFirst model - bare_metal_server_network_interface_collection_first_model_json = {} - bare_metal_server_network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20' + # Construct a json representation of a CertificateInstanceReference model + certificate_instance_reference_model_json = {} + certificate_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' - # Construct a model instance of BareMetalServerNetworkInterfaceCollectionFirst by calling from_dict on the json representation - bare_metal_server_network_interface_collection_first_model = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(bare_metal_server_network_interface_collection_first_model_json) - assert bare_metal_server_network_interface_collection_first_model != False + # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation + certificate_instance_reference_model = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json) + assert certificate_instance_reference_model != False - # Construct a model instance of BareMetalServerNetworkInterfaceCollectionFirst by calling from_dict on the json representation - bare_metal_server_network_interface_collection_first_model_dict = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(bare_metal_server_network_interface_collection_first_model_json).__dict__ - bare_metal_server_network_interface_collection_first_model2 = BareMetalServerNetworkInterfaceCollectionFirst(**bare_metal_server_network_interface_collection_first_model_dict) + # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation + certificate_instance_reference_model_dict = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json).__dict__ + certificate_instance_reference_model2 = CertificateInstanceReference(**certificate_instance_reference_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_interface_collection_first_model == bare_metal_server_network_interface_collection_first_model2 + assert certificate_instance_reference_model == certificate_instance_reference_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_interface_collection_first_model_json2 = bare_metal_server_network_interface_collection_first_model.to_dict() - assert bare_metal_server_network_interface_collection_first_model_json2 == bare_metal_server_network_interface_collection_first_model_json + certificate_instance_reference_model_json2 = certificate_instance_reference_model.to_dict() + assert certificate_instance_reference_model_json2 == certificate_instance_reference_model_json -class TestModel_BareMetalServerNetworkInterfaceCollectionNext: +class TestModel_CloudObjectStorageBucketReference: """ - Test Class for BareMetalServerNetworkInterfaceCollectionNext + Test Class for CloudObjectStorageBucketReference """ - def test_bare_metal_server_network_interface_collection_next_serialization(self): + def test_cloud_object_storage_bucket_reference_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkInterfaceCollectionNext + Test serialization/deserialization for CloudObjectStorageBucketReference """ - # Construct a json representation of a BareMetalServerNetworkInterfaceCollectionNext model - bare_metal_server_network_interface_collection_next_model_json = {} - bare_metal_server_network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' + # Construct a json representation of a CloudObjectStorageBucketReference model + cloud_object_storage_bucket_reference_model_json = {} + cloud_object_storage_bucket_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket' + cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue' - # Construct a model instance of BareMetalServerNetworkInterfaceCollectionNext by calling from_dict on the json representation - bare_metal_server_network_interface_collection_next_model = BareMetalServerNetworkInterfaceCollectionNext.from_dict(bare_metal_server_network_interface_collection_next_model_json) - assert bare_metal_server_network_interface_collection_next_model != False + # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation + cloud_object_storage_bucket_reference_model = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json) + assert cloud_object_storage_bucket_reference_model != False - # Construct a model instance of BareMetalServerNetworkInterfaceCollectionNext by calling from_dict on the json representation - bare_metal_server_network_interface_collection_next_model_dict = BareMetalServerNetworkInterfaceCollectionNext.from_dict(bare_metal_server_network_interface_collection_next_model_json).__dict__ - bare_metal_server_network_interface_collection_next_model2 = BareMetalServerNetworkInterfaceCollectionNext(**bare_metal_server_network_interface_collection_next_model_dict) + # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation + cloud_object_storage_bucket_reference_model_dict = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json).__dict__ + cloud_object_storage_bucket_reference_model2 = CloudObjectStorageBucketReference(**cloud_object_storage_bucket_reference_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_interface_collection_next_model == bare_metal_server_network_interface_collection_next_model2 + assert cloud_object_storage_bucket_reference_model == cloud_object_storage_bucket_reference_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_interface_collection_next_model_json2 = bare_metal_server_network_interface_collection_next_model.to_dict() - assert bare_metal_server_network_interface_collection_next_model_json2 == bare_metal_server_network_interface_collection_next_model_json + cloud_object_storage_bucket_reference_model_json2 = cloud_object_storage_bucket_reference_model.to_dict() + assert cloud_object_storage_bucket_reference_model_json2 == cloud_object_storage_bucket_reference_model_json -class TestModel_BareMetalServerNetworkInterfacePatch: +class TestModel_CloudObjectStorageObjectReference: """ - Test Class for BareMetalServerNetworkInterfacePatch + Test Class for CloudObjectStorageObjectReference """ - def test_bare_metal_server_network_interface_patch_serialization(self): + def test_cloud_object_storage_object_reference_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkInterfacePatch + Test serialization/deserialization for CloudObjectStorageObjectReference """ - # Construct a json representation of a BareMetalServerNetworkInterfacePatch model - bare_metal_server_network_interface_patch_model_json = {} - bare_metal_server_network_interface_patch_model_json['allow_ip_spoofing'] = True - bare_metal_server_network_interface_patch_model_json['allowed_vlans'] = [4] - bare_metal_server_network_interface_patch_model_json['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_patch_model_json['name'] = 'my-bare-metal-server-network-interface' + # Construct a json representation of a CloudObjectStorageObjectReference model + cloud_object_storage_object_reference_model_json = {} + cloud_object_storage_object_reference_model_json['name'] = 'my-object' - # Construct a model instance of BareMetalServerNetworkInterfacePatch by calling from_dict on the json representation - bare_metal_server_network_interface_patch_model = BareMetalServerNetworkInterfacePatch.from_dict(bare_metal_server_network_interface_patch_model_json) - assert bare_metal_server_network_interface_patch_model != False + # Construct a model instance of CloudObjectStorageObjectReference by calling from_dict on the json representation + cloud_object_storage_object_reference_model = CloudObjectStorageObjectReference.from_dict(cloud_object_storage_object_reference_model_json) + assert cloud_object_storage_object_reference_model != False - # Construct a model instance of BareMetalServerNetworkInterfacePatch by calling from_dict on the json representation - bare_metal_server_network_interface_patch_model_dict = BareMetalServerNetworkInterfacePatch.from_dict(bare_metal_server_network_interface_patch_model_json).__dict__ - bare_metal_server_network_interface_patch_model2 = BareMetalServerNetworkInterfacePatch(**bare_metal_server_network_interface_patch_model_dict) + # Construct a model instance of CloudObjectStorageObjectReference by calling from_dict on the json representation + cloud_object_storage_object_reference_model_dict = CloudObjectStorageObjectReference.from_dict(cloud_object_storage_object_reference_model_json).__dict__ + cloud_object_storage_object_reference_model2 = CloudObjectStorageObjectReference(**cloud_object_storage_object_reference_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_interface_patch_model == bare_metal_server_network_interface_patch_model2 + assert cloud_object_storage_object_reference_model == cloud_object_storage_object_reference_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_interface_patch_model_json2 = bare_metal_server_network_interface_patch_model.to_dict() - assert bare_metal_server_network_interface_patch_model_json2 == bare_metal_server_network_interface_patch_model_json + cloud_object_storage_object_reference_model_json2 = cloud_object_storage_object_reference_model.to_dict() + assert cloud_object_storage_object_reference_model_json2 == cloud_object_storage_object_reference_model_json -class TestModel_BareMetalServerPatch: +class TestModel_ClusterNetwork: """ - Test Class for BareMetalServerPatch + Test Class for ClusterNetwork """ - def test_bare_metal_server_patch_serialization(self): + def test_cluster_network_serialization(self): """ - Test serialization/deserialization for BareMetalServerPatch + Test serialization/deserialization for ClusterNetwork """ # Construct dict forms of any model objects needed in order to build this model. - bare_metal_server_trusted_platform_module_patch_model = {} # BareMetalServerTrustedPlatformModulePatch - bare_metal_server_trusted_platform_module_patch_model['mode'] = 'disabled' + cluster_network_lifecycle_reason_model = {} # ClusterNetworkLifecycleReason + cluster_network_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + cluster_network_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a json representation of a BareMetalServerPatch model - bare_metal_server_patch_model_json = {} - bare_metal_server_patch_model_json['bandwidth'] = 20000 - bare_metal_server_patch_model_json['enable_secure_boot'] = False - bare_metal_server_patch_model_json['name'] = 'my-bare-metal-server' - bare_metal_server_patch_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_patch_model + cluster_network_profile_reference_model = {} # ClusterNetworkProfileReference + cluster_network_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100' + cluster_network_profile_reference_model['name'] = 'h100' + cluster_network_profile_reference_model['resource_type'] = 'cluster_network_profile' - # Construct a model instance of BareMetalServerPatch by calling from_dict on the json representation - bare_metal_server_patch_model = BareMetalServerPatch.from_dict(bare_metal_server_patch_model_json) - assert bare_metal_server_patch_model != False + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['name'] = 'Default' - # Construct a model instance of BareMetalServerPatch by calling from_dict on the json representation - bare_metal_server_patch_model_dict = BareMetalServerPatch.from_dict(bare_metal_server_patch_model_json).__dict__ - bare_metal_server_patch_model2 = BareMetalServerPatch(**bare_metal_server_patch_model_dict) + cluster_network_subnet_prefix_model = {} # ClusterNetworkSubnetPrefix + cluster_network_subnet_prefix_model['allocation_policy'] = 'auto' + cluster_network_subnet_prefix_model['cidr'] = '10.0.0.0/9' + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a ClusterNetwork model + cluster_network_model_json = {} + cluster_network_model_json['created_at'] = '2019-01-01T12:00:00Z' + cluster_network_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_model_json['id'] = '0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_model_json['lifecycle_reasons'] = [cluster_network_lifecycle_reason_model] + cluster_network_model_json['lifecycle_state'] = 'stable' + cluster_network_model_json['name'] = 'my-cluster-network' + cluster_network_model_json['profile'] = cluster_network_profile_reference_model + cluster_network_model_json['resource_group'] = resource_group_reference_model + cluster_network_model_json['resource_type'] = 'cluster_network' + cluster_network_model_json['subnet_prefixes'] = [cluster_network_subnet_prefix_model] + cluster_network_model_json['vpc'] = vpc_reference_model + cluster_network_model_json['zone'] = zone_reference_model + + # Construct a model instance of ClusterNetwork by calling from_dict on the json representation + cluster_network_model = ClusterNetwork.from_dict(cluster_network_model_json) + assert cluster_network_model != False + + # Construct a model instance of ClusterNetwork by calling from_dict on the json representation + cluster_network_model_dict = ClusterNetwork.from_dict(cluster_network_model_json).__dict__ + cluster_network_model2 = ClusterNetwork(**cluster_network_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_patch_model == bare_metal_server_patch_model2 + assert cluster_network_model == cluster_network_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_patch_model_json2 = bare_metal_server_patch_model.to_dict() - assert bare_metal_server_patch_model_json2 == bare_metal_server_patch_model_json + cluster_network_model_json2 = cluster_network_model.to_dict() + assert cluster_network_model_json2 == cluster_network_model_json -class TestModel_BareMetalServerPrimaryNetworkInterfacePrototype: +class TestModel_ClusterNetworkCollection: """ - Test Class for BareMetalServerPrimaryNetworkInterfacePrototype + Test Class for ClusterNetworkCollection """ - def test_bare_metal_server_primary_network_interface_prototype_serialization(self): + def test_cluster_network_collection_serialization(self): """ - Test serialization/deserialization for BareMetalServerPrimaryNetworkInterfacePrototype + Test serialization/deserialization for ClusterNetworkCollection """ # Construct dict forms of any model objects needed in order to build this model. - network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext - network_interface_ip_prototype_model['address'] = '10.0.0.5' - network_interface_ip_prototype_model['auto_delete'] = False - network_interface_ip_prototype_model['name'] = 'my-reserved-ip' + cluster_network_lifecycle_reason_model = {} # ClusterNetworkLifecycleReason + cluster_network_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + cluster_network_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + cluster_network_profile_reference_model = {} # ClusterNetworkProfileReference + cluster_network_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100' + cluster_network_profile_reference_model['name'] = 'h100' + cluster_network_profile_reference_model['resource_type'] = 'cluster_network_profile' - subnet_identity_model = {} # SubnetIdentityById - subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['name'] = 'Default' - # Construct a json representation of a BareMetalServerPrimaryNetworkInterfacePrototype model - bare_metal_server_primary_network_interface_prototype_model_json = {} - bare_metal_server_primary_network_interface_prototype_model_json['allow_ip_spoofing'] = True - bare_metal_server_primary_network_interface_prototype_model_json['allowed_vlans'] = [4] - bare_metal_server_primary_network_interface_prototype_model_json['enable_infrastructure_nat'] = True - bare_metal_server_primary_network_interface_prototype_model_json['interface_type'] = 'pci' - bare_metal_server_primary_network_interface_prototype_model_json['name'] = 'my-bare-metal-server-network-interface' - bare_metal_server_primary_network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model - bare_metal_server_primary_network_interface_prototype_model_json['security_groups'] = [security_group_identity_model] - bare_metal_server_primary_network_interface_prototype_model_json['subnet'] = subnet_identity_model + cluster_network_subnet_prefix_model = {} # ClusterNetworkSubnetPrefix + cluster_network_subnet_prefix_model['allocation_policy'] = 'auto' + cluster_network_subnet_prefix_model['cidr'] = '10.0.0.0/9' - # Construct a model instance of BareMetalServerPrimaryNetworkInterfacePrototype by calling from_dict on the json representation - bare_metal_server_primary_network_interface_prototype_model = BareMetalServerPrimaryNetworkInterfacePrototype.from_dict(bare_metal_server_primary_network_interface_prototype_model_json) - assert bare_metal_server_primary_network_interface_prototype_model != False + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a model instance of BareMetalServerPrimaryNetworkInterfacePrototype by calling from_dict on the json representation - bare_metal_server_primary_network_interface_prototype_model_dict = BareMetalServerPrimaryNetworkInterfacePrototype.from_dict(bare_metal_server_primary_network_interface_prototype_model_json).__dict__ - bare_metal_server_primary_network_interface_prototype_model2 = BareMetalServerPrimaryNetworkInterfacePrototype(**bare_metal_server_primary_network_interface_prototype_model_dict) + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + cluster_network_model = {} # ClusterNetwork + cluster_network_model['created_at'] = '2024-10-28T11:59:46Z' + cluster_network_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_model['id'] = '0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_model['lifecycle_reasons'] = [cluster_network_lifecycle_reason_model] + cluster_network_model['lifecycle_state'] = 'stable' + cluster_network_model['name'] = 'my-cluster-network' + cluster_network_model['profile'] = cluster_network_profile_reference_model + cluster_network_model['resource_group'] = resource_group_reference_model + cluster_network_model['resource_type'] = 'cluster_network' + cluster_network_model['subnet_prefixes'] = [cluster_network_subnet_prefix_model] + cluster_network_model['vpc'] = vpc_reference_model + cluster_network_model['zone'] = zone_reference_model + + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks?limit=50' + + # Construct a json representation of a ClusterNetworkCollection model + cluster_network_collection_model_json = {} + cluster_network_collection_model_json['cluster_networks'] = [cluster_network_model] + cluster_network_collection_model_json['first'] = page_link_model + cluster_network_collection_model_json['limit'] = 20 + cluster_network_collection_model_json['next'] = page_link_model + cluster_network_collection_model_json['total_count'] = 132 + + # Construct a model instance of ClusterNetworkCollection by calling from_dict on the json representation + cluster_network_collection_model = ClusterNetworkCollection.from_dict(cluster_network_collection_model_json) + assert cluster_network_collection_model != False + + # Construct a model instance of ClusterNetworkCollection by calling from_dict on the json representation + cluster_network_collection_model_dict = ClusterNetworkCollection.from_dict(cluster_network_collection_model_json).__dict__ + cluster_network_collection_model2 = ClusterNetworkCollection(**cluster_network_collection_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_primary_network_interface_prototype_model == bare_metal_server_primary_network_interface_prototype_model2 + assert cluster_network_collection_model == cluster_network_collection_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_primary_network_interface_prototype_model_json2 = bare_metal_server_primary_network_interface_prototype_model.to_dict() - assert bare_metal_server_primary_network_interface_prototype_model_json2 == bare_metal_server_primary_network_interface_prototype_model_json + cluster_network_collection_model_json2 = cluster_network_collection_model.to_dict() + assert cluster_network_collection_model_json2 == cluster_network_collection_model_json -class TestModel_BareMetalServerProfile: +class TestModel_ClusterNetworkInterface: """ - Test Class for BareMetalServerProfile + Test Class for ClusterNetworkInterface """ - def test_bare_metal_server_profile_serialization(self): + def test_cluster_network_interface_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfile + Test serialization/deserialization for ClusterNetworkInterface """ # Construct dict forms of any model objects needed in order to build this model. - bare_metal_server_profile_bandwidth_model = {} # BareMetalServerProfileBandwidthFixed - bare_metal_server_profile_bandwidth_model['type'] = 'fixed' - bare_metal_server_profile_bandwidth_model['value'] = 20000 + cluster_network_interface_lifecycle_reason_model = {} # ClusterNetworkInterfaceLifecycleReason + cluster_network_interface_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + cluster_network_interface_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_interface_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - bare_metal_server_profile_console_types_model = {} # BareMetalServerProfileConsoleTypes - bare_metal_server_profile_console_types_model['type'] = 'enum' - bare_metal_server_profile_console_types_model['values'] = ['serial'] + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - bare_metal_server_profile_cpu_architecture_model = {} # BareMetalServerProfileCPUArchitecture - bare_metal_server_profile_cpu_architecture_model['default'] = 'amd64' - bare_metal_server_profile_cpu_architecture_model['type'] = 'fixed' - bare_metal_server_profile_cpu_architecture_model['value'] = 'amd64' + cluster_network_subnet_reserved_ip_reference_model = {} # ClusterNetworkSubnetReservedIPReference + cluster_network_subnet_reserved_ip_reference_model['address'] = '10.1.0.6' + cluster_network_subnet_reserved_ip_reference_model['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['id'] = '63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['name'] = 'my-cluster-network-subnet-reserved-ip' + cluster_network_subnet_reserved_ip_reference_model['resource_type'] = 'cluster_network_subnet_reserved_ip' + + cluster_network_subnet_reference_model = {} # ClusterNetworkSubnetReference + cluster_network_subnet_reference_model['deleted'] = deleted_model + cluster_network_subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_reference_model['resource_type'] = 'cluster_network_subnet' + + cluster_network_interface_target_model = {} # ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext + cluster_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + cluster_network_interface_target_model['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + cluster_network_interface_target_model['name'] = 'my-instance-network-attachment' + cluster_network_interface_target_model['resource_type'] = 'instance_cluster_network_attachment' - bare_metal_server_profile_cpu_core_count_model = {} # BareMetalServerProfileCPUCoreCountFixed - bare_metal_server_profile_cpu_core_count_model['type'] = 'fixed' - bare_metal_server_profile_cpu_core_count_model['value'] = 80 + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' - bare_metal_server_profile_cpu_socket_count_model = {} # BareMetalServerProfileCPUSocketCountFixed - bare_metal_server_profile_cpu_socket_count_model['type'] = 'fixed' - bare_metal_server_profile_cpu_socket_count_model['value'] = 4 + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' - bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed - bare_metal_server_profile_disk_quantity_model['type'] = 'fixed' - bare_metal_server_profile_disk_quantity_model['value'] = 4 + # Construct a json representation of a ClusterNetworkInterface model + cluster_network_interface_model_json = {} + cluster_network_interface_model_json['allow_ip_spoofing'] = True + cluster_network_interface_model_json['auto_delete'] = False + cluster_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z' + cluster_network_interface_model_json['enable_infrastructure_nat'] = False + cluster_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_model_json['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_model_json['lifecycle_reasons'] = [cluster_network_interface_lifecycle_reason_model] + cluster_network_interface_model_json['lifecycle_state'] = 'stable' + cluster_network_interface_model_json['mac_address'] = '02:00:4D:45:45:4D' + cluster_network_interface_model_json['name'] = 'my-cluster-network-interface' + cluster_network_interface_model_json['primary_ip'] = cluster_network_subnet_reserved_ip_reference_model + cluster_network_interface_model_json['resource_type'] = 'cluster_network_interface' + cluster_network_interface_model_json['subnet'] = cluster_network_subnet_reference_model + cluster_network_interface_model_json['target'] = cluster_network_interface_target_model + cluster_network_interface_model_json['vpc'] = vpc_reference_model + cluster_network_interface_model_json['zone'] = zone_reference_model - bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed - bare_metal_server_profile_disk_size_model['type'] = 'fixed' - bare_metal_server_profile_disk_size_model['value'] = 100 + # Construct a model instance of ClusterNetworkInterface by calling from_dict on the json representation + cluster_network_interface_model = ClusterNetworkInterface.from_dict(cluster_network_interface_model_json) + assert cluster_network_interface_model != False - bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces - bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp' - bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' - bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp'] + # Construct a model instance of ClusterNetworkInterface by calling from_dict on the json representation + cluster_network_interface_model_dict = ClusterNetworkInterface.from_dict(cluster_network_interface_model_json).__dict__ + cluster_network_interface_model2 = ClusterNetworkInterface(**cluster_network_interface_model_dict) - bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk - bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model - bare_metal_server_profile_disk_model['size'] = bare_metal_server_profile_disk_size_model - bare_metal_server_profile_disk_model['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model + # Verify the model instances are equivalent + assert cluster_network_interface_model == cluster_network_interface_model2 - bare_metal_server_profile_memory_model = {} # BareMetalServerProfileMemoryFixed - bare_metal_server_profile_memory_model['type'] = 'fixed' - bare_metal_server_profile_memory_model['value'] = 16 + # Convert model instance back to dict and verify no loss of data + cluster_network_interface_model_json2 = cluster_network_interface_model.to_dict() + assert cluster_network_interface_model_json2 == cluster_network_interface_model_json - bare_metal_server_profile_network_attachment_count_model = {} # BareMetalServerProfileNetworkAttachmentCountRange - bare_metal_server_profile_network_attachment_count_model['max'] = 128 - bare_metal_server_profile_network_attachment_count_model['min'] = 1 - bare_metal_server_profile_network_attachment_count_model['type'] = 'range' - bare_metal_server_profile_network_interface_count_model = {} # BareMetalServerProfileNetworkInterfaceCountRange - bare_metal_server_profile_network_interface_count_model['max'] = 128 - bare_metal_server_profile_network_interface_count_model['min'] = 1 - bare_metal_server_profile_network_interface_count_model['type'] = 'range' +class TestModel_ClusterNetworkInterfaceCollection: + """ + Test Class for ClusterNetworkInterfaceCollection + """ - bare_metal_server_profile_os_architecture_model = {} # BareMetalServerProfileOSArchitecture - bare_metal_server_profile_os_architecture_model['default'] = 'amd64' - bare_metal_server_profile_os_architecture_model['type'] = 'enum' - bare_metal_server_profile_os_architecture_model['values'] = ['amd64'] + def test_cluster_network_interface_collection_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkInterfaceCollection + """ - bare_metal_server_profile_supported_trusted_platform_module_modes_model = {} # BareMetalServerProfileSupportedTrustedPlatformModuleModes - bare_metal_server_profile_supported_trusted_platform_module_modes_model['default'] = 'disabled' - bare_metal_server_profile_supported_trusted_platform_module_modes_model['type'] = 'enum' - bare_metal_server_profile_supported_trusted_platform_module_modes_model['values'] = ['disabled'] + # Construct dict forms of any model objects needed in order to build this model. - bare_metal_server_profile_virtual_network_interfaces_supported_model = {} # BareMetalServerProfileVirtualNetworkInterfacesSupported - bare_metal_server_profile_virtual_network_interfaces_supported_model['type'] = 'fixed' - bare_metal_server_profile_virtual_network_interfaces_supported_model['value'] = True + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces?limit=20' - # Construct a json representation of a BareMetalServerProfile model - bare_metal_server_profile_model_json = {} - bare_metal_server_profile_model_json['bandwidth'] = bare_metal_server_profile_bandwidth_model - bare_metal_server_profile_model_json['console_types'] = bare_metal_server_profile_console_types_model - bare_metal_server_profile_model_json['cpu_architecture'] = bare_metal_server_profile_cpu_architecture_model - bare_metal_server_profile_model_json['cpu_core_count'] = bare_metal_server_profile_cpu_core_count_model - bare_metal_server_profile_model_json['cpu_socket_count'] = bare_metal_server_profile_cpu_socket_count_model - bare_metal_server_profile_model_json['disks'] = [bare_metal_server_profile_disk_model] - bare_metal_server_profile_model_json['family'] = 'balanced' - bare_metal_server_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768' - bare_metal_server_profile_model_json['memory'] = bare_metal_server_profile_memory_model - bare_metal_server_profile_model_json['name'] = 'bx2-metal-192x768' - bare_metal_server_profile_model_json['network_attachment_count'] = bare_metal_server_profile_network_attachment_count_model - bare_metal_server_profile_model_json['network_interface_count'] = bare_metal_server_profile_network_interface_count_model - bare_metal_server_profile_model_json['os_architecture'] = bare_metal_server_profile_os_architecture_model - bare_metal_server_profile_model_json['resource_type'] = 'bare_metal_server_profile' - bare_metal_server_profile_model_json['supported_trusted_platform_module_modes'] = bare_metal_server_profile_supported_trusted_platform_module_modes_model - bare_metal_server_profile_model_json['virtual_network_interfaces_supported'] = bare_metal_server_profile_virtual_network_interfaces_supported_model + cluster_network_interface_lifecycle_reason_model = {} # ClusterNetworkInterfaceLifecycleReason + cluster_network_interface_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + cluster_network_interface_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_interface_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a model instance of BareMetalServerProfile by calling from_dict on the json representation - bare_metal_server_profile_model = BareMetalServerProfile.from_dict(bare_metal_server_profile_model_json) - assert bare_metal_server_profile_model != False + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a model instance of BareMetalServerProfile by calling from_dict on the json representation - bare_metal_server_profile_model_dict = BareMetalServerProfile.from_dict(bare_metal_server_profile_model_json).__dict__ - bare_metal_server_profile_model2 = BareMetalServerProfile(**bare_metal_server_profile_model_dict) + cluster_network_subnet_reserved_ip_reference_model = {} # ClusterNetworkSubnetReservedIPReference + cluster_network_subnet_reserved_ip_reference_model['address'] = '10.1.0.6' + cluster_network_subnet_reserved_ip_reference_model['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['id'] = '63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['name'] = 'my-cluster-network-subnet-reserved-ip' + cluster_network_subnet_reserved_ip_reference_model['resource_type'] = 'cluster_network_subnet_reserved_ip' + + cluster_network_subnet_reference_model = {} # ClusterNetworkSubnetReference + cluster_network_subnet_reference_model['deleted'] = deleted_model + cluster_network_subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_reference_model['resource_type'] = 'cluster_network_subnet' + + cluster_network_interface_target_model = {} # ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext + cluster_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + cluster_network_interface_target_model['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + cluster_network_interface_target_model['name'] = 'my-instance-network-attachment' + cluster_network_interface_target_model['resource_type'] = 'instance_cluster_network_attachment' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + cluster_network_interface_model = {} # ClusterNetworkInterface + cluster_network_interface_model['allow_ip_spoofing'] = True + cluster_network_interface_model['auto_delete'] = False + cluster_network_interface_model['created_at'] = '2024-10-25T03:42:32.993000Z' + cluster_network_interface_model['enable_infrastructure_nat'] = False + cluster_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_model['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_model['lifecycle_reasons'] = [cluster_network_interface_lifecycle_reason_model] + cluster_network_interface_model['lifecycle_state'] = 'stable' + cluster_network_interface_model['mac_address'] = '02:00:04:00:C4:6A' + cluster_network_interface_model['name'] = 'my-cluster-network-interface' + cluster_network_interface_model['primary_ip'] = cluster_network_subnet_reserved_ip_reference_model + cluster_network_interface_model['resource_type'] = 'cluster_network_interface' + cluster_network_interface_model['subnet'] = cluster_network_subnet_reference_model + cluster_network_interface_model['target'] = cluster_network_interface_target_model + cluster_network_interface_model['vpc'] = vpc_reference_model + cluster_network_interface_model['zone'] = zone_reference_model + + # Construct a json representation of a ClusterNetworkInterfaceCollection model + cluster_network_interface_collection_model_json = {} + cluster_network_interface_collection_model_json['first'] = page_link_model + cluster_network_interface_collection_model_json['interfaces'] = [cluster_network_interface_model] + cluster_network_interface_collection_model_json['limit'] = 20 + cluster_network_interface_collection_model_json['next'] = page_link_model + cluster_network_interface_collection_model_json['total_count'] = 132 + + # Construct a model instance of ClusterNetworkInterfaceCollection by calling from_dict on the json representation + cluster_network_interface_collection_model = ClusterNetworkInterfaceCollection.from_dict(cluster_network_interface_collection_model_json) + assert cluster_network_interface_collection_model != False + + # Construct a model instance of ClusterNetworkInterfaceCollection by calling from_dict on the json representation + cluster_network_interface_collection_model_dict = ClusterNetworkInterfaceCollection.from_dict(cluster_network_interface_collection_model_json).__dict__ + cluster_network_interface_collection_model2 = ClusterNetworkInterfaceCollection(**cluster_network_interface_collection_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_model == bare_metal_server_profile_model2 + assert cluster_network_interface_collection_model == cluster_network_interface_collection_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_model_json2 = bare_metal_server_profile_model.to_dict() - assert bare_metal_server_profile_model_json2 == bare_metal_server_profile_model_json + cluster_network_interface_collection_model_json2 = cluster_network_interface_collection_model.to_dict() + assert cluster_network_interface_collection_model_json2 == cluster_network_interface_collection_model_json -class TestModel_BareMetalServerProfileCPUArchitecture: +class TestModel_ClusterNetworkInterfaceLifecycleReason: """ - Test Class for BareMetalServerProfileCPUArchitecture + Test Class for ClusterNetworkInterfaceLifecycleReason """ - def test_bare_metal_server_profile_cpu_architecture_serialization(self): + def test_cluster_network_interface_lifecycle_reason_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileCPUArchitecture + Test serialization/deserialization for ClusterNetworkInterfaceLifecycleReason """ - # Construct a json representation of a BareMetalServerProfileCPUArchitecture model - bare_metal_server_profile_cpu_architecture_model_json = {} - bare_metal_server_profile_cpu_architecture_model_json['default'] = 'amd64' - bare_metal_server_profile_cpu_architecture_model_json['type'] = 'fixed' - bare_metal_server_profile_cpu_architecture_model_json['value'] = 'amd64' + # Construct a json representation of a ClusterNetworkInterfaceLifecycleReason model + cluster_network_interface_lifecycle_reason_model_json = {} + cluster_network_interface_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider' + cluster_network_interface_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_interface_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a model instance of BareMetalServerProfileCPUArchitecture by calling from_dict on the json representation - bare_metal_server_profile_cpu_architecture_model = BareMetalServerProfileCPUArchitecture.from_dict(bare_metal_server_profile_cpu_architecture_model_json) - assert bare_metal_server_profile_cpu_architecture_model != False + # Construct a model instance of ClusterNetworkInterfaceLifecycleReason by calling from_dict on the json representation + cluster_network_interface_lifecycle_reason_model = ClusterNetworkInterfaceLifecycleReason.from_dict(cluster_network_interface_lifecycle_reason_model_json) + assert cluster_network_interface_lifecycle_reason_model != False - # Construct a model instance of BareMetalServerProfileCPUArchitecture by calling from_dict on the json representation - bare_metal_server_profile_cpu_architecture_model_dict = BareMetalServerProfileCPUArchitecture.from_dict(bare_metal_server_profile_cpu_architecture_model_json).__dict__ - bare_metal_server_profile_cpu_architecture_model2 = BareMetalServerProfileCPUArchitecture(**bare_metal_server_profile_cpu_architecture_model_dict) + # Construct a model instance of ClusterNetworkInterfaceLifecycleReason by calling from_dict on the json representation + cluster_network_interface_lifecycle_reason_model_dict = ClusterNetworkInterfaceLifecycleReason.from_dict(cluster_network_interface_lifecycle_reason_model_json).__dict__ + cluster_network_interface_lifecycle_reason_model2 = ClusterNetworkInterfaceLifecycleReason(**cluster_network_interface_lifecycle_reason_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_cpu_architecture_model == bare_metal_server_profile_cpu_architecture_model2 + assert cluster_network_interface_lifecycle_reason_model == cluster_network_interface_lifecycle_reason_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_cpu_architecture_model_json2 = bare_metal_server_profile_cpu_architecture_model.to_dict() - assert bare_metal_server_profile_cpu_architecture_model_json2 == bare_metal_server_profile_cpu_architecture_model_json + cluster_network_interface_lifecycle_reason_model_json2 = cluster_network_interface_lifecycle_reason_model.to_dict() + assert cluster_network_interface_lifecycle_reason_model_json2 == cluster_network_interface_lifecycle_reason_model_json -class TestModel_BareMetalServerProfileCollection: +class TestModel_ClusterNetworkInterfacePatch: """ - Test Class for BareMetalServerProfileCollection + Test Class for ClusterNetworkInterfacePatch """ - def test_bare_metal_server_profile_collection_serialization(self): + def test_cluster_network_interface_patch_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileCollection + Test serialization/deserialization for ClusterNetworkInterfacePatch """ - # Construct dict forms of any model objects needed in order to build this model. - - bare_metal_server_profile_collection_first_model = {} # BareMetalServerProfileCollectionFirst - bare_metal_server_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20' - - bare_metal_server_profile_collection_next_model = {} # BareMetalServerProfileCollectionNext - bare_metal_server_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - bare_metal_server_profile_bandwidth_model = {} # BareMetalServerProfileBandwidthFixed - bare_metal_server_profile_bandwidth_model['type'] = 'fixed' - bare_metal_server_profile_bandwidth_model['value'] = 20000 - - bare_metal_server_profile_console_types_model = {} # BareMetalServerProfileConsoleTypes - bare_metal_server_profile_console_types_model['type'] = 'enum' - bare_metal_server_profile_console_types_model['values'] = ['serial'] - - bare_metal_server_profile_cpu_architecture_model = {} # BareMetalServerProfileCPUArchitecture - bare_metal_server_profile_cpu_architecture_model['default'] = 'amd64' - bare_metal_server_profile_cpu_architecture_model['type'] = 'fixed' - bare_metal_server_profile_cpu_architecture_model['value'] = 'amd64' - - bare_metal_server_profile_cpu_core_count_model = {} # BareMetalServerProfileCPUCoreCountFixed - bare_metal_server_profile_cpu_core_count_model['type'] = 'fixed' - bare_metal_server_profile_cpu_core_count_model['value'] = 80 - - bare_metal_server_profile_cpu_socket_count_model = {} # BareMetalServerProfileCPUSocketCountFixed - bare_metal_server_profile_cpu_socket_count_model['type'] = 'fixed' - bare_metal_server_profile_cpu_socket_count_model['value'] = 4 + # Construct a json representation of a ClusterNetworkInterfacePatch model + cluster_network_interface_patch_model_json = {} + cluster_network_interface_patch_model_json['auto_delete'] = False + cluster_network_interface_patch_model_json['name'] = 'my-cluster-network-interface' - bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed - bare_metal_server_profile_disk_quantity_model['type'] = 'fixed' - bare_metal_server_profile_disk_quantity_model['value'] = 4 + # Construct a model instance of ClusterNetworkInterfacePatch by calling from_dict on the json representation + cluster_network_interface_patch_model = ClusterNetworkInterfacePatch.from_dict(cluster_network_interface_patch_model_json) + assert cluster_network_interface_patch_model != False - bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed - bare_metal_server_profile_disk_size_model['type'] = 'fixed' - bare_metal_server_profile_disk_size_model['value'] = 100 + # Construct a model instance of ClusterNetworkInterfacePatch by calling from_dict on the json representation + cluster_network_interface_patch_model_dict = ClusterNetworkInterfacePatch.from_dict(cluster_network_interface_patch_model_json).__dict__ + cluster_network_interface_patch_model2 = ClusterNetworkInterfacePatch(**cluster_network_interface_patch_model_dict) - bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces - bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp' - bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' - bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp'] + # Verify the model instances are equivalent + assert cluster_network_interface_patch_model == cluster_network_interface_patch_model2 - bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk - bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model - bare_metal_server_profile_disk_model['size'] = bare_metal_server_profile_disk_size_model - bare_metal_server_profile_disk_model['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model + # Convert model instance back to dict and verify no loss of data + cluster_network_interface_patch_model_json2 = cluster_network_interface_patch_model.to_dict() + assert cluster_network_interface_patch_model_json2 == cluster_network_interface_patch_model_json - bare_metal_server_profile_memory_model = {} # BareMetalServerProfileMemoryFixed - bare_metal_server_profile_memory_model['type'] = 'fixed' - bare_metal_server_profile_memory_model['value'] = 16 - bare_metal_server_profile_network_attachment_count_model = {} # BareMetalServerProfileNetworkAttachmentCountRange - bare_metal_server_profile_network_attachment_count_model['max'] = 128 - bare_metal_server_profile_network_attachment_count_model['min'] = 1 - bare_metal_server_profile_network_attachment_count_model['type'] = 'range' +class TestModel_ClusterNetworkInterfaceReference: + """ + Test Class for ClusterNetworkInterfaceReference + """ - bare_metal_server_profile_network_interface_count_model = {} # BareMetalServerProfileNetworkInterfaceCountRange - bare_metal_server_profile_network_interface_count_model['max'] = 128 - bare_metal_server_profile_network_interface_count_model['min'] = 1 - bare_metal_server_profile_network_interface_count_model['type'] = 'range' + def test_cluster_network_interface_reference_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkInterfaceReference + """ - bare_metal_server_profile_os_architecture_model = {} # BareMetalServerProfileOSArchitecture - bare_metal_server_profile_os_architecture_model['default'] = 'amd64' - bare_metal_server_profile_os_architecture_model['type'] = 'enum' - bare_metal_server_profile_os_architecture_model['values'] = ['amd64'] + # Construct dict forms of any model objects needed in order to build this model. - bare_metal_server_profile_supported_trusted_platform_module_modes_model = {} # BareMetalServerProfileSupportedTrustedPlatformModuleModes - bare_metal_server_profile_supported_trusted_platform_module_modes_model['default'] = 'disabled' - bare_metal_server_profile_supported_trusted_platform_module_modes_model['type'] = 'enum' - bare_metal_server_profile_supported_trusted_platform_module_modes_model['values'] = ['disabled'] + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - bare_metal_server_profile_virtual_network_interfaces_supported_model = {} # BareMetalServerProfileVirtualNetworkInterfacesSupported - bare_metal_server_profile_virtual_network_interfaces_supported_model['type'] = 'fixed' - bare_metal_server_profile_virtual_network_interfaces_supported_model['value'] = True + cluster_network_subnet_reserved_ip_reference_model = {} # ClusterNetworkSubnetReservedIPReference + cluster_network_subnet_reserved_ip_reference_model['address'] = '10.1.0.6' + cluster_network_subnet_reserved_ip_reference_model['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['id'] = '63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['name'] = 'my-cluster-network-subnet-reserved-ip' + cluster_network_subnet_reserved_ip_reference_model['resource_type'] = 'cluster_network_subnet_reserved_ip' - bare_metal_server_profile_model = {} # BareMetalServerProfile - bare_metal_server_profile_model['bandwidth'] = bare_metal_server_profile_bandwidth_model - bare_metal_server_profile_model['console_types'] = bare_metal_server_profile_console_types_model - bare_metal_server_profile_model['cpu_architecture'] = bare_metal_server_profile_cpu_architecture_model - bare_metal_server_profile_model['cpu_core_count'] = bare_metal_server_profile_cpu_core_count_model - bare_metal_server_profile_model['cpu_socket_count'] = bare_metal_server_profile_cpu_socket_count_model - bare_metal_server_profile_model['disks'] = [bare_metal_server_profile_disk_model] - bare_metal_server_profile_model['family'] = 'balanced' - bare_metal_server_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768' - bare_metal_server_profile_model['memory'] = bare_metal_server_profile_memory_model - bare_metal_server_profile_model['name'] = 'bx2-metal-192x768' - bare_metal_server_profile_model['network_attachment_count'] = bare_metal_server_profile_network_attachment_count_model - bare_metal_server_profile_model['network_interface_count'] = bare_metal_server_profile_network_interface_count_model - bare_metal_server_profile_model['os_architecture'] = bare_metal_server_profile_os_architecture_model - bare_metal_server_profile_model['resource_type'] = 'bare_metal_server_profile' - bare_metal_server_profile_model['supported_trusted_platform_module_modes'] = bare_metal_server_profile_supported_trusted_platform_module_modes_model - bare_metal_server_profile_model['virtual_network_interfaces_supported'] = bare_metal_server_profile_virtual_network_interfaces_supported_model + cluster_network_subnet_reference_model = {} # ClusterNetworkSubnetReference + cluster_network_subnet_reference_model['deleted'] = deleted_model + cluster_network_subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_reference_model['resource_type'] = 'cluster_network_subnet' - # Construct a json representation of a BareMetalServerProfileCollection model - bare_metal_server_profile_collection_model_json = {} - bare_metal_server_profile_collection_model_json['first'] = bare_metal_server_profile_collection_first_model - bare_metal_server_profile_collection_model_json['limit'] = 20 - bare_metal_server_profile_collection_model_json['next'] = bare_metal_server_profile_collection_next_model - bare_metal_server_profile_collection_model_json['profiles'] = [bare_metal_server_profile_model] - bare_metal_server_profile_collection_model_json['total_count'] = 132 + # Construct a json representation of a ClusterNetworkInterfaceReference model + cluster_network_interface_reference_model_json = {} + cluster_network_interface_reference_model_json['deleted'] = deleted_model + cluster_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_reference_model_json['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_reference_model_json['name'] = 'my-cluster-network-interface' + cluster_network_interface_reference_model_json['primary_ip'] = cluster_network_subnet_reserved_ip_reference_model + cluster_network_interface_reference_model_json['resource_type'] = 'cluster_network_interface' + cluster_network_interface_reference_model_json['subnet'] = cluster_network_subnet_reference_model - # Construct a model instance of BareMetalServerProfileCollection by calling from_dict on the json representation - bare_metal_server_profile_collection_model = BareMetalServerProfileCollection.from_dict(bare_metal_server_profile_collection_model_json) - assert bare_metal_server_profile_collection_model != False + # Construct a model instance of ClusterNetworkInterfaceReference by calling from_dict on the json representation + cluster_network_interface_reference_model = ClusterNetworkInterfaceReference.from_dict(cluster_network_interface_reference_model_json) + assert cluster_network_interface_reference_model != False - # Construct a model instance of BareMetalServerProfileCollection by calling from_dict on the json representation - bare_metal_server_profile_collection_model_dict = BareMetalServerProfileCollection.from_dict(bare_metal_server_profile_collection_model_json).__dict__ - bare_metal_server_profile_collection_model2 = BareMetalServerProfileCollection(**bare_metal_server_profile_collection_model_dict) + # Construct a model instance of ClusterNetworkInterfaceReference by calling from_dict on the json representation + cluster_network_interface_reference_model_dict = ClusterNetworkInterfaceReference.from_dict(cluster_network_interface_reference_model_json).__dict__ + cluster_network_interface_reference_model2 = ClusterNetworkInterfaceReference(**cluster_network_interface_reference_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_collection_model == bare_metal_server_profile_collection_model2 + assert cluster_network_interface_reference_model == cluster_network_interface_reference_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_collection_model_json2 = bare_metal_server_profile_collection_model.to_dict() - assert bare_metal_server_profile_collection_model_json2 == bare_metal_server_profile_collection_model_json + cluster_network_interface_reference_model_json2 = cluster_network_interface_reference_model.to_dict() + assert cluster_network_interface_reference_model_json2 == cluster_network_interface_reference_model_json -class TestModel_BareMetalServerProfileCollectionFirst: +class TestModel_ClusterNetworkLifecycleReason: """ - Test Class for BareMetalServerProfileCollectionFirst + Test Class for ClusterNetworkLifecycleReason """ - def test_bare_metal_server_profile_collection_first_serialization(self): + def test_cluster_network_lifecycle_reason_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileCollectionFirst + Test serialization/deserialization for ClusterNetworkLifecycleReason """ - # Construct a json representation of a BareMetalServerProfileCollectionFirst model - bare_metal_server_profile_collection_first_model_json = {} - bare_metal_server_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20' + # Construct a json representation of a ClusterNetworkLifecycleReason model + cluster_network_lifecycle_reason_model_json = {} + cluster_network_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider' + cluster_network_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a model instance of BareMetalServerProfileCollectionFirst by calling from_dict on the json representation - bare_metal_server_profile_collection_first_model = BareMetalServerProfileCollectionFirst.from_dict(bare_metal_server_profile_collection_first_model_json) - assert bare_metal_server_profile_collection_first_model != False + # Construct a model instance of ClusterNetworkLifecycleReason by calling from_dict on the json representation + cluster_network_lifecycle_reason_model = ClusterNetworkLifecycleReason.from_dict(cluster_network_lifecycle_reason_model_json) + assert cluster_network_lifecycle_reason_model != False - # Construct a model instance of BareMetalServerProfileCollectionFirst by calling from_dict on the json representation - bare_metal_server_profile_collection_first_model_dict = BareMetalServerProfileCollectionFirst.from_dict(bare_metal_server_profile_collection_first_model_json).__dict__ - bare_metal_server_profile_collection_first_model2 = BareMetalServerProfileCollectionFirst(**bare_metal_server_profile_collection_first_model_dict) + # Construct a model instance of ClusterNetworkLifecycleReason by calling from_dict on the json representation + cluster_network_lifecycle_reason_model_dict = ClusterNetworkLifecycleReason.from_dict(cluster_network_lifecycle_reason_model_json).__dict__ + cluster_network_lifecycle_reason_model2 = ClusterNetworkLifecycleReason(**cluster_network_lifecycle_reason_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_collection_first_model == bare_metal_server_profile_collection_first_model2 + assert cluster_network_lifecycle_reason_model == cluster_network_lifecycle_reason_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_collection_first_model_json2 = bare_metal_server_profile_collection_first_model.to_dict() - assert bare_metal_server_profile_collection_first_model_json2 == bare_metal_server_profile_collection_first_model_json + cluster_network_lifecycle_reason_model_json2 = cluster_network_lifecycle_reason_model.to_dict() + assert cluster_network_lifecycle_reason_model_json2 == cluster_network_lifecycle_reason_model_json -class TestModel_BareMetalServerProfileCollectionNext: +class TestModel_ClusterNetworkPatch: """ - Test Class for BareMetalServerProfileCollectionNext + Test Class for ClusterNetworkPatch """ - def test_bare_metal_server_profile_collection_next_serialization(self): + def test_cluster_network_patch_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileCollectionNext + Test serialization/deserialization for ClusterNetworkPatch """ - # Construct a json representation of a BareMetalServerProfileCollectionNext model - bare_metal_server_profile_collection_next_model_json = {} - bare_metal_server_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + # Construct a json representation of a ClusterNetworkPatch model + cluster_network_patch_model_json = {} + cluster_network_patch_model_json['name'] = 'my-cluster-network' - # Construct a model instance of BareMetalServerProfileCollectionNext by calling from_dict on the json representation - bare_metal_server_profile_collection_next_model = BareMetalServerProfileCollectionNext.from_dict(bare_metal_server_profile_collection_next_model_json) - assert bare_metal_server_profile_collection_next_model != False + # Construct a model instance of ClusterNetworkPatch by calling from_dict on the json representation + cluster_network_patch_model = ClusterNetworkPatch.from_dict(cluster_network_patch_model_json) + assert cluster_network_patch_model != False - # Construct a model instance of BareMetalServerProfileCollectionNext by calling from_dict on the json representation - bare_metal_server_profile_collection_next_model_dict = BareMetalServerProfileCollectionNext.from_dict(bare_metal_server_profile_collection_next_model_json).__dict__ - bare_metal_server_profile_collection_next_model2 = BareMetalServerProfileCollectionNext(**bare_metal_server_profile_collection_next_model_dict) + # Construct a model instance of ClusterNetworkPatch by calling from_dict on the json representation + cluster_network_patch_model_dict = ClusterNetworkPatch.from_dict(cluster_network_patch_model_json).__dict__ + cluster_network_patch_model2 = ClusterNetworkPatch(**cluster_network_patch_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_collection_next_model == bare_metal_server_profile_collection_next_model2 + assert cluster_network_patch_model == cluster_network_patch_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_collection_next_model_json2 = bare_metal_server_profile_collection_next_model.to_dict() - assert bare_metal_server_profile_collection_next_model_json2 == bare_metal_server_profile_collection_next_model_json + cluster_network_patch_model_json2 = cluster_network_patch_model.to_dict() + assert cluster_network_patch_model_json2 == cluster_network_patch_model_json -class TestModel_BareMetalServerProfileConsoleTypes: +class TestModel_ClusterNetworkProfile: """ - Test Class for BareMetalServerProfileConsoleTypes + Test Class for ClusterNetworkProfile """ - def test_bare_metal_server_profile_console_types_serialization(self): + def test_cluster_network_profile_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileConsoleTypes + Test serialization/deserialization for ClusterNetworkProfile """ - # Construct a json representation of a BareMetalServerProfileConsoleTypes model - bare_metal_server_profile_console_types_model_json = {} - bare_metal_server_profile_console_types_model_json['type'] = 'enum' - bare_metal_server_profile_console_types_model_json['values'] = ['serial'] + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BareMetalServerProfileConsoleTypes by calling from_dict on the json representation - bare_metal_server_profile_console_types_model = BareMetalServerProfileConsoleTypes.from_dict(bare_metal_server_profile_console_types_model_json) - assert bare_metal_server_profile_console_types_model != False + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/tx3-160x1536-8h100' + instance_profile_reference_model['name'] = 'tx3-160x1536-8h100' + instance_profile_reference_model['resource_type'] = 'instance_profile' - # Construct a model instance of BareMetalServerProfileConsoleTypes by calling from_dict on the json representation - bare_metal_server_profile_console_types_model_dict = BareMetalServerProfileConsoleTypes.from_dict(bare_metal_server_profile_console_types_model_json).__dict__ - bare_metal_server_profile_console_types_model2 = BareMetalServerProfileConsoleTypes(**bare_metal_server_profile_console_types_model_dict) + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a ClusterNetworkProfile model + cluster_network_profile_model_json = {} + cluster_network_profile_model_json['family'] = 'vela' + cluster_network_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100' + cluster_network_profile_model_json['name'] = 'h100' + cluster_network_profile_model_json['resource_type'] = 'cluster_network_profile' + cluster_network_profile_model_json['supported_instance_profiles'] = [instance_profile_reference_model] + cluster_network_profile_model_json['zones'] = [zone_reference_model] + + # Construct a model instance of ClusterNetworkProfile by calling from_dict on the json representation + cluster_network_profile_model = ClusterNetworkProfile.from_dict(cluster_network_profile_model_json) + assert cluster_network_profile_model != False + + # Construct a model instance of ClusterNetworkProfile by calling from_dict on the json representation + cluster_network_profile_model_dict = ClusterNetworkProfile.from_dict(cluster_network_profile_model_json).__dict__ + cluster_network_profile_model2 = ClusterNetworkProfile(**cluster_network_profile_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_console_types_model == bare_metal_server_profile_console_types_model2 + assert cluster_network_profile_model == cluster_network_profile_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_console_types_model_json2 = bare_metal_server_profile_console_types_model.to_dict() - assert bare_metal_server_profile_console_types_model_json2 == bare_metal_server_profile_console_types_model_json + cluster_network_profile_model_json2 = cluster_network_profile_model.to_dict() + assert cluster_network_profile_model_json2 == cluster_network_profile_model_json -class TestModel_BareMetalServerProfileDisk: +class TestModel_ClusterNetworkProfileCollection: """ - Test Class for BareMetalServerProfileDisk + Test Class for ClusterNetworkProfileCollection """ - def test_bare_metal_server_profile_disk_serialization(self): + def test_cluster_network_profile_collection_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileDisk + Test serialization/deserialization for ClusterNetworkProfileCollection """ # Construct dict forms of any model objects needed in order to build this model. - bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed - bare_metal_server_profile_disk_quantity_model['type'] = 'fixed' - bare_metal_server_profile_disk_quantity_model['value'] = 4 + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles?limit=50' - bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed - bare_metal_server_profile_disk_size_model['type'] = 'fixed' - bare_metal_server_profile_disk_size_model['value'] = 100 + instance_profile_reference_model = {} # InstanceProfileReference + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/tx3-160x1536-8h100' + instance_profile_reference_model['name'] = 'tx3-160x1536-8h100' + instance_profile_reference_model['resource_type'] = 'instance_profile' - bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces - bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp' - bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' - bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp'] + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' - # Construct a json representation of a BareMetalServerProfileDisk model - bare_metal_server_profile_disk_model_json = {} - bare_metal_server_profile_disk_model_json['quantity'] = bare_metal_server_profile_disk_quantity_model - bare_metal_server_profile_disk_model_json['size'] = bare_metal_server_profile_disk_size_model - bare_metal_server_profile_disk_model_json['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model + cluster_network_profile_model = {} # ClusterNetworkProfile + cluster_network_profile_model['family'] = 'vela' + cluster_network_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100' + cluster_network_profile_model['name'] = 'h100' + cluster_network_profile_model['resource_type'] = 'cluster_network_profile' + cluster_network_profile_model['supported_instance_profiles'] = [instance_profile_reference_model] + cluster_network_profile_model['zones'] = [zone_reference_model] - # Construct a model instance of BareMetalServerProfileDisk by calling from_dict on the json representation - bare_metal_server_profile_disk_model = BareMetalServerProfileDisk.from_dict(bare_metal_server_profile_disk_model_json) - assert bare_metal_server_profile_disk_model != False + # Construct a json representation of a ClusterNetworkProfileCollection model + cluster_network_profile_collection_model_json = {} + cluster_network_profile_collection_model_json['first'] = page_link_model + cluster_network_profile_collection_model_json['limit'] = 20 + cluster_network_profile_collection_model_json['next'] = page_link_model + cluster_network_profile_collection_model_json['profiles'] = [cluster_network_profile_model] + cluster_network_profile_collection_model_json['total_count'] = 132 - # Construct a model instance of BareMetalServerProfileDisk by calling from_dict on the json representation - bare_metal_server_profile_disk_model_dict = BareMetalServerProfileDisk.from_dict(bare_metal_server_profile_disk_model_json).__dict__ - bare_metal_server_profile_disk_model2 = BareMetalServerProfileDisk(**bare_metal_server_profile_disk_model_dict) + # Construct a model instance of ClusterNetworkProfileCollection by calling from_dict on the json representation + cluster_network_profile_collection_model = ClusterNetworkProfileCollection.from_dict(cluster_network_profile_collection_model_json) + assert cluster_network_profile_collection_model != False + + # Construct a model instance of ClusterNetworkProfileCollection by calling from_dict on the json representation + cluster_network_profile_collection_model_dict = ClusterNetworkProfileCollection.from_dict(cluster_network_profile_collection_model_json).__dict__ + cluster_network_profile_collection_model2 = ClusterNetworkProfileCollection(**cluster_network_profile_collection_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_disk_model == bare_metal_server_profile_disk_model2 + assert cluster_network_profile_collection_model == cluster_network_profile_collection_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_disk_model_json2 = bare_metal_server_profile_disk_model.to_dict() - assert bare_metal_server_profile_disk_model_json2 == bare_metal_server_profile_disk_model_json + cluster_network_profile_collection_model_json2 = cluster_network_profile_collection_model.to_dict() + assert cluster_network_profile_collection_model_json2 == cluster_network_profile_collection_model_json -class TestModel_BareMetalServerProfileDiskSupportedInterfaces: +class TestModel_ClusterNetworkProfileReference: """ - Test Class for BareMetalServerProfileDiskSupportedInterfaces + Test Class for ClusterNetworkProfileReference """ - def test_bare_metal_server_profile_disk_supported_interfaces_serialization(self): + def test_cluster_network_profile_reference_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileDiskSupportedInterfaces + Test serialization/deserialization for ClusterNetworkProfileReference """ - # Construct a json representation of a BareMetalServerProfileDiskSupportedInterfaces model - bare_metal_server_profile_disk_supported_interfaces_model_json = {} - bare_metal_server_profile_disk_supported_interfaces_model_json['default'] = 'fcp' - bare_metal_server_profile_disk_supported_interfaces_model_json['type'] = 'enum' - bare_metal_server_profile_disk_supported_interfaces_model_json['values'] = ['fcp'] + # Construct a json representation of a ClusterNetworkProfileReference model + cluster_network_profile_reference_model_json = {} + cluster_network_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100' + cluster_network_profile_reference_model_json['name'] = 'h100' + cluster_network_profile_reference_model_json['resource_type'] = 'cluster_network_profile' - # Construct a model instance of BareMetalServerProfileDiskSupportedInterfaces by calling from_dict on the json representation - bare_metal_server_profile_disk_supported_interfaces_model = BareMetalServerProfileDiskSupportedInterfaces.from_dict(bare_metal_server_profile_disk_supported_interfaces_model_json) - assert bare_metal_server_profile_disk_supported_interfaces_model != False + # Construct a model instance of ClusterNetworkProfileReference by calling from_dict on the json representation + cluster_network_profile_reference_model = ClusterNetworkProfileReference.from_dict(cluster_network_profile_reference_model_json) + assert cluster_network_profile_reference_model != False - # Construct a model instance of BareMetalServerProfileDiskSupportedInterfaces by calling from_dict on the json representation - bare_metal_server_profile_disk_supported_interfaces_model_dict = BareMetalServerProfileDiskSupportedInterfaces.from_dict(bare_metal_server_profile_disk_supported_interfaces_model_json).__dict__ - bare_metal_server_profile_disk_supported_interfaces_model2 = BareMetalServerProfileDiskSupportedInterfaces(**bare_metal_server_profile_disk_supported_interfaces_model_dict) + # Construct a model instance of ClusterNetworkProfileReference by calling from_dict on the json representation + cluster_network_profile_reference_model_dict = ClusterNetworkProfileReference.from_dict(cluster_network_profile_reference_model_json).__dict__ + cluster_network_profile_reference_model2 = ClusterNetworkProfileReference(**cluster_network_profile_reference_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_disk_supported_interfaces_model == bare_metal_server_profile_disk_supported_interfaces_model2 + assert cluster_network_profile_reference_model == cluster_network_profile_reference_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_disk_supported_interfaces_model_json2 = bare_metal_server_profile_disk_supported_interfaces_model.to_dict() - assert bare_metal_server_profile_disk_supported_interfaces_model_json2 == bare_metal_server_profile_disk_supported_interfaces_model_json + cluster_network_profile_reference_model_json2 = cluster_network_profile_reference_model.to_dict() + assert cluster_network_profile_reference_model_json2 == cluster_network_profile_reference_model_json -class TestModel_BareMetalServerProfileOSArchitecture: +class TestModel_ClusterNetworkReference: """ - Test Class for BareMetalServerProfileOSArchitecture + Test Class for ClusterNetworkReference """ - def test_bare_metal_server_profile_os_architecture_serialization(self): + def test_cluster_network_reference_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileOSArchitecture + Test serialization/deserialization for ClusterNetworkReference """ - # Construct a json representation of a BareMetalServerProfileOSArchitecture model - bare_metal_server_profile_os_architecture_model_json = {} - bare_metal_server_profile_os_architecture_model_json['default'] = 'amd64' - bare_metal_server_profile_os_architecture_model_json['type'] = 'enum' - bare_metal_server_profile_os_architecture_model_json['values'] = ['amd64'] + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BareMetalServerProfileOSArchitecture by calling from_dict on the json representation - bare_metal_server_profile_os_architecture_model = BareMetalServerProfileOSArchitecture.from_dict(bare_metal_server_profile_os_architecture_model_json) - assert bare_metal_server_profile_os_architecture_model != False + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a model instance of BareMetalServerProfileOSArchitecture by calling from_dict on the json representation - bare_metal_server_profile_os_architecture_model_dict = BareMetalServerProfileOSArchitecture.from_dict(bare_metal_server_profile_os_architecture_model_json).__dict__ - bare_metal_server_profile_os_architecture_model2 = BareMetalServerProfileOSArchitecture(**bare_metal_server_profile_os_architecture_model_dict) + # Construct a json representation of a ClusterNetworkReference model + cluster_network_reference_model_json = {} + cluster_network_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model_json['deleted'] = deleted_model + cluster_network_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model_json['id'] = '0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model_json['name'] = 'my-cluster-network' + cluster_network_reference_model_json['resource_type'] = 'cluster_network' + + # Construct a model instance of ClusterNetworkReference by calling from_dict on the json representation + cluster_network_reference_model = ClusterNetworkReference.from_dict(cluster_network_reference_model_json) + assert cluster_network_reference_model != False + + # Construct a model instance of ClusterNetworkReference by calling from_dict on the json representation + cluster_network_reference_model_dict = ClusterNetworkReference.from_dict(cluster_network_reference_model_json).__dict__ + cluster_network_reference_model2 = ClusterNetworkReference(**cluster_network_reference_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_os_architecture_model == bare_metal_server_profile_os_architecture_model2 + assert cluster_network_reference_model == cluster_network_reference_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_os_architecture_model_json2 = bare_metal_server_profile_os_architecture_model.to_dict() - assert bare_metal_server_profile_os_architecture_model_json2 == bare_metal_server_profile_os_architecture_model_json + cluster_network_reference_model_json2 = cluster_network_reference_model.to_dict() + assert cluster_network_reference_model_json2 == cluster_network_reference_model_json -class TestModel_BareMetalServerProfileReference: +class TestModel_ClusterNetworkSubnet: """ - Test Class for BareMetalServerProfileReference + Test Class for ClusterNetworkSubnet """ - def test_bare_metal_server_profile_reference_serialization(self): + def test_cluster_network_subnet_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileReference + Test serialization/deserialization for ClusterNetworkSubnet """ - # Construct a json representation of a BareMetalServerProfileReference model - bare_metal_server_profile_reference_model_json = {} - bare_metal_server_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768' - bare_metal_server_profile_reference_model_json['name'] = 'bx2-metal-192x768' - bare_metal_server_profile_reference_model_json['resource_type'] = 'bare_metal_server_profile' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BareMetalServerProfileReference by calling from_dict on the json representation - bare_metal_server_profile_reference_model = BareMetalServerProfileReference.from_dict(bare_metal_server_profile_reference_model_json) - assert bare_metal_server_profile_reference_model != False + cluster_network_subnet_lifecycle_reason_model = {} # ClusterNetworkSubnetLifecycleReason + cluster_network_subnet_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + cluster_network_subnet_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_subnet_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a model instance of BareMetalServerProfileReference by calling from_dict on the json representation - bare_metal_server_profile_reference_model_dict = BareMetalServerProfileReference.from_dict(bare_metal_server_profile_reference_model_json).__dict__ - bare_metal_server_profile_reference_model2 = BareMetalServerProfileReference(**bare_metal_server_profile_reference_model_dict) + # Construct a json representation of a ClusterNetworkSubnet model + cluster_network_subnet_model_json = {} + cluster_network_subnet_model_json['available_ipv4_address_count'] = 15 + cluster_network_subnet_model_json['created_at'] = '2019-01-01T12:00:00Z' + cluster_network_subnet_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_model_json['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_model_json['ip_version'] = 'ipv4' + cluster_network_subnet_model_json['ipv4_cidr_block'] = '10.0.0.0/24' + cluster_network_subnet_model_json['lifecycle_reasons'] = [cluster_network_subnet_lifecycle_reason_model] + cluster_network_subnet_model_json['lifecycle_state'] = 'stable' + cluster_network_subnet_model_json['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_model_json['resource_type'] = 'cluster_network_subnet' + cluster_network_subnet_model_json['total_ipv4_address_count'] = 256 + + # Construct a model instance of ClusterNetworkSubnet by calling from_dict on the json representation + cluster_network_subnet_model = ClusterNetworkSubnet.from_dict(cluster_network_subnet_model_json) + assert cluster_network_subnet_model != False + + # Construct a model instance of ClusterNetworkSubnet by calling from_dict on the json representation + cluster_network_subnet_model_dict = ClusterNetworkSubnet.from_dict(cluster_network_subnet_model_json).__dict__ + cluster_network_subnet_model2 = ClusterNetworkSubnet(**cluster_network_subnet_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_reference_model == bare_metal_server_profile_reference_model2 + assert cluster_network_subnet_model == cluster_network_subnet_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_reference_model_json2 = bare_metal_server_profile_reference_model.to_dict() - assert bare_metal_server_profile_reference_model_json2 == bare_metal_server_profile_reference_model_json + cluster_network_subnet_model_json2 = cluster_network_subnet_model.to_dict() + assert cluster_network_subnet_model_json2 == cluster_network_subnet_model_json -class TestModel_BareMetalServerProfileSupportedTrustedPlatformModuleModes: +class TestModel_ClusterNetworkSubnetCollection: """ - Test Class for BareMetalServerProfileSupportedTrustedPlatformModuleModes + Test Class for ClusterNetworkSubnetCollection """ - def test_bare_metal_server_profile_supported_trusted_platform_module_modes_serialization(self): + def test_cluster_network_subnet_collection_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileSupportedTrustedPlatformModuleModes + Test serialization/deserialization for ClusterNetworkSubnetCollection """ - # Construct a json representation of a BareMetalServerProfileSupportedTrustedPlatformModuleModes model - bare_metal_server_profile_supported_trusted_platform_module_modes_model_json = {} - bare_metal_server_profile_supported_trusted_platform_module_modes_model_json['default'] = 'disabled' - bare_metal_server_profile_supported_trusted_platform_module_modes_model_json['type'] = 'enum' - bare_metal_server_profile_supported_trusted_platform_module_modes_model_json['values'] = ['disabled'] + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes by calling from_dict on the json representation - bare_metal_server_profile_supported_trusted_platform_module_modes_model = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(bare_metal_server_profile_supported_trusted_platform_module_modes_model_json) - assert bare_metal_server_profile_supported_trusted_platform_module_modes_model != False + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets?limit=50' - # Construct a model instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes by calling from_dict on the json representation - bare_metal_server_profile_supported_trusted_platform_module_modes_model_dict = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(bare_metal_server_profile_supported_trusted_platform_module_modes_model_json).__dict__ - bare_metal_server_profile_supported_trusted_platform_module_modes_model2 = BareMetalServerProfileSupportedTrustedPlatformModuleModes(**bare_metal_server_profile_supported_trusted_platform_module_modes_model_dict) + cluster_network_subnet_lifecycle_reason_model = {} # ClusterNetworkSubnetLifecycleReason + cluster_network_subnet_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + cluster_network_subnet_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_subnet_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + + cluster_network_subnet_model = {} # ClusterNetworkSubnet + cluster_network_subnet_model['available_ipv4_address_count'] = 251 + cluster_network_subnet_model['created_at'] = '2024-10-25T11:59:46Z' + cluster_network_subnet_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_model['ip_version'] = 'ipv4' + cluster_network_subnet_model['ipv4_cidr_block'] = '10.0.1.0/24' + cluster_network_subnet_model['lifecycle_reasons'] = [cluster_network_subnet_lifecycle_reason_model] + cluster_network_subnet_model['lifecycle_state'] = 'pending' + cluster_network_subnet_model['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_model['resource_type'] = 'cluster_network_subnet' + cluster_network_subnet_model['total_ipv4_address_count'] = 256 + + # Construct a json representation of a ClusterNetworkSubnetCollection model + cluster_network_subnet_collection_model_json = {} + cluster_network_subnet_collection_model_json['first'] = page_link_model + cluster_network_subnet_collection_model_json['limit'] = 20 + cluster_network_subnet_collection_model_json['next'] = page_link_model + cluster_network_subnet_collection_model_json['subnets'] = [cluster_network_subnet_model] + cluster_network_subnet_collection_model_json['total_count'] = 132 + + # Construct a model instance of ClusterNetworkSubnetCollection by calling from_dict on the json representation + cluster_network_subnet_collection_model = ClusterNetworkSubnetCollection.from_dict(cluster_network_subnet_collection_model_json) + assert cluster_network_subnet_collection_model != False + + # Construct a model instance of ClusterNetworkSubnetCollection by calling from_dict on the json representation + cluster_network_subnet_collection_model_dict = ClusterNetworkSubnetCollection.from_dict(cluster_network_subnet_collection_model_json).__dict__ + cluster_network_subnet_collection_model2 = ClusterNetworkSubnetCollection(**cluster_network_subnet_collection_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_supported_trusted_platform_module_modes_model == bare_metal_server_profile_supported_trusted_platform_module_modes_model2 + assert cluster_network_subnet_collection_model == cluster_network_subnet_collection_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_supported_trusted_platform_module_modes_model_json2 = bare_metal_server_profile_supported_trusted_platform_module_modes_model.to_dict() - assert bare_metal_server_profile_supported_trusted_platform_module_modes_model_json2 == bare_metal_server_profile_supported_trusted_platform_module_modes_model_json + cluster_network_subnet_collection_model_json2 = cluster_network_subnet_collection_model.to_dict() + assert cluster_network_subnet_collection_model_json2 == cluster_network_subnet_collection_model_json -class TestModel_BareMetalServerProfileVirtualNetworkInterfacesSupported: +class TestModel_ClusterNetworkSubnetLifecycleReason: """ - Test Class for BareMetalServerProfileVirtualNetworkInterfacesSupported + Test Class for ClusterNetworkSubnetLifecycleReason """ - def test_bare_metal_server_profile_virtual_network_interfaces_supported_serialization(self): + def test_cluster_network_subnet_lifecycle_reason_serialization(self): """ - Test serialization/deserialization for BareMetalServerProfileVirtualNetworkInterfacesSupported + Test serialization/deserialization for ClusterNetworkSubnetLifecycleReason """ - # Construct a json representation of a BareMetalServerProfileVirtualNetworkInterfacesSupported model - bare_metal_server_profile_virtual_network_interfaces_supported_model_json = {} - bare_metal_server_profile_virtual_network_interfaces_supported_model_json['type'] = 'fixed' - bare_metal_server_profile_virtual_network_interfaces_supported_model_json['value'] = True + # Construct a json representation of a ClusterNetworkSubnetLifecycleReason model + cluster_network_subnet_lifecycle_reason_model_json = {} + cluster_network_subnet_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider' + cluster_network_subnet_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_subnet_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a model instance of BareMetalServerProfileVirtualNetworkInterfacesSupported by calling from_dict on the json representation - bare_metal_server_profile_virtual_network_interfaces_supported_model = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(bare_metal_server_profile_virtual_network_interfaces_supported_model_json) - assert bare_metal_server_profile_virtual_network_interfaces_supported_model != False + # Construct a model instance of ClusterNetworkSubnetLifecycleReason by calling from_dict on the json representation + cluster_network_subnet_lifecycle_reason_model = ClusterNetworkSubnetLifecycleReason.from_dict(cluster_network_subnet_lifecycle_reason_model_json) + assert cluster_network_subnet_lifecycle_reason_model != False - # Construct a model instance of BareMetalServerProfileVirtualNetworkInterfacesSupported by calling from_dict on the json representation - bare_metal_server_profile_virtual_network_interfaces_supported_model_dict = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(bare_metal_server_profile_virtual_network_interfaces_supported_model_json).__dict__ - bare_metal_server_profile_virtual_network_interfaces_supported_model2 = BareMetalServerProfileVirtualNetworkInterfacesSupported(**bare_metal_server_profile_virtual_network_interfaces_supported_model_dict) + # Construct a model instance of ClusterNetworkSubnetLifecycleReason by calling from_dict on the json representation + cluster_network_subnet_lifecycle_reason_model_dict = ClusterNetworkSubnetLifecycleReason.from_dict(cluster_network_subnet_lifecycle_reason_model_json).__dict__ + cluster_network_subnet_lifecycle_reason_model2 = ClusterNetworkSubnetLifecycleReason(**cluster_network_subnet_lifecycle_reason_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_profile_virtual_network_interfaces_supported_model == bare_metal_server_profile_virtual_network_interfaces_supported_model2 + assert cluster_network_subnet_lifecycle_reason_model == cluster_network_subnet_lifecycle_reason_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_profile_virtual_network_interfaces_supported_model_json2 = bare_metal_server_profile_virtual_network_interfaces_supported_model.to_dict() - assert bare_metal_server_profile_virtual_network_interfaces_supported_model_json2 == bare_metal_server_profile_virtual_network_interfaces_supported_model_json + cluster_network_subnet_lifecycle_reason_model_json2 = cluster_network_subnet_lifecycle_reason_model.to_dict() + assert cluster_network_subnet_lifecycle_reason_model_json2 == cluster_network_subnet_lifecycle_reason_model_json -class TestModel_BareMetalServerStatusReason: +class TestModel_ClusterNetworkSubnetPatch: """ - Test Class for BareMetalServerStatusReason + Test Class for ClusterNetworkSubnetPatch """ - def test_bare_metal_server_status_reason_serialization(self): + def test_cluster_network_subnet_patch_serialization(self): """ - Test serialization/deserialization for BareMetalServerStatusReason + Test serialization/deserialization for ClusterNetworkSubnetPatch """ - # Construct a json representation of a BareMetalServerStatusReason model - bare_metal_server_status_reason_model_json = {} - bare_metal_server_status_reason_model_json['code'] = 'cannot_start_capacity' - bare_metal_server_status_reason_model_json['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.' - bare_metal_server_status_reason_model_json['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html' + # Construct a json representation of a ClusterNetworkSubnetPatch model + cluster_network_subnet_patch_model_json = {} + cluster_network_subnet_patch_model_json['name'] = 'my-cluster-network-subnet' - # Construct a model instance of BareMetalServerStatusReason by calling from_dict on the json representation - bare_metal_server_status_reason_model = BareMetalServerStatusReason.from_dict(bare_metal_server_status_reason_model_json) - assert bare_metal_server_status_reason_model != False + # Construct a model instance of ClusterNetworkSubnetPatch by calling from_dict on the json representation + cluster_network_subnet_patch_model = ClusterNetworkSubnetPatch.from_dict(cluster_network_subnet_patch_model_json) + assert cluster_network_subnet_patch_model != False - # Construct a model instance of BareMetalServerStatusReason by calling from_dict on the json representation - bare_metal_server_status_reason_model_dict = BareMetalServerStatusReason.from_dict(bare_metal_server_status_reason_model_json).__dict__ - bare_metal_server_status_reason_model2 = BareMetalServerStatusReason(**bare_metal_server_status_reason_model_dict) + # Construct a model instance of ClusterNetworkSubnetPatch by calling from_dict on the json representation + cluster_network_subnet_patch_model_dict = ClusterNetworkSubnetPatch.from_dict(cluster_network_subnet_patch_model_json).__dict__ + cluster_network_subnet_patch_model2 = ClusterNetworkSubnetPatch(**cluster_network_subnet_patch_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_status_reason_model == bare_metal_server_status_reason_model2 + assert cluster_network_subnet_patch_model == cluster_network_subnet_patch_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_status_reason_model_json2 = bare_metal_server_status_reason_model.to_dict() - assert bare_metal_server_status_reason_model_json2 == bare_metal_server_status_reason_model_json + cluster_network_subnet_patch_model_json2 = cluster_network_subnet_patch_model.to_dict() + assert cluster_network_subnet_patch_model_json2 == cluster_network_subnet_patch_model_json -class TestModel_BareMetalServerTrustedPlatformModule: +class TestModel_ClusterNetworkSubnetPrefix: """ - Test Class for BareMetalServerTrustedPlatformModule + Test Class for ClusterNetworkSubnetPrefix """ - def test_bare_metal_server_trusted_platform_module_serialization(self): + def test_cluster_network_subnet_prefix_serialization(self): """ - Test serialization/deserialization for BareMetalServerTrustedPlatformModule + Test serialization/deserialization for ClusterNetworkSubnetPrefix """ - # Construct a json representation of a BareMetalServerTrustedPlatformModule model - bare_metal_server_trusted_platform_module_model_json = {} - bare_metal_server_trusted_platform_module_model_json['enabled'] = True - bare_metal_server_trusted_platform_module_model_json['mode'] = 'disabled' - bare_metal_server_trusted_platform_module_model_json['supported_modes'] = ['disabled'] + # Construct a json representation of a ClusterNetworkSubnetPrefix model + cluster_network_subnet_prefix_model_json = {} + cluster_network_subnet_prefix_model_json['allocation_policy'] = 'auto' + cluster_network_subnet_prefix_model_json['cidr'] = '10.0.0.0/24' - # Construct a model instance of BareMetalServerTrustedPlatformModule by calling from_dict on the json representation - bare_metal_server_trusted_platform_module_model = BareMetalServerTrustedPlatformModule.from_dict(bare_metal_server_trusted_platform_module_model_json) - assert bare_metal_server_trusted_platform_module_model != False + # Construct a model instance of ClusterNetworkSubnetPrefix by calling from_dict on the json representation + cluster_network_subnet_prefix_model = ClusterNetworkSubnetPrefix.from_dict(cluster_network_subnet_prefix_model_json) + assert cluster_network_subnet_prefix_model != False - # Construct a model instance of BareMetalServerTrustedPlatformModule by calling from_dict on the json representation - bare_metal_server_trusted_platform_module_model_dict = BareMetalServerTrustedPlatformModule.from_dict(bare_metal_server_trusted_platform_module_model_json).__dict__ - bare_metal_server_trusted_platform_module_model2 = BareMetalServerTrustedPlatformModule(**bare_metal_server_trusted_platform_module_model_dict) + # Construct a model instance of ClusterNetworkSubnetPrefix by calling from_dict on the json representation + cluster_network_subnet_prefix_model_dict = ClusterNetworkSubnetPrefix.from_dict(cluster_network_subnet_prefix_model_json).__dict__ + cluster_network_subnet_prefix_model2 = ClusterNetworkSubnetPrefix(**cluster_network_subnet_prefix_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_trusted_platform_module_model == bare_metal_server_trusted_platform_module_model2 + assert cluster_network_subnet_prefix_model == cluster_network_subnet_prefix_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_trusted_platform_module_model_json2 = bare_metal_server_trusted_platform_module_model.to_dict() - assert bare_metal_server_trusted_platform_module_model_json2 == bare_metal_server_trusted_platform_module_model_json + cluster_network_subnet_prefix_model_json2 = cluster_network_subnet_prefix_model.to_dict() + assert cluster_network_subnet_prefix_model_json2 == cluster_network_subnet_prefix_model_json -class TestModel_BareMetalServerTrustedPlatformModulePatch: +class TestModel_ClusterNetworkSubnetPrefixPrototype: """ - Test Class for BareMetalServerTrustedPlatformModulePatch + Test Class for ClusterNetworkSubnetPrefixPrototype """ - def test_bare_metal_server_trusted_platform_module_patch_serialization(self): + def test_cluster_network_subnet_prefix_prototype_serialization(self): """ - Test serialization/deserialization for BareMetalServerTrustedPlatformModulePatch + Test serialization/deserialization for ClusterNetworkSubnetPrefixPrototype """ - # Construct a json representation of a BareMetalServerTrustedPlatformModulePatch model - bare_metal_server_trusted_platform_module_patch_model_json = {} - bare_metal_server_trusted_platform_module_patch_model_json['mode'] = 'disabled' + # Construct a json representation of a ClusterNetworkSubnetPrefixPrototype model + cluster_network_subnet_prefix_prototype_model_json = {} + cluster_network_subnet_prefix_prototype_model_json['cidr'] = '10.0.0.0/24' - # Construct a model instance of BareMetalServerTrustedPlatformModulePatch by calling from_dict on the json representation - bare_metal_server_trusted_platform_module_patch_model = BareMetalServerTrustedPlatformModulePatch.from_dict(bare_metal_server_trusted_platform_module_patch_model_json) - assert bare_metal_server_trusted_platform_module_patch_model != False + # Construct a model instance of ClusterNetworkSubnetPrefixPrototype by calling from_dict on the json representation + cluster_network_subnet_prefix_prototype_model = ClusterNetworkSubnetPrefixPrototype.from_dict(cluster_network_subnet_prefix_prototype_model_json) + assert cluster_network_subnet_prefix_prototype_model != False - # Construct a model instance of BareMetalServerTrustedPlatformModulePatch by calling from_dict on the json representation - bare_metal_server_trusted_platform_module_patch_model_dict = BareMetalServerTrustedPlatformModulePatch.from_dict(bare_metal_server_trusted_platform_module_patch_model_json).__dict__ - bare_metal_server_trusted_platform_module_patch_model2 = BareMetalServerTrustedPlatformModulePatch(**bare_metal_server_trusted_platform_module_patch_model_dict) + # Construct a model instance of ClusterNetworkSubnetPrefixPrototype by calling from_dict on the json representation + cluster_network_subnet_prefix_prototype_model_dict = ClusterNetworkSubnetPrefixPrototype.from_dict(cluster_network_subnet_prefix_prototype_model_json).__dict__ + cluster_network_subnet_prefix_prototype_model2 = ClusterNetworkSubnetPrefixPrototype(**cluster_network_subnet_prefix_prototype_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_trusted_platform_module_patch_model == bare_metal_server_trusted_platform_module_patch_model2 + assert cluster_network_subnet_prefix_prototype_model == cluster_network_subnet_prefix_prototype_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_trusted_platform_module_patch_model_json2 = bare_metal_server_trusted_platform_module_patch_model.to_dict() - assert bare_metal_server_trusted_platform_module_patch_model_json2 == bare_metal_server_trusted_platform_module_patch_model_json + cluster_network_subnet_prefix_prototype_model_json2 = cluster_network_subnet_prefix_prototype_model.to_dict() + assert cluster_network_subnet_prefix_prototype_model_json2 == cluster_network_subnet_prefix_prototype_model_json -class TestModel_BareMetalServerTrustedPlatformModulePrototype: +class TestModel_ClusterNetworkSubnetReference: """ - Test Class for BareMetalServerTrustedPlatformModulePrototype + Test Class for ClusterNetworkSubnetReference """ - def test_bare_metal_server_trusted_platform_module_prototype_serialization(self): + def test_cluster_network_subnet_reference_serialization(self): """ - Test serialization/deserialization for BareMetalServerTrustedPlatformModulePrototype + Test serialization/deserialization for ClusterNetworkSubnetReference """ - # Construct a json representation of a BareMetalServerTrustedPlatformModulePrototype model - bare_metal_server_trusted_platform_module_prototype_model_json = {} - bare_metal_server_trusted_platform_module_prototype_model_json['mode'] = 'disabled' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of BareMetalServerTrustedPlatformModulePrototype by calling from_dict on the json representation - bare_metal_server_trusted_platform_module_prototype_model = BareMetalServerTrustedPlatformModulePrototype.from_dict(bare_metal_server_trusted_platform_module_prototype_model_json) - assert bare_metal_server_trusted_platform_module_prototype_model != False + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a model instance of BareMetalServerTrustedPlatformModulePrototype by calling from_dict on the json representation - bare_metal_server_trusted_platform_module_prototype_model_dict = BareMetalServerTrustedPlatformModulePrototype.from_dict(bare_metal_server_trusted_platform_module_prototype_model_json).__dict__ - bare_metal_server_trusted_platform_module_prototype_model2 = BareMetalServerTrustedPlatformModulePrototype(**bare_metal_server_trusted_platform_module_prototype_model_dict) + # Construct a json representation of a ClusterNetworkSubnetReference model + cluster_network_subnet_reference_model_json = {} + cluster_network_subnet_reference_model_json['deleted'] = deleted_model + cluster_network_subnet_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model_json['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model_json['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_reference_model_json['resource_type'] = 'cluster_network_subnet' + + # Construct a model instance of ClusterNetworkSubnetReference by calling from_dict on the json representation + cluster_network_subnet_reference_model = ClusterNetworkSubnetReference.from_dict(cluster_network_subnet_reference_model_json) + assert cluster_network_subnet_reference_model != False + + # Construct a model instance of ClusterNetworkSubnetReference by calling from_dict on the json representation + cluster_network_subnet_reference_model_dict = ClusterNetworkSubnetReference.from_dict(cluster_network_subnet_reference_model_json).__dict__ + cluster_network_subnet_reference_model2 = ClusterNetworkSubnetReference(**cluster_network_subnet_reference_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_trusted_platform_module_prototype_model == bare_metal_server_trusted_platform_module_prototype_model2 + assert cluster_network_subnet_reference_model == cluster_network_subnet_reference_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_trusted_platform_module_prototype_model_json2 = bare_metal_server_trusted_platform_module_prototype_model.to_dict() - assert bare_metal_server_trusted_platform_module_prototype_model_json2 == bare_metal_server_trusted_platform_module_prototype_model_json + cluster_network_subnet_reference_model_json2 = cluster_network_subnet_reference_model.to_dict() + assert cluster_network_subnet_reference_model_json2 == cluster_network_subnet_reference_model_json -class TestModel_CatalogOfferingVersionPlanReference: +class TestModel_ClusterNetworkSubnetReservedIP: """ - Test Class for CatalogOfferingVersionPlanReference + Test Class for ClusterNetworkSubnetReservedIP """ - def test_catalog_offering_version_plan_reference_serialization(self): + def test_cluster_network_subnet_reserved_ip_serialization(self): """ - Test serialization/deserialization for CatalogOfferingVersionPlanReference + Test serialization/deserialization for ClusterNetworkSubnetReservedIP """ # Construct dict forms of any model objects needed in order to build this model. + cluster_network_subnet_reserved_ip_lifecycle_reason_model = {} # ClusterNetworkSubnetReservedIPLifecycleReason + cluster_network_subnet_reserved_ip_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + cluster_network_subnet_reserved_ip_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_subnet_reserved_ip_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a json representation of a CatalogOfferingVersionPlanReference model - catalog_offering_version_plan_reference_model_json = {} - catalog_offering_version_plan_reference_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e' - catalog_offering_version_plan_reference_model_json['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_target_model = {} # ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext + cluster_network_subnet_reserved_ip_target_model['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_subnet_reserved_ip_target_model['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_subnet_reserved_ip_target_model['name'] = 'my-cluster-network-interface' + cluster_network_subnet_reserved_ip_target_model['resource_type'] = 'cluster_network_interface' - # Construct a model instance of CatalogOfferingVersionPlanReference by calling from_dict on the json representation - catalog_offering_version_plan_reference_model = CatalogOfferingVersionPlanReference.from_dict(catalog_offering_version_plan_reference_model_json) - assert catalog_offering_version_plan_reference_model != False + # Construct a json representation of a ClusterNetworkSubnetReservedIP model + cluster_network_subnet_reserved_ip_model_json = {} + cluster_network_subnet_reserved_ip_model_json['address'] = '10.1.0.6' + cluster_network_subnet_reserved_ip_model_json['auto_delete'] = False + cluster_network_subnet_reserved_ip_model_json['created_at'] = '2019-01-01T12:00:00Z' + cluster_network_subnet_reserved_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + cluster_network_subnet_reserved_ip_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + cluster_network_subnet_reserved_ip_model_json['lifecycle_reasons'] = [cluster_network_subnet_reserved_ip_lifecycle_reason_model] + cluster_network_subnet_reserved_ip_model_json['lifecycle_state'] = 'stable' + cluster_network_subnet_reserved_ip_model_json['name'] = 'my-cluster-network-subnet-reserved-ip' + cluster_network_subnet_reserved_ip_model_json['owner'] = 'user' + cluster_network_subnet_reserved_ip_model_json['resource_type'] = 'cluster_network_subnet_reserved_ip' + cluster_network_subnet_reserved_ip_model_json['target'] = cluster_network_subnet_reserved_ip_target_model - # Construct a model instance of CatalogOfferingVersionPlanReference by calling from_dict on the json representation - catalog_offering_version_plan_reference_model_dict = CatalogOfferingVersionPlanReference.from_dict(catalog_offering_version_plan_reference_model_json).__dict__ - catalog_offering_version_plan_reference_model2 = CatalogOfferingVersionPlanReference(**catalog_offering_version_plan_reference_model_dict) + # Construct a model instance of ClusterNetworkSubnetReservedIP by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_model = ClusterNetworkSubnetReservedIP.from_dict(cluster_network_subnet_reserved_ip_model_json) + assert cluster_network_subnet_reserved_ip_model != False + + # Construct a model instance of ClusterNetworkSubnetReservedIP by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_model_dict = ClusterNetworkSubnetReservedIP.from_dict(cluster_network_subnet_reserved_ip_model_json).__dict__ + cluster_network_subnet_reserved_ip_model2 = ClusterNetworkSubnetReservedIP(**cluster_network_subnet_reserved_ip_model_dict) # Verify the model instances are equivalent - assert catalog_offering_version_plan_reference_model == catalog_offering_version_plan_reference_model2 + assert cluster_network_subnet_reserved_ip_model == cluster_network_subnet_reserved_ip_model2 # Convert model instance back to dict and verify no loss of data - catalog_offering_version_plan_reference_model_json2 = catalog_offering_version_plan_reference_model.to_dict() - assert catalog_offering_version_plan_reference_model_json2 == catalog_offering_version_plan_reference_model_json + cluster_network_subnet_reserved_ip_model_json2 = cluster_network_subnet_reserved_ip_model.to_dict() + assert cluster_network_subnet_reserved_ip_model_json2 == cluster_network_subnet_reserved_ip_model_json -class TestModel_CatalogOfferingVersionReference: +class TestModel_ClusterNetworkSubnetReservedIPCollection: """ - Test Class for CatalogOfferingVersionReference + Test Class for ClusterNetworkSubnetReservedIPCollection """ - def test_catalog_offering_version_reference_serialization(self): + def test_cluster_network_subnet_reserved_ip_collection_serialization(self): """ - Test serialization/deserialization for CatalogOfferingVersionReference + Test serialization/deserialization for ClusterNetworkSubnetReservedIPCollection """ - # Construct a json representation of a CatalogOfferingVersionReference model - catalog_offering_version_reference_model_json = {} - catalog_offering_version_reference_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation - catalog_offering_version_reference_model = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json) - assert catalog_offering_version_reference_model != False + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips?limit=50' - # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation - catalog_offering_version_reference_model_dict = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json).__dict__ - catalog_offering_version_reference_model2 = CatalogOfferingVersionReference(**catalog_offering_version_reference_model_dict) + cluster_network_subnet_reserved_ip_lifecycle_reason_model = {} # ClusterNetworkSubnetReservedIPLifecycleReason + cluster_network_subnet_reserved_ip_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + cluster_network_subnet_reserved_ip_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_subnet_reserved_ip_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + cluster_network_subnet_reserved_ip_target_model = {} # ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext + cluster_network_subnet_reserved_ip_target_model['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_subnet_reserved_ip_target_model['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_subnet_reserved_ip_target_model['name'] = 'my-cluster-network-interface' + cluster_network_subnet_reserved_ip_target_model['resource_type'] = 'cluster_network_interface' + + cluster_network_subnet_reserved_ip_model = {} # ClusterNetworkSubnetReservedIP + cluster_network_subnet_reserved_ip_model['address'] = '10.1.0.6' + cluster_network_subnet_reserved_ip_model['auto_delete'] = False + cluster_network_subnet_reserved_ip_model['created_at'] = '2020-07-24T19:52:13Z' + cluster_network_subnet_reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_model['id'] = '63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_model['lifecycle_reasons'] = [cluster_network_subnet_reserved_ip_lifecycle_reason_model] + cluster_network_subnet_reserved_ip_model['lifecycle_state'] = 'stable' + cluster_network_subnet_reserved_ip_model['name'] = 'my-cluster-network-subnet-reserved-ip' + cluster_network_subnet_reserved_ip_model['owner'] = 'user' + cluster_network_subnet_reserved_ip_model['resource_type'] = 'cluster_network_subnet_reserved_ip' + cluster_network_subnet_reserved_ip_model['target'] = cluster_network_subnet_reserved_ip_target_model + + # Construct a json representation of a ClusterNetworkSubnetReservedIPCollection model + cluster_network_subnet_reserved_ip_collection_model_json = {} + cluster_network_subnet_reserved_ip_collection_model_json['first'] = page_link_model + cluster_network_subnet_reserved_ip_collection_model_json['limit'] = 20 + cluster_network_subnet_reserved_ip_collection_model_json['next'] = page_link_model + cluster_network_subnet_reserved_ip_collection_model_json['reserved_ips'] = [cluster_network_subnet_reserved_ip_model] + cluster_network_subnet_reserved_ip_collection_model_json['total_count'] = 132 + + # Construct a model instance of ClusterNetworkSubnetReservedIPCollection by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_collection_model = ClusterNetworkSubnetReservedIPCollection.from_dict(cluster_network_subnet_reserved_ip_collection_model_json) + assert cluster_network_subnet_reserved_ip_collection_model != False + + # Construct a model instance of ClusterNetworkSubnetReservedIPCollection by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_collection_model_dict = ClusterNetworkSubnetReservedIPCollection.from_dict(cluster_network_subnet_reserved_ip_collection_model_json).__dict__ + cluster_network_subnet_reserved_ip_collection_model2 = ClusterNetworkSubnetReservedIPCollection(**cluster_network_subnet_reserved_ip_collection_model_dict) # Verify the model instances are equivalent - assert catalog_offering_version_reference_model == catalog_offering_version_reference_model2 + assert cluster_network_subnet_reserved_ip_collection_model == cluster_network_subnet_reserved_ip_collection_model2 # Convert model instance back to dict and verify no loss of data - catalog_offering_version_reference_model_json2 = catalog_offering_version_reference_model.to_dict() - assert catalog_offering_version_reference_model_json2 == catalog_offering_version_reference_model_json + cluster_network_subnet_reserved_ip_collection_model_json2 = cluster_network_subnet_reserved_ip_collection_model.to_dict() + assert cluster_network_subnet_reserved_ip_collection_model_json2 == cluster_network_subnet_reserved_ip_collection_model_json -class TestModel_CertificateInstanceReference: +class TestModel_ClusterNetworkSubnetReservedIPLifecycleReason: """ - Test Class for CertificateInstanceReference + Test Class for ClusterNetworkSubnetReservedIPLifecycleReason """ - def test_certificate_instance_reference_serialization(self): + def test_cluster_network_subnet_reserved_ip_lifecycle_reason_serialization(self): """ - Test serialization/deserialization for CertificateInstanceReference + Test serialization/deserialization for ClusterNetworkSubnetReservedIPLifecycleReason """ - # Construct a json representation of a CertificateInstanceReference model - certificate_instance_reference_model_json = {} - certificate_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' + # Construct a json representation of a ClusterNetworkSubnetReservedIPLifecycleReason model + cluster_network_subnet_reserved_ip_lifecycle_reason_model_json = {} + cluster_network_subnet_reserved_ip_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider' + cluster_network_subnet_reserved_ip_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + cluster_network_subnet_reserved_ip_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' - # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation - certificate_instance_reference_model = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json) - assert certificate_instance_reference_model != False + # Construct a model instance of ClusterNetworkSubnetReservedIPLifecycleReason by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_lifecycle_reason_model = ClusterNetworkSubnetReservedIPLifecycleReason.from_dict(cluster_network_subnet_reserved_ip_lifecycle_reason_model_json) + assert cluster_network_subnet_reserved_ip_lifecycle_reason_model != False - # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation - certificate_instance_reference_model_dict = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json).__dict__ - certificate_instance_reference_model2 = CertificateInstanceReference(**certificate_instance_reference_model_dict) + # Construct a model instance of ClusterNetworkSubnetReservedIPLifecycleReason by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_lifecycle_reason_model_dict = ClusterNetworkSubnetReservedIPLifecycleReason.from_dict(cluster_network_subnet_reserved_ip_lifecycle_reason_model_json).__dict__ + cluster_network_subnet_reserved_ip_lifecycle_reason_model2 = ClusterNetworkSubnetReservedIPLifecycleReason(**cluster_network_subnet_reserved_ip_lifecycle_reason_model_dict) # Verify the model instances are equivalent - assert certificate_instance_reference_model == certificate_instance_reference_model2 + assert cluster_network_subnet_reserved_ip_lifecycle_reason_model == cluster_network_subnet_reserved_ip_lifecycle_reason_model2 # Convert model instance back to dict and verify no loss of data - certificate_instance_reference_model_json2 = certificate_instance_reference_model.to_dict() - assert certificate_instance_reference_model_json2 == certificate_instance_reference_model_json + cluster_network_subnet_reserved_ip_lifecycle_reason_model_json2 = cluster_network_subnet_reserved_ip_lifecycle_reason_model.to_dict() + assert cluster_network_subnet_reserved_ip_lifecycle_reason_model_json2 == cluster_network_subnet_reserved_ip_lifecycle_reason_model_json -class TestModel_CloudObjectStorageBucketReference: +class TestModel_ClusterNetworkSubnetReservedIPPatch: """ - Test Class for CloudObjectStorageBucketReference + Test Class for ClusterNetworkSubnetReservedIPPatch """ - def test_cloud_object_storage_bucket_reference_serialization(self): + def test_cluster_network_subnet_reserved_ip_patch_serialization(self): """ - Test serialization/deserialization for CloudObjectStorageBucketReference + Test serialization/deserialization for ClusterNetworkSubnetReservedIPPatch """ - # Construct a json representation of a CloudObjectStorageBucketReference model - cloud_object_storage_bucket_reference_model_json = {} - cloud_object_storage_bucket_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket' - cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue' + # Construct a json representation of a ClusterNetworkSubnetReservedIPPatch model + cluster_network_subnet_reserved_ip_patch_model_json = {} + cluster_network_subnet_reserved_ip_patch_model_json['auto_delete'] = False + cluster_network_subnet_reserved_ip_patch_model_json['name'] = 'my-cluster-network-subnet-reserved-ip' - # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation - cloud_object_storage_bucket_reference_model = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json) - assert cloud_object_storage_bucket_reference_model != False + # Construct a model instance of ClusterNetworkSubnetReservedIPPatch by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_patch_model = ClusterNetworkSubnetReservedIPPatch.from_dict(cluster_network_subnet_reserved_ip_patch_model_json) + assert cluster_network_subnet_reserved_ip_patch_model != False - # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation - cloud_object_storage_bucket_reference_model_dict = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json).__dict__ - cloud_object_storage_bucket_reference_model2 = CloudObjectStorageBucketReference(**cloud_object_storage_bucket_reference_model_dict) + # Construct a model instance of ClusterNetworkSubnetReservedIPPatch by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_patch_model_dict = ClusterNetworkSubnetReservedIPPatch.from_dict(cluster_network_subnet_reserved_ip_patch_model_json).__dict__ + cluster_network_subnet_reserved_ip_patch_model2 = ClusterNetworkSubnetReservedIPPatch(**cluster_network_subnet_reserved_ip_patch_model_dict) # Verify the model instances are equivalent - assert cloud_object_storage_bucket_reference_model == cloud_object_storage_bucket_reference_model2 + assert cluster_network_subnet_reserved_ip_patch_model == cluster_network_subnet_reserved_ip_patch_model2 # Convert model instance back to dict and verify no loss of data - cloud_object_storage_bucket_reference_model_json2 = cloud_object_storage_bucket_reference_model.to_dict() - assert cloud_object_storage_bucket_reference_model_json2 == cloud_object_storage_bucket_reference_model_json + cluster_network_subnet_reserved_ip_patch_model_json2 = cluster_network_subnet_reserved_ip_patch_model.to_dict() + assert cluster_network_subnet_reserved_ip_patch_model_json2 == cluster_network_subnet_reserved_ip_patch_model_json -class TestModel_CloudObjectStorageObjectReference: +class TestModel_ClusterNetworkSubnetReservedIPReference: """ - Test Class for CloudObjectStorageObjectReference + Test Class for ClusterNetworkSubnetReservedIPReference """ - def test_cloud_object_storage_object_reference_serialization(self): + def test_cluster_network_subnet_reserved_ip_reference_serialization(self): """ - Test serialization/deserialization for CloudObjectStorageObjectReference + Test serialization/deserialization for ClusterNetworkSubnetReservedIPReference """ - # Construct a json representation of a CloudObjectStorageObjectReference model - cloud_object_storage_object_reference_model_json = {} - cloud_object_storage_object_reference_model_json['name'] = 'my-object' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of CloudObjectStorageObjectReference by calling from_dict on the json representation - cloud_object_storage_object_reference_model = CloudObjectStorageObjectReference.from_dict(cloud_object_storage_object_reference_model_json) - assert cloud_object_storage_object_reference_model != False + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a model instance of CloudObjectStorageObjectReference by calling from_dict on the json representation - cloud_object_storage_object_reference_model_dict = CloudObjectStorageObjectReference.from_dict(cloud_object_storage_object_reference_model_json).__dict__ - cloud_object_storage_object_reference_model2 = CloudObjectStorageObjectReference(**cloud_object_storage_object_reference_model_dict) + # Construct a json representation of a ClusterNetworkSubnetReservedIPReference model + cluster_network_subnet_reserved_ip_reference_model_json = {} + cluster_network_subnet_reserved_ip_reference_model_json['address'] = '10.1.0.6' + cluster_network_subnet_reserved_ip_reference_model_json['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + cluster_network_subnet_reserved_ip_reference_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + cluster_network_subnet_reserved_ip_reference_model_json['name'] = 'my-cluster-network-subnet-reserved-ip' + cluster_network_subnet_reserved_ip_reference_model_json['resource_type'] = 'cluster_network_subnet_reserved_ip' + + # Construct a model instance of ClusterNetworkSubnetReservedIPReference by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_reference_model = ClusterNetworkSubnetReservedIPReference.from_dict(cluster_network_subnet_reserved_ip_reference_model_json) + assert cluster_network_subnet_reserved_ip_reference_model != False + + # Construct a model instance of ClusterNetworkSubnetReservedIPReference by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_reference_model_dict = ClusterNetworkSubnetReservedIPReference.from_dict(cluster_network_subnet_reserved_ip_reference_model_json).__dict__ + cluster_network_subnet_reserved_ip_reference_model2 = ClusterNetworkSubnetReservedIPReference(**cluster_network_subnet_reserved_ip_reference_model_dict) # Verify the model instances are equivalent - assert cloud_object_storage_object_reference_model == cloud_object_storage_object_reference_model2 + assert cluster_network_subnet_reserved_ip_reference_model == cluster_network_subnet_reserved_ip_reference_model2 # Convert model instance back to dict and verify no loss of data - cloud_object_storage_object_reference_model_json2 = cloud_object_storage_object_reference_model.to_dict() - assert cloud_object_storage_object_reference_model_json2 == cloud_object_storage_object_reference_model_json + cluster_network_subnet_reserved_ip_reference_model_json2 = cluster_network_subnet_reserved_ip_reference_model.to_dict() + assert cluster_network_subnet_reserved_ip_reference_model_json2 == cluster_network_subnet_reserved_ip_reference_model_json class TestModel_DNSInstanceReferenceLoadBalancerDNSContext: @@ -53458,7 +57962,7 @@ def test_dedicated_host_serialization(self): vcpu_model = {} # VCPU vcpu_model['architecture'] = 'amd64' - vcpu_model['count'] = 4 + vcpu_model['count'] = 56 vcpu_model['manufacturer'] = 'intel' deleted_model = {} # Deleted @@ -53466,38 +57970,38 @@ def test_dedicated_host_serialization(self): instance_disk_reference_model = {} # InstanceDiskReference instance_disk_reference_model['deleted'] = deleted_model - instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model['name'] = 'my-instance-disk' instance_disk_reference_model['resource_type'] = 'instance_disk' dedicated_host_disk_model = {} # DedicatedHostDisk - dedicated_host_disk_model['available'] = 38 - dedicated_host_disk_model['created_at'] = '2019-01-01T12:00:00Z' - dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' - dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['available'] = 3200 + dedicated_host_disk_model['created_at'] = '2024-11-04T17:05:47Z' + dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e' + dedicated_host_disk_model['id'] = '0717-bd091a9e-b036-4c65-a79b-56d164911f6e' dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model] dedicated_host_disk_model['interface_type'] = 'nvme' dedicated_host_disk_model['lifecycle_state'] = 'stable' dedicated_host_disk_model['name'] = 'my-dedicated-host-disk' dedicated_host_disk_model['provisionable'] = True dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk' - dedicated_host_disk_model['size'] = 38 - dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme'] + dedicated_host_disk_model['size'] = 3200 + dedicated_host_disk_model['supported_instance_interface_types'] = ['virtio_blk', 'nvme'] dedicated_host_group_reference_model = {} # DedicatedHostGroupReference - dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_reference_model['deleted'] = deleted_model - dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model['name'] = 'my-host-group' + dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['name'] = 'my-dedicated-host-group' dedicated_host_group_reference_model['resource_type'] = 'dedicated_host_group' instance_reference_model = {} # InstanceReference - instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model['deleted'] = deleted_model - instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - instance_reference_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + instance_reference_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model['name'] = 'my-instance' dedicated_host_numa_node_model = {} # DedicatedHostNUMANode @@ -53505,21 +58009,21 @@ def test_dedicated_host_serialization(self): dedicated_host_numa_node_model['vcpu'] = 56 dedicated_host_numa_model = {} # DedicatedHostNUMA - dedicated_host_numa_model['count'] = 2 + dedicated_host_numa_model['count'] = 0 dedicated_host_numa_model['nodes'] = [dedicated_host_numa_node_model] dedicated_host_profile_reference_model = {} # DedicatedHostProfileReference - dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216' dedicated_host_profile_reference_model['name'] = 'mx2-host-152x1216' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' - instance_profile_reference_model['name'] = 'bx2-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/mx2-2x16' + instance_profile_reference_model['name'] = 'mx2-2x16' instance_profile_reference_model['resource_type'] = 'instance_profile' zone_reference_model = {} # ZoneReference @@ -53582,7 +58086,7 @@ def test_dedicated_host_collection_serialization(self): vcpu_model = {} # VCPU vcpu_model['architecture'] = 'amd64' - vcpu_model['count'] = 4 + vcpu_model['count'] = 56 vcpu_model['manufacturer'] = 'intel' deleted_model = {} # Deleted @@ -53590,38 +58094,38 @@ def test_dedicated_host_collection_serialization(self): instance_disk_reference_model = {} # InstanceDiskReference instance_disk_reference_model['deleted'] = deleted_model - instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model['name'] = 'my-instance-disk' instance_disk_reference_model['resource_type'] = 'instance_disk' dedicated_host_disk_model = {} # DedicatedHostDisk - dedicated_host_disk_model['available'] = 38 - dedicated_host_disk_model['created_at'] = '2019-01-01T12:00:00Z' - dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' - dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['available'] = 3200 + dedicated_host_disk_model['created_at'] = '2024-11-04T17:05:47Z' + dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e' + dedicated_host_disk_model['id'] = '0717-bd091a9e-b036-4c65-a79b-56d164911f6e' dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model] dedicated_host_disk_model['interface_type'] = 'nvme' dedicated_host_disk_model['lifecycle_state'] = 'stable' dedicated_host_disk_model['name'] = 'my-dedicated-host-disk' dedicated_host_disk_model['provisionable'] = True dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk' - dedicated_host_disk_model['size'] = 38 - dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme'] + dedicated_host_disk_model['size'] = 3200 + dedicated_host_disk_model['supported_instance_interface_types'] = ['virtio_blk', 'nvme'] dedicated_host_group_reference_model = {} # DedicatedHostGroupReference - dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_reference_model['deleted'] = deleted_model - dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model['name'] = 'my-host-group' + dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model['name'] = 'my-dedicated-host-group' dedicated_host_group_reference_model['resource_type'] = 'dedicated_host_group' instance_reference_model = {} # InstanceReference - instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model['deleted'] = deleted_model - instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - instance_reference_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + instance_reference_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model['name'] = 'my-instance' dedicated_host_numa_node_model = {} # DedicatedHostNUMANode @@ -53629,21 +58133,21 @@ def test_dedicated_host_collection_serialization(self): dedicated_host_numa_node_model['vcpu'] = 56 dedicated_host_numa_model = {} # DedicatedHostNUMA - dedicated_host_numa_model['count'] = 2 + dedicated_host_numa_model['count'] = 0 dedicated_host_numa_model['nodes'] = [dedicated_host_numa_node_model] dedicated_host_profile_reference_model = {} # DedicatedHostProfileReference - dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216' dedicated_host_profile_reference_model['name'] = 'mx2-host-152x1216' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' - instance_profile_reference_model['name'] = 'bx2-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/mx2-2x16' + instance_profile_reference_model['name'] = 'mx2-2x16' instance_profile_reference_model['resource_type'] = 'instance_profile' zone_reference_model = {} # ZoneReference @@ -53651,9 +58155,9 @@ def test_dedicated_host_collection_serialization(self): zone_reference_model['name'] = 'us-south-1' dedicated_host_model = {} # DedicatedHost - dedicated_host_model['available_memory'] = 128 + dedicated_host_model['available_memory'] = 346 dedicated_host_model['available_vcpu'] = vcpu_model - dedicated_host_model['created_at'] = '2019-01-01T12:00:00Z' + dedicated_host_model['created_at'] = '2024-11-04T19:38:33Z' dedicated_host_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_model['disks'] = [dedicated_host_disk_model] dedicated_host_model['group'] = dedicated_host_group_reference_model @@ -53662,31 +58166,28 @@ def test_dedicated_host_collection_serialization(self): dedicated_host_model['instance_placement_enabled'] = True dedicated_host_model['instances'] = [instance_reference_model] dedicated_host_model['lifecycle_state'] = 'stable' - dedicated_host_model['memory'] = 128 - dedicated_host_model['name'] = 'my-host' + dedicated_host_model['memory'] = 346 + dedicated_host_model['name'] = 'my-dedicated-host' dedicated_host_model['numa'] = dedicated_host_numa_model dedicated_host_model['profile'] = dedicated_host_profile_reference_model dedicated_host_model['provisionable'] = True dedicated_host_model['resource_group'] = resource_group_reference_model dedicated_host_model['resource_type'] = 'dedicated_host' - dedicated_host_model['socket_count'] = 4 + dedicated_host_model['socket_count'] = 2 dedicated_host_model['state'] = 'available' dedicated_host_model['supported_instance_profiles'] = [instance_profile_reference_model] dedicated_host_model['vcpu'] = vcpu_model dedicated_host_model['zone'] = zone_reference_model - dedicated_host_collection_first_model = {} # DedicatedHostCollectionFirst - dedicated_host_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20' - - dedicated_host_collection_next_model = {} # DedicatedHostCollectionNext - dedicated_host_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=50' # Construct a json representation of a DedicatedHostCollection model dedicated_host_collection_model_json = {} dedicated_host_collection_model_json['dedicated_hosts'] = [dedicated_host_model] - dedicated_host_collection_model_json['first'] = dedicated_host_collection_first_model + dedicated_host_collection_model_json['first'] = page_link_model dedicated_host_collection_model_json['limit'] = 20 - dedicated_host_collection_model_json['next'] = dedicated_host_collection_next_model + dedicated_host_collection_model_json['next'] = page_link_model dedicated_host_collection_model_json['total_count'] = 132 # Construct a model instance of DedicatedHostCollection by calling from_dict on the json representation @@ -53705,66 +58206,6 @@ def test_dedicated_host_collection_serialization(self): assert dedicated_host_collection_model_json2 == dedicated_host_collection_model_json -class TestModel_DedicatedHostCollectionFirst: - """ - Test Class for DedicatedHostCollectionFirst - """ - - def test_dedicated_host_collection_first_serialization(self): - """ - Test serialization/deserialization for DedicatedHostCollectionFirst - """ - - # Construct a json representation of a DedicatedHostCollectionFirst model - dedicated_host_collection_first_model_json = {} - dedicated_host_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20' - - # Construct a model instance of DedicatedHostCollectionFirst by calling from_dict on the json representation - dedicated_host_collection_first_model = DedicatedHostCollectionFirst.from_dict(dedicated_host_collection_first_model_json) - assert dedicated_host_collection_first_model != False - - # Construct a model instance of DedicatedHostCollectionFirst by calling from_dict on the json representation - dedicated_host_collection_first_model_dict = DedicatedHostCollectionFirst.from_dict(dedicated_host_collection_first_model_json).__dict__ - dedicated_host_collection_first_model2 = DedicatedHostCollectionFirst(**dedicated_host_collection_first_model_dict) - - # Verify the model instances are equivalent - assert dedicated_host_collection_first_model == dedicated_host_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - dedicated_host_collection_first_model_json2 = dedicated_host_collection_first_model.to_dict() - assert dedicated_host_collection_first_model_json2 == dedicated_host_collection_first_model_json - - -class TestModel_DedicatedHostCollectionNext: - """ - Test Class for DedicatedHostCollectionNext - """ - - def test_dedicated_host_collection_next_serialization(self): - """ - Test serialization/deserialization for DedicatedHostCollectionNext - """ - - # Construct a json representation of a DedicatedHostCollectionNext model - dedicated_host_collection_next_model_json = {} - dedicated_host_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of DedicatedHostCollectionNext by calling from_dict on the json representation - dedicated_host_collection_next_model = DedicatedHostCollectionNext.from_dict(dedicated_host_collection_next_model_json) - assert dedicated_host_collection_next_model != False - - # Construct a model instance of DedicatedHostCollectionNext by calling from_dict on the json representation - dedicated_host_collection_next_model_dict = DedicatedHostCollectionNext.from_dict(dedicated_host_collection_next_model_json).__dict__ - dedicated_host_collection_next_model2 = DedicatedHostCollectionNext(**dedicated_host_collection_next_model_dict) - - # Verify the model instances are equivalent - assert dedicated_host_collection_next_model == dedicated_host_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - dedicated_host_collection_next_model_json2 = dedicated_host_collection_next_model.to_dict() - assert dedicated_host_collection_next_model_json2 == dedicated_host_collection_next_model_json - - class TestModel_DedicatedHostDisk: """ Test Class for DedicatedHostDisk @@ -53782,7 +58223,7 @@ def test_dedicated_host_disk_serialization(self): instance_disk_reference_model = {} # InstanceDiskReference instance_disk_reference_model['deleted'] = deleted_model - instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model['name'] = 'my-instance-disk' instance_disk_reference_model['resource_type'] = 'instance_disk' @@ -53791,8 +58232,8 @@ def test_dedicated_host_disk_serialization(self): dedicated_host_disk_model_json = {} dedicated_host_disk_model_json['available'] = 38 dedicated_host_disk_model_json['created_at'] = '2019-01-01T12:00:00Z' - dedicated_host_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' - dedicated_host_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e' + dedicated_host_disk_model_json['id'] = '0717-bd091a9e-b036-4c65-a79b-56d164911f6e' dedicated_host_disk_model_json['instance_disks'] = [instance_disk_reference_model] dedicated_host_disk_model_json['interface_type'] = 'nvme' dedicated_host_disk_model_json['lifecycle_state'] = 'stable' @@ -53835,24 +58276,24 @@ def test_dedicated_host_disk_collection_serialization(self): instance_disk_reference_model = {} # InstanceDiskReference instance_disk_reference_model['deleted'] = deleted_model - instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model['name'] = 'my-instance-disk' instance_disk_reference_model['resource_type'] = 'instance_disk' dedicated_host_disk_model = {} # DedicatedHostDisk - dedicated_host_disk_model['available'] = 38 - dedicated_host_disk_model['created_at'] = '2019-01-01T12:00:00Z' - dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' - dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + dedicated_host_disk_model['available'] = 3200 + dedicated_host_disk_model['created_at'] = '2024-11-04T17:05:47Z' + dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e' + dedicated_host_disk_model['id'] = '0717-bd091a9e-b036-4c65-a79b-56d164911f6e' dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model] dedicated_host_disk_model['interface_type'] = 'nvme' dedicated_host_disk_model['lifecycle_state'] = 'stable' dedicated_host_disk_model['name'] = 'my-dedicated-host-disk' dedicated_host_disk_model['provisionable'] = True dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk' - dedicated_host_disk_model['size'] = 38 - dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme'] + dedicated_host_disk_model['size'] = 3200 + dedicated_host_disk_model['supported_instance_interface_types'] = ['virtio_blk', 'nvme'] # Construct a json representation of a DedicatedHostDiskCollection model dedicated_host_disk_collection_model_json = {} @@ -53886,7 +58327,7 @@ def test_dedicated_host_disk_patch_serialization(self): # Construct a json representation of a DedicatedHostDiskPatch model dedicated_host_disk_patch_model_json = {} - dedicated_host_disk_patch_model_json['name'] = 'my-disk-updated' + dedicated_host_disk_patch_model_json['name'] = 'my-dedicated-host-disk-updated' # Construct a model instance of DedicatedHostDiskPatch by calling from_dict on the json representation dedicated_host_disk_patch_model = DedicatedHostDiskPatch.from_dict(dedicated_host_disk_patch_model_json) @@ -53924,17 +58365,17 @@ def test_dedicated_host_group_serialization(self): dedicated_host_reference_model['deleted'] = deleted_model dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_reference_model['id'] = '0717-1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_reference_model['name'] = 'my-host' + dedicated_host_reference_model['name'] = 'my-dedicated-host' dedicated_host_reference_model['resource_type'] = 'dedicated_host' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' - instance_profile_reference_model['name'] = 'bx2-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/mx2-2x16' + instance_profile_reference_model['name'] = 'mx2-2x16' instance_profile_reference_model['resource_type'] = 'instance_profile' zone_reference_model = {} # ZoneReference @@ -53945,12 +58386,12 @@ def test_dedicated_host_group_serialization(self): dedicated_host_group_model_json = {} dedicated_host_group_model_json['class'] = 'bx2' dedicated_host_group_model_json['created_at'] = '2019-01-01T12:00:00Z' - dedicated_host_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_model_json['dedicated_hosts'] = [dedicated_host_reference_model] dedicated_host_group_model_json['family'] = 'balanced' - dedicated_host_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_model_json['name'] = 'my-host-group' + dedicated_host_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model_json['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model_json['name'] = 'my-dedicated-host-group' dedicated_host_group_model_json['resource_group'] = resource_group_reference_model dedicated_host_group_model_json['resource_type'] = 'dedicated_host_group' dedicated_host_group_model_json['supported_instance_profiles'] = [instance_profile_reference_model] @@ -53984,8 +58425,8 @@ def test_dedicated_host_group_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_group_collection_first_model = {} # DedicatedHostGroupCollectionFirst - dedicated_host_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=50' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -53995,17 +58436,17 @@ def test_dedicated_host_group_collection_serialization(self): dedicated_host_reference_model['deleted'] = deleted_model dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_reference_model['id'] = '0717-1e09281b-f177-46fb-baf1-bc152b2e391a' - dedicated_host_reference_model['name'] = 'my-host' + dedicated_host_reference_model['name'] = 'my-dedicated-host' dedicated_host_reference_model['resource_type'] = 'dedicated_host' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' - instance_profile_reference_model['name'] = 'bx2-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/mx2-2x16' + instance_profile_reference_model['name'] = 'mx2-2x16' instance_profile_reference_model['resource_type'] = 'instance_profile' zone_reference_model = {} # ZoneReference @@ -54013,28 +58454,25 @@ def test_dedicated_host_group_collection_serialization(self): zone_reference_model['name'] = 'us-south-1' dedicated_host_group_model = {} # DedicatedHostGroup - dedicated_host_group_model['class'] = 'bx2' - dedicated_host_group_model['created_at'] = '2019-01-01T12:00:00Z' - dedicated_host_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model['class'] = 'mx2' + dedicated_host_group_model['created_at'] = '2024-11-04T21:29:25Z' + dedicated_host_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_model['dedicated_hosts'] = [dedicated_host_reference_model] - dedicated_host_group_model['family'] = 'balanced' - dedicated_host_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_model['name'] = 'my-host-group' + dedicated_host_group_model['family'] = 'memory' + dedicated_host_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_model['name'] = 'my-dedicated-host-group' dedicated_host_group_model['resource_group'] = resource_group_reference_model dedicated_host_group_model['resource_type'] = 'dedicated_host_group' dedicated_host_group_model['supported_instance_profiles'] = [instance_profile_reference_model] dedicated_host_group_model['zone'] = zone_reference_model - dedicated_host_group_collection_next_model = {} # DedicatedHostGroupCollectionNext - dedicated_host_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a DedicatedHostGroupCollection model dedicated_host_group_collection_model_json = {} - dedicated_host_group_collection_model_json['first'] = dedicated_host_group_collection_first_model + dedicated_host_group_collection_model_json['first'] = page_link_model dedicated_host_group_collection_model_json['groups'] = [dedicated_host_group_model] dedicated_host_group_collection_model_json['limit'] = 20 - dedicated_host_group_collection_model_json['next'] = dedicated_host_group_collection_next_model + dedicated_host_group_collection_model_json['next'] = page_link_model dedicated_host_group_collection_model_json['total_count'] = 132 # Construct a model instance of DedicatedHostGroupCollection by calling from_dict on the json representation @@ -54053,66 +58491,6 @@ def test_dedicated_host_group_collection_serialization(self): assert dedicated_host_group_collection_model_json2 == dedicated_host_group_collection_model_json -class TestModel_DedicatedHostGroupCollectionFirst: - """ - Test Class for DedicatedHostGroupCollectionFirst - """ - - def test_dedicated_host_group_collection_first_serialization(self): - """ - Test serialization/deserialization for DedicatedHostGroupCollectionFirst - """ - - # Construct a json representation of a DedicatedHostGroupCollectionFirst model - dedicated_host_group_collection_first_model_json = {} - dedicated_host_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20' - - # Construct a model instance of DedicatedHostGroupCollectionFirst by calling from_dict on the json representation - dedicated_host_group_collection_first_model = DedicatedHostGroupCollectionFirst.from_dict(dedicated_host_group_collection_first_model_json) - assert dedicated_host_group_collection_first_model != False - - # Construct a model instance of DedicatedHostGroupCollectionFirst by calling from_dict on the json representation - dedicated_host_group_collection_first_model_dict = DedicatedHostGroupCollectionFirst.from_dict(dedicated_host_group_collection_first_model_json).__dict__ - dedicated_host_group_collection_first_model2 = DedicatedHostGroupCollectionFirst(**dedicated_host_group_collection_first_model_dict) - - # Verify the model instances are equivalent - assert dedicated_host_group_collection_first_model == dedicated_host_group_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - dedicated_host_group_collection_first_model_json2 = dedicated_host_group_collection_first_model.to_dict() - assert dedicated_host_group_collection_first_model_json2 == dedicated_host_group_collection_first_model_json - - -class TestModel_DedicatedHostGroupCollectionNext: - """ - Test Class for DedicatedHostGroupCollectionNext - """ - - def test_dedicated_host_group_collection_next_serialization(self): - """ - Test serialization/deserialization for DedicatedHostGroupCollectionNext - """ - - # Construct a json representation of a DedicatedHostGroupCollectionNext model - dedicated_host_group_collection_next_model_json = {} - dedicated_host_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of DedicatedHostGroupCollectionNext by calling from_dict on the json representation - dedicated_host_group_collection_next_model = DedicatedHostGroupCollectionNext.from_dict(dedicated_host_group_collection_next_model_json) - assert dedicated_host_group_collection_next_model != False - - # Construct a model instance of DedicatedHostGroupCollectionNext by calling from_dict on the json representation - dedicated_host_group_collection_next_model_dict = DedicatedHostGroupCollectionNext.from_dict(dedicated_host_group_collection_next_model_json).__dict__ - dedicated_host_group_collection_next_model2 = DedicatedHostGroupCollectionNext(**dedicated_host_group_collection_next_model_dict) - - # Verify the model instances are equivalent - assert dedicated_host_group_collection_next_model == dedicated_host_group_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - dedicated_host_group_collection_next_model_json2 = dedicated_host_group_collection_next_model.to_dict() - assert dedicated_host_group_collection_next_model_json2 == dedicated_host_group_collection_next_model_json - - class TestModel_DedicatedHostGroupPatch: """ Test Class for DedicatedHostGroupPatch @@ -54125,7 +58503,7 @@ def test_dedicated_host_group_patch_serialization(self): # Construct a json representation of a DedicatedHostGroupPatch model dedicated_host_group_patch_model_json = {} - dedicated_host_group_patch_model_json['name'] = 'my-host-group' + dedicated_host_group_patch_model_json['name'] = 'my-dedicated-host-group' # Construct a model instance of DedicatedHostGroupPatch by calling from_dict on the json representation dedicated_host_group_patch_model = DedicatedHostGroupPatch.from_dict(dedicated_host_group_patch_model_json) @@ -54160,7 +58538,7 @@ def test_dedicated_host_group_prototype_dedicated_host_by_zone_context_serializa # Construct a json representation of a DedicatedHostGroupPrototypeDedicatedHostByZoneContext model dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json = {} - dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['name'] = 'my-host-group' + dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['name'] = 'my-dedicated-host-group' dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['resource_group'] = resource_group_identity_model # Construct a model instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext by calling from_dict on the json representation @@ -54196,11 +58574,11 @@ def test_dedicated_host_group_reference_serialization(self): # Construct a json representation of a DedicatedHostGroupReference model dedicated_host_group_reference_model_json = {} - dedicated_host_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' dedicated_host_group_reference_model_json['deleted'] = deleted_model - dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - dedicated_host_group_reference_model_json['name'] = 'my-host-group' + dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model_json['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_reference_model_json['name'] = 'my-dedicated-host-group' dedicated_host_group_reference_model_json['resource_type'] = 'dedicated_host_group' # Construct a model instance of DedicatedHostGroupReference by calling from_dict on the json representation @@ -54354,15 +58732,15 @@ def test_dedicated_host_profile_serialization(self): dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed dedicated_host_profile_memory_model['type'] = 'fixed' - dedicated_host_profile_memory_model['value'] = 16 + dedicated_host_profile_memory_model['value'] = 1216 dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed dedicated_host_profile_socket_model['type'] = 'fixed' - dedicated_host_profile_socket_model['value'] = 2 + dedicated_host_profile_socket_model['value'] = 4 instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' - instance_profile_reference_model['name'] = 'bx2-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/mx2-2x16' + instance_profile_reference_model['name'] = 'mx2-2x16' instance_profile_reference_model['resource_type'] = 'instance_profile' dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture @@ -54371,7 +58749,7 @@ def test_dedicated_host_profile_serialization(self): dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed dedicated_host_profile_vcpu_model['type'] = 'fixed' - dedicated_host_profile_vcpu_model['value'] = 16 + dedicated_host_profile_vcpu_model['value'] = 152 dedicated_host_profile_vcpu_manufacturer_model = {} # DedicatedHostProfileVCPUManufacturer dedicated_host_profile_vcpu_manufacturer_model['type'] = 'fixed' @@ -54420,11 +58798,8 @@ def test_dedicated_host_profile_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - dedicated_host_profile_collection_first_model = {} # DedicatedHostProfileCollectionFirst - dedicated_host_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20' - - dedicated_host_profile_collection_next_model = {} # DedicatedHostProfileCollectionNext - dedicated_host_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=50' dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface dedicated_host_profile_disk_interface_model['type'] = 'fixed' @@ -54450,15 +58825,15 @@ def test_dedicated_host_profile_collection_serialization(self): dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed dedicated_host_profile_memory_model['type'] = 'fixed' - dedicated_host_profile_memory_model['value'] = 16 + dedicated_host_profile_memory_model['value'] = 1216 dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed dedicated_host_profile_socket_model['type'] = 'fixed' - dedicated_host_profile_socket_model['value'] = 2 + dedicated_host_profile_socket_model['value'] = 4 instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' - instance_profile_reference_model['name'] = 'bx2-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/mx2-2x16' + instance_profile_reference_model['name'] = 'mx2-2x16' instance_profile_reference_model['resource_type'] = 'instance_profile' dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture @@ -54467,17 +58842,17 @@ def test_dedicated_host_profile_collection_serialization(self): dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed dedicated_host_profile_vcpu_model['type'] = 'fixed' - dedicated_host_profile_vcpu_model['value'] = 16 + dedicated_host_profile_vcpu_model['value'] = 152 dedicated_host_profile_vcpu_manufacturer_model = {} # DedicatedHostProfileVCPUManufacturer dedicated_host_profile_vcpu_manufacturer_model['type'] = 'fixed' dedicated_host_profile_vcpu_manufacturer_model['value'] = 'intel' dedicated_host_profile_model = {} # DedicatedHostProfile - dedicated_host_profile_model['class'] = 'bx2' + dedicated_host_profile_model['class'] = 'mx2' dedicated_host_profile_model['disks'] = [dedicated_host_profile_disk_model] - dedicated_host_profile_model['family'] = 'balanced' - dedicated_host_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a' + dedicated_host_profile_model['family'] = 'memory' + dedicated_host_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216' dedicated_host_profile_model['memory'] = dedicated_host_profile_memory_model dedicated_host_profile_model['name'] = 'mx2-host-152x1216' dedicated_host_profile_model['socket_count'] = dedicated_host_profile_socket_model @@ -54489,9 +58864,9 @@ def test_dedicated_host_profile_collection_serialization(self): # Construct a json representation of a DedicatedHostProfileCollection model dedicated_host_profile_collection_model_json = {} - dedicated_host_profile_collection_model_json['first'] = dedicated_host_profile_collection_first_model + dedicated_host_profile_collection_model_json['first'] = page_link_model dedicated_host_profile_collection_model_json['limit'] = 20 - dedicated_host_profile_collection_model_json['next'] = dedicated_host_profile_collection_next_model + dedicated_host_profile_collection_model_json['next'] = page_link_model dedicated_host_profile_collection_model_json['profiles'] = [dedicated_host_profile_model] dedicated_host_profile_collection_model_json['total_count'] = 132 @@ -54511,66 +58886,6 @@ def test_dedicated_host_profile_collection_serialization(self): assert dedicated_host_profile_collection_model_json2 == dedicated_host_profile_collection_model_json -class TestModel_DedicatedHostProfileCollectionFirst: - """ - Test Class for DedicatedHostProfileCollectionFirst - """ - - def test_dedicated_host_profile_collection_first_serialization(self): - """ - Test serialization/deserialization for DedicatedHostProfileCollectionFirst - """ - - # Construct a json representation of a DedicatedHostProfileCollectionFirst model - dedicated_host_profile_collection_first_model_json = {} - dedicated_host_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20' - - # Construct a model instance of DedicatedHostProfileCollectionFirst by calling from_dict on the json representation - dedicated_host_profile_collection_first_model = DedicatedHostProfileCollectionFirst.from_dict(dedicated_host_profile_collection_first_model_json) - assert dedicated_host_profile_collection_first_model != False - - # Construct a model instance of DedicatedHostProfileCollectionFirst by calling from_dict on the json representation - dedicated_host_profile_collection_first_model_dict = DedicatedHostProfileCollectionFirst.from_dict(dedicated_host_profile_collection_first_model_json).__dict__ - dedicated_host_profile_collection_first_model2 = DedicatedHostProfileCollectionFirst(**dedicated_host_profile_collection_first_model_dict) - - # Verify the model instances are equivalent - assert dedicated_host_profile_collection_first_model == dedicated_host_profile_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_collection_first_model_json2 = dedicated_host_profile_collection_first_model.to_dict() - assert dedicated_host_profile_collection_first_model_json2 == dedicated_host_profile_collection_first_model_json - - -class TestModel_DedicatedHostProfileCollectionNext: - """ - Test Class for DedicatedHostProfileCollectionNext - """ - - def test_dedicated_host_profile_collection_next_serialization(self): - """ - Test serialization/deserialization for DedicatedHostProfileCollectionNext - """ - - # Construct a json representation of a DedicatedHostProfileCollectionNext model - dedicated_host_profile_collection_next_model_json = {} - dedicated_host_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20' - - # Construct a model instance of DedicatedHostProfileCollectionNext by calling from_dict on the json representation - dedicated_host_profile_collection_next_model = DedicatedHostProfileCollectionNext.from_dict(dedicated_host_profile_collection_next_model_json) - assert dedicated_host_profile_collection_next_model != False - - # Construct a model instance of DedicatedHostProfileCollectionNext by calling from_dict on the json representation - dedicated_host_profile_collection_next_model_dict = DedicatedHostProfileCollectionNext.from_dict(dedicated_host_profile_collection_next_model_json).__dict__ - dedicated_host_profile_collection_next_model2 = DedicatedHostProfileCollectionNext(**dedicated_host_profile_collection_next_model_dict) - - # Verify the model instances are equivalent - assert dedicated_host_profile_collection_next_model == dedicated_host_profile_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - dedicated_host_profile_collection_next_model_json2 = dedicated_host_profile_collection_next_model.to_dict() - assert dedicated_host_profile_collection_next_model_json2 == dedicated_host_profile_collection_next_model_json - - class TestModel_DedicatedHostProfileDisk: """ Test Class for DedicatedHostProfileDisk @@ -55054,18 +59369,18 @@ def test_default_security_group_serialization(self): resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' - security_group_rule_local_model = {} # SecurityGroupRuleLocalIP - security_group_rule_local_model['address'] = '192.168.3.4' + security_group_rule_local_model = {} # SecurityGroupRuleLocalCIDR + security_group_rule_local_model['cidr_block'] = '0.0.0.0/0' - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP - security_group_rule_remote_model['address'] = '192.168.3.4' + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteCIDR + security_group_rule_remote_model['cidr_block'] = '0.0.0.0/0' security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll - security_group_rule_model['direction'] = 'inbound' - security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_model['direction'] = 'outbound' + security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-ad713e2d-9a80-4218-85a2-1f192b41b2c4' + security_group_rule_model['id'] = 'r006-ad713e2d-9a80-4218-85a2-1f192b41b2c4' security_group_rule_model['ip_version'] = 'ipv4' security_group_rule_model['local'] = security_group_rule_local_model security_group_rule_model['remote'] = security_group_rule_remote_model @@ -55076,8 +59391,8 @@ def test_default_security_group_serialization(self): security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext security_group_target_reference_model['deleted'] = deleted_model - security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + security_group_target_reference_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' security_group_target_reference_model['name'] = 'my-instance-network-interface' security_group_target_reference_model['resource_type'] = 'network_interface' @@ -55370,18 +59685,15 @@ def test_endpoint_gateway_collection_serialization(self): endpoint_gateway_model['target'] = endpoint_gateway_target_model endpoint_gateway_model['vpc'] = vpc_reference_model - endpoint_gateway_collection_first_model = {} # EndpointGatewayCollectionFirst - endpoint_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20' - - endpoint_gateway_collection_next_model = {} # EndpointGatewayCollectionNext - endpoint_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20' # Construct a json representation of a EndpointGatewayCollection model endpoint_gateway_collection_model_json = {} endpoint_gateway_collection_model_json['endpoint_gateways'] = [endpoint_gateway_model] - endpoint_gateway_collection_model_json['first'] = endpoint_gateway_collection_first_model + endpoint_gateway_collection_model_json['first'] = page_link_model endpoint_gateway_collection_model_json['limit'] = 20 - endpoint_gateway_collection_model_json['next'] = endpoint_gateway_collection_next_model + endpoint_gateway_collection_model_json['next'] = page_link_model endpoint_gateway_collection_model_json['total_count'] = 132 # Construct a model instance of EndpointGatewayCollection by calling from_dict on the json representation @@ -55400,66 +59712,6 @@ def test_endpoint_gateway_collection_serialization(self): assert endpoint_gateway_collection_model_json2 == endpoint_gateway_collection_model_json -class TestModel_EndpointGatewayCollectionFirst: - """ - Test Class for EndpointGatewayCollectionFirst - """ - - def test_endpoint_gateway_collection_first_serialization(self): - """ - Test serialization/deserialization for EndpointGatewayCollectionFirst - """ - - # Construct a json representation of a EndpointGatewayCollectionFirst model - endpoint_gateway_collection_first_model_json = {} - endpoint_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20' - - # Construct a model instance of EndpointGatewayCollectionFirst by calling from_dict on the json representation - endpoint_gateway_collection_first_model = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json) - assert endpoint_gateway_collection_first_model != False - - # Construct a model instance of EndpointGatewayCollectionFirst by calling from_dict on the json representation - endpoint_gateway_collection_first_model_dict = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json).__dict__ - endpoint_gateway_collection_first_model2 = EndpointGatewayCollectionFirst(**endpoint_gateway_collection_first_model_dict) - - # Verify the model instances are equivalent - assert endpoint_gateway_collection_first_model == endpoint_gateway_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - endpoint_gateway_collection_first_model_json2 = endpoint_gateway_collection_first_model.to_dict() - assert endpoint_gateway_collection_first_model_json2 == endpoint_gateway_collection_first_model_json - - -class TestModel_EndpointGatewayCollectionNext: - """ - Test Class for EndpointGatewayCollectionNext - """ - - def test_endpoint_gateway_collection_next_serialization(self): - """ - Test serialization/deserialization for EndpointGatewayCollectionNext - """ - - # Construct a json representation of a EndpointGatewayCollectionNext model - endpoint_gateway_collection_next_model_json = {} - endpoint_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20' - - # Construct a model instance of EndpointGatewayCollectionNext by calling from_dict on the json representation - endpoint_gateway_collection_next_model = EndpointGatewayCollectionNext.from_dict(endpoint_gateway_collection_next_model_json) - assert endpoint_gateway_collection_next_model != False - - # Construct a model instance of EndpointGatewayCollectionNext by calling from_dict on the json representation - endpoint_gateway_collection_next_model_dict = EndpointGatewayCollectionNext.from_dict(endpoint_gateway_collection_next_model_json).__dict__ - endpoint_gateway_collection_next_model2 = EndpointGatewayCollectionNext(**endpoint_gateway_collection_next_model_dict) - - # Verify the model instances are equivalent - assert endpoint_gateway_collection_next_model == endpoint_gateway_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - endpoint_gateway_collection_next_model_json2 = endpoint_gateway_collection_next_model.to_dict() - assert endpoint_gateway_collection_next_model_json2 == endpoint_gateway_collection_next_model_json - - class TestModel_EndpointGatewayLifecycleReason: """ Test Class for EndpointGatewayLifecycleReason @@ -55628,26 +59880,36 @@ def test_floating_ip_serialization(self): resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + floating_ip_target_model = {} # FloatingIPTargetVirtualNetworkInterfaceReference + floating_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' floating_ip_target_model['deleted'] = deleted_model - floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['name'] = 'my-instance-network-interface' + floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + floating_ip_target_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + floating_ip_target_model['name'] = 'my-virtual-network-interface' floating_ip_target_model['primary_ip'] = reserved_ip_reference_model - floating_ip_target_model['resource_type'] = 'network_interface' + floating_ip_target_model['resource_type'] = 'virtual_network_interface' + floating_ip_target_model['subnet'] = subnet_reference_model zone_reference_model = {} # ZoneReference zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' @@ -55657,9 +59919,9 @@ def test_floating_ip_serialization(self): floating_ip_model_json = {} floating_ip_model_json['address'] = '203.0.113.1' floating_ip_model_json['created_at'] = '2019-01-01T12:00:00Z' - floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_model_json['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_model_json['name'] = 'my-floating-ip' floating_ip_model_json['resource_group'] = resource_group_reference_model floating_ip_model_json['status'] = 'available' @@ -55694,32 +59956,42 @@ def test_floating_ip_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - floating_ip_collection_first_model = {} # FloatingIPCollectionFirst - floating_ip_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + floating_ip_target_model = {} # FloatingIPTargetVirtualNetworkInterfaceReference + floating_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' floating_ip_target_model['deleted'] = deleted_model - floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['name'] = 'my-instance-network-interface' + floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + floating_ip_target_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + floating_ip_target_model['name'] = 'my-virtual-network-interface' floating_ip_target_model['primary_ip'] = reserved_ip_reference_model - floating_ip_target_model['resource_type'] = 'network_interface' + floating_ip_target_model['resource_type'] = 'virtual_network_interface' + floating_ip_target_model['subnet'] = subnet_reference_model zone_reference_model = {} # ZoneReference zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' @@ -55727,25 +59999,22 @@ def test_floating_ip_collection_serialization(self): floating_ip_model = {} # FloatingIP floating_ip_model['address'] = '203.0.113.1' - floating_ip_model['created_at'] = '2019-01-01T12:00:00Z' - floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model['created_at'] = '2024-10-15T12:08:05Z' + floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_model['name'] = 'my-floating-ip' floating_ip_model['resource_group'] = resource_group_reference_model floating_ip_model['status'] = 'available' floating_ip_model['target'] = floating_ip_target_model floating_ip_model['zone'] = zone_reference_model - floating_ip_collection_next_model = {} # FloatingIPCollectionNext - floating_ip_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a FloatingIPCollection model floating_ip_collection_model_json = {} - floating_ip_collection_model_json['first'] = floating_ip_collection_first_model + floating_ip_collection_model_json['first'] = page_link_model floating_ip_collection_model_json['floating_ips'] = [floating_ip_model] floating_ip_collection_model_json['limit'] = 20 - floating_ip_collection_model_json['next'] = floating_ip_collection_next_model + floating_ip_collection_model_json['next'] = page_link_model floating_ip_collection_model_json['total_count'] = 132 # Construct a model instance of FloatingIPCollection by calling from_dict on the json representation @@ -55764,66 +60033,6 @@ def test_floating_ip_collection_serialization(self): assert floating_ip_collection_model_json2 == floating_ip_collection_model_json -class TestModel_FloatingIPCollectionFirst: - """ - Test Class for FloatingIPCollectionFirst - """ - - def test_floating_ip_collection_first_serialization(self): - """ - Test serialization/deserialization for FloatingIPCollectionFirst - """ - - # Construct a json representation of a FloatingIPCollectionFirst model - floating_ip_collection_first_model_json = {} - floating_ip_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20' - - # Construct a model instance of FloatingIPCollectionFirst by calling from_dict on the json representation - floating_ip_collection_first_model = FloatingIPCollectionFirst.from_dict(floating_ip_collection_first_model_json) - assert floating_ip_collection_first_model != False - - # Construct a model instance of FloatingIPCollectionFirst by calling from_dict on the json representation - floating_ip_collection_first_model_dict = FloatingIPCollectionFirst.from_dict(floating_ip_collection_first_model_json).__dict__ - floating_ip_collection_first_model2 = FloatingIPCollectionFirst(**floating_ip_collection_first_model_dict) - - # Verify the model instances are equivalent - assert floating_ip_collection_first_model == floating_ip_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - floating_ip_collection_first_model_json2 = floating_ip_collection_first_model.to_dict() - assert floating_ip_collection_first_model_json2 == floating_ip_collection_first_model_json - - -class TestModel_FloatingIPCollectionNext: - """ - Test Class for FloatingIPCollectionNext - """ - - def test_floating_ip_collection_next_serialization(self): - """ - Test serialization/deserialization for FloatingIPCollectionNext - """ - - # Construct a json representation of a FloatingIPCollectionNext model - floating_ip_collection_next_model_json = {} - floating_ip_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of FloatingIPCollectionNext by calling from_dict on the json representation - floating_ip_collection_next_model = FloatingIPCollectionNext.from_dict(floating_ip_collection_next_model_json) - assert floating_ip_collection_next_model != False - - # Construct a model instance of FloatingIPCollectionNext by calling from_dict on the json representation - floating_ip_collection_next_model_dict = FloatingIPCollectionNext.from_dict(floating_ip_collection_next_model_json).__dict__ - floating_ip_collection_next_model2 = FloatingIPCollectionNext(**floating_ip_collection_next_model_dict) - - # Verify the model instances are equivalent - assert floating_ip_collection_next_model == floating_ip_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - floating_ip_collection_next_model_json2 = floating_ip_collection_next_model.to_dict() - assert floating_ip_collection_next_model_json2 == floating_ip_collection_next_model_json - - class TestModel_FloatingIPCollectionVirtualNetworkInterfaceContext: """ Test Class for FloatingIPCollectionVirtualNetworkInterfaceContext @@ -55836,29 +60045,26 @@ def test_floating_ip_collection_virtual_network_interface_context_serialization( # Construct dict forms of any model objects needed in order to build this model. - floating_ip_collection_virtual_network_interface_context_first_model = {} # FloatingIPCollectionVirtualNetworkInterfaceContextFirst - floating_ip_collection_virtual_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef/floating_ips?limit=50' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' floating_ip_reference_model = {} # FloatingIPReference floating_ip_reference_model['address'] = '203.0.113.1' - floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['deleted'] = deleted_model - floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['name'] = 'my-floating-ip' - floating_ip_collection_virtual_network_interface_context_next_model = {} # FloatingIPCollectionVirtualNetworkInterfaceContextNext - floating_ip_collection_virtual_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a FloatingIPCollectionVirtualNetworkInterfaceContext model floating_ip_collection_virtual_network_interface_context_model_json = {} - floating_ip_collection_virtual_network_interface_context_model_json['first'] = floating_ip_collection_virtual_network_interface_context_first_model + floating_ip_collection_virtual_network_interface_context_model_json['first'] = page_link_model floating_ip_collection_virtual_network_interface_context_model_json['floating_ips'] = [floating_ip_reference_model] floating_ip_collection_virtual_network_interface_context_model_json['limit'] = 20 - floating_ip_collection_virtual_network_interface_context_model_json['next'] = floating_ip_collection_virtual_network_interface_context_next_model + floating_ip_collection_virtual_network_interface_context_model_json['next'] = page_link_model floating_ip_collection_virtual_network_interface_context_model_json['total_count'] = 132 # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContext by calling from_dict on the json representation @@ -55877,66 +60083,6 @@ def test_floating_ip_collection_virtual_network_interface_context_serialization( assert floating_ip_collection_virtual_network_interface_context_model_json2 == floating_ip_collection_virtual_network_interface_context_model_json -class TestModel_FloatingIPCollectionVirtualNetworkInterfaceContextFirst: - """ - Test Class for FloatingIPCollectionVirtualNetworkInterfaceContextFirst - """ - - def test_floating_ip_collection_virtual_network_interface_context_first_serialization(self): - """ - Test serialization/deserialization for FloatingIPCollectionVirtualNetworkInterfaceContextFirst - """ - - # Construct a json representation of a FloatingIPCollectionVirtualNetworkInterfaceContextFirst model - floating_ip_collection_virtual_network_interface_context_first_model_json = {} - floating_ip_collection_virtual_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20' - - # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContextFirst by calling from_dict on the json representation - floating_ip_collection_virtual_network_interface_context_first_model = FloatingIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(floating_ip_collection_virtual_network_interface_context_first_model_json) - assert floating_ip_collection_virtual_network_interface_context_first_model != False - - # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContextFirst by calling from_dict on the json representation - floating_ip_collection_virtual_network_interface_context_first_model_dict = FloatingIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(floating_ip_collection_virtual_network_interface_context_first_model_json).__dict__ - floating_ip_collection_virtual_network_interface_context_first_model2 = FloatingIPCollectionVirtualNetworkInterfaceContextFirst(**floating_ip_collection_virtual_network_interface_context_first_model_dict) - - # Verify the model instances are equivalent - assert floating_ip_collection_virtual_network_interface_context_first_model == floating_ip_collection_virtual_network_interface_context_first_model2 - - # Convert model instance back to dict and verify no loss of data - floating_ip_collection_virtual_network_interface_context_first_model_json2 = floating_ip_collection_virtual_network_interface_context_first_model.to_dict() - assert floating_ip_collection_virtual_network_interface_context_first_model_json2 == floating_ip_collection_virtual_network_interface_context_first_model_json - - -class TestModel_FloatingIPCollectionVirtualNetworkInterfaceContextNext: - """ - Test Class for FloatingIPCollectionVirtualNetworkInterfaceContextNext - """ - - def test_floating_ip_collection_virtual_network_interface_context_next_serialization(self): - """ - Test serialization/deserialization for FloatingIPCollectionVirtualNetworkInterfaceContextNext - """ - - # Construct a json representation of a FloatingIPCollectionVirtualNetworkInterfaceContextNext model - floating_ip_collection_virtual_network_interface_context_next_model_json = {} - floating_ip_collection_virtual_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContextNext by calling from_dict on the json representation - floating_ip_collection_virtual_network_interface_context_next_model = FloatingIPCollectionVirtualNetworkInterfaceContextNext.from_dict(floating_ip_collection_virtual_network_interface_context_next_model_json) - assert floating_ip_collection_virtual_network_interface_context_next_model != False - - # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContextNext by calling from_dict on the json representation - floating_ip_collection_virtual_network_interface_context_next_model_dict = FloatingIPCollectionVirtualNetworkInterfaceContextNext.from_dict(floating_ip_collection_virtual_network_interface_context_next_model_json).__dict__ - floating_ip_collection_virtual_network_interface_context_next_model2 = FloatingIPCollectionVirtualNetworkInterfaceContextNext(**floating_ip_collection_virtual_network_interface_context_next_model_dict) - - # Verify the model instances are equivalent - assert floating_ip_collection_virtual_network_interface_context_next_model == floating_ip_collection_virtual_network_interface_context_next_model2 - - # Convert model instance back to dict and verify no loss of data - floating_ip_collection_virtual_network_interface_context_next_model_json2 = floating_ip_collection_virtual_network_interface_context_next_model.to_dict() - assert floating_ip_collection_virtual_network_interface_context_next_model_json2 == floating_ip_collection_virtual_network_interface_context_next_model_json - - class TestModel_FloatingIPPatch: """ Test Class for FloatingIPPatch @@ -55950,7 +60096,7 @@ def test_floating_ip_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. floating_ip_target_patch_model = {} # FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById - floating_ip_target_patch_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_patch_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' # Construct a json representation of a FloatingIPPatch model floating_ip_patch_model_json = {} @@ -55991,10 +60137,10 @@ def test_floating_ip_reference_serialization(self): # Construct a json representation of a FloatingIPReference model floating_ip_reference_model_json = {} floating_ip_reference_model_json['address'] = '203.0.113.1' - floating_ip_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model_json['deleted'] = deleted_model - floating_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model_json['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model_json['name'] = 'my-floating-ip' # Construct a model instance of FloatingIPReference by calling from_dict on the json representation @@ -56028,26 +60174,36 @@ def test_floating_ip_unpaginated_collection_serialization(self): resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + floating_ip_target_model = {} # FloatingIPTargetVirtualNetworkInterfaceReference + floating_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' floating_ip_target_model['deleted'] = deleted_model - floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['name'] = 'my-instance-network-interface' + floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + floating_ip_target_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + floating_ip_target_model['name'] = 'my-virtual-network-interface' floating_ip_target_model['primary_ip'] = reserved_ip_reference_model - floating_ip_target_model['resource_type'] = 'network_interface' + floating_ip_target_model['resource_type'] = 'virtual_network_interface' + floating_ip_target_model['subnet'] = subnet_reference_model zone_reference_model = {} # ZoneReference zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' @@ -56055,10 +60211,10 @@ def test_floating_ip_unpaginated_collection_serialization(self): floating_ip_model = {} # FloatingIP floating_ip_model['address'] = '203.0.113.1' - floating_ip_model['created_at'] = '2019-01-01T12:00:00Z' - floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_model['created_at'] = '2024-10-15T12:08:05Z' + floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_model['name'] = 'my-floating-ip' floating_ip_model['resource_group'] = resource_group_reference_model floating_ip_model['status'] = 'available' @@ -56110,8 +60266,8 @@ def test_flow_log_collector_serialization(self): flow_log_collector_target_model = {} # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext flow_log_collector_target_model['deleted'] = deleted_model - flow_log_collector_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + flow_log_collector_target_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' flow_log_collector_target_model['name'] = 'my-instance-network-interface' flow_log_collector_target_model['resource_type'] = 'network_interface' @@ -56166,8 +60322,8 @@ def test_flow_log_collector_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - flow_log_collector_collection_first_model = {} # FlowLogCollectorCollectionFirst - flow_log_collector_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' @@ -56182,8 +60338,8 @@ def test_flow_log_collector_collection_serialization(self): flow_log_collector_target_model = {} # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext flow_log_collector_target_model['deleted'] = deleted_model - flow_log_collector_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + flow_log_collector_target_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' flow_log_collector_target_model['name'] = 'my-instance-network-interface' flow_log_collector_target_model['resource_type'] = 'network_interface' @@ -56209,15 +60365,12 @@ def test_flow_log_collector_collection_serialization(self): flow_log_collector_model['target'] = flow_log_collector_target_model flow_log_collector_model['vpc'] = vpc_reference_model - flow_log_collector_collection_next_model = {} # FlowLogCollectorCollectionNext - flow_log_collector_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a FlowLogCollectorCollection model flow_log_collector_collection_model_json = {} - flow_log_collector_collection_model_json['first'] = flow_log_collector_collection_first_model + flow_log_collector_collection_model_json['first'] = page_link_model flow_log_collector_collection_model_json['flow_log_collectors'] = [flow_log_collector_model] flow_log_collector_collection_model_json['limit'] = 20 - flow_log_collector_collection_model_json['next'] = flow_log_collector_collection_next_model + flow_log_collector_collection_model_json['next'] = page_link_model flow_log_collector_collection_model_json['total_count'] = 132 # Construct a model instance of FlowLogCollectorCollection by calling from_dict on the json representation @@ -56236,66 +60389,6 @@ def test_flow_log_collector_collection_serialization(self): assert flow_log_collector_collection_model_json2 == flow_log_collector_collection_model_json -class TestModel_FlowLogCollectorCollectionFirst: - """ - Test Class for FlowLogCollectorCollectionFirst - """ - - def test_flow_log_collector_collection_first_serialization(self): - """ - Test serialization/deserialization for FlowLogCollectorCollectionFirst - """ - - # Construct a json representation of a FlowLogCollectorCollectionFirst model - flow_log_collector_collection_first_model_json = {} - flow_log_collector_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20' - - # Construct a model instance of FlowLogCollectorCollectionFirst by calling from_dict on the json representation - flow_log_collector_collection_first_model = FlowLogCollectorCollectionFirst.from_dict(flow_log_collector_collection_first_model_json) - assert flow_log_collector_collection_first_model != False - - # Construct a model instance of FlowLogCollectorCollectionFirst by calling from_dict on the json representation - flow_log_collector_collection_first_model_dict = FlowLogCollectorCollectionFirst.from_dict(flow_log_collector_collection_first_model_json).__dict__ - flow_log_collector_collection_first_model2 = FlowLogCollectorCollectionFirst(**flow_log_collector_collection_first_model_dict) - - # Verify the model instances are equivalent - assert flow_log_collector_collection_first_model == flow_log_collector_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - flow_log_collector_collection_first_model_json2 = flow_log_collector_collection_first_model.to_dict() - assert flow_log_collector_collection_first_model_json2 == flow_log_collector_collection_first_model_json - - -class TestModel_FlowLogCollectorCollectionNext: - """ - Test Class for FlowLogCollectorCollectionNext - """ - - def test_flow_log_collector_collection_next_serialization(self): - """ - Test serialization/deserialization for FlowLogCollectorCollectionNext - """ - - # Construct a json representation of a FlowLogCollectorCollectionNext model - flow_log_collector_collection_next_model_json = {} - flow_log_collector_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of FlowLogCollectorCollectionNext by calling from_dict on the json representation - flow_log_collector_collection_next_model = FlowLogCollectorCollectionNext.from_dict(flow_log_collector_collection_next_model_json) - assert flow_log_collector_collection_next_model != False - - # Construct a model instance of FlowLogCollectorCollectionNext by calling from_dict on the json representation - flow_log_collector_collection_next_model_dict = FlowLogCollectorCollectionNext.from_dict(flow_log_collector_collection_next_model_json).__dict__ - flow_log_collector_collection_next_model2 = FlowLogCollectorCollectionNext(**flow_log_collector_collection_next_model_dict) - - # Verify the model instances are equivalent - assert flow_log_collector_collection_next_model == flow_log_collector_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - flow_log_collector_collection_next_model_json2 = flow_log_collector_collection_next_model.to_dict() - assert flow_log_collector_collection_next_model_json2 == flow_log_collector_collection_next_model_json - - class TestModel_FlowLogCollectorPatch: """ Test Class for FlowLogCollectorPatch @@ -56398,8 +60491,8 @@ def test_ike_policy_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - ike_policy_collection_first_model = {} # IKEPolicyCollectionFirst - ike_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -56431,15 +60524,12 @@ def test_ike_policy_collection_serialization(self): ike_policy_model['resource_group'] = resource_group_reference_model ike_policy_model['resource_type'] = 'ike_policy' - ike_policy_collection_next_model = {} # IKEPolicyCollectionNext - ike_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - # Construct a json representation of a IKEPolicyCollection model ike_policy_collection_model_json = {} - ike_policy_collection_model_json['first'] = ike_policy_collection_first_model + ike_policy_collection_model_json['first'] = page_link_model ike_policy_collection_model_json['ike_policies'] = [ike_policy_model] ike_policy_collection_model_json['limit'] = 20 - ike_policy_collection_model_json['next'] = ike_policy_collection_next_model + ike_policy_collection_model_json['next'] = page_link_model ike_policy_collection_model_json['total_count'] = 132 # Construct a model instance of IKEPolicyCollection by calling from_dict on the json representation @@ -56458,66 +60548,6 @@ def test_ike_policy_collection_serialization(self): assert ike_policy_collection_model_json2 == ike_policy_collection_model_json -class TestModel_IKEPolicyCollectionFirst: - """ - Test Class for IKEPolicyCollectionFirst - """ - - def test_ike_policy_collection_first_serialization(self): - """ - Test serialization/deserialization for IKEPolicyCollectionFirst - """ - - # Construct a json representation of a IKEPolicyCollectionFirst model - ike_policy_collection_first_model_json = {} - ike_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20' - - # Construct a model instance of IKEPolicyCollectionFirst by calling from_dict on the json representation - ike_policy_collection_first_model = IKEPolicyCollectionFirst.from_dict(ike_policy_collection_first_model_json) - assert ike_policy_collection_first_model != False - - # Construct a model instance of IKEPolicyCollectionFirst by calling from_dict on the json representation - ike_policy_collection_first_model_dict = IKEPolicyCollectionFirst.from_dict(ike_policy_collection_first_model_json).__dict__ - ike_policy_collection_first_model2 = IKEPolicyCollectionFirst(**ike_policy_collection_first_model_dict) - - # Verify the model instances are equivalent - assert ike_policy_collection_first_model == ike_policy_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - ike_policy_collection_first_model_json2 = ike_policy_collection_first_model.to_dict() - assert ike_policy_collection_first_model_json2 == ike_policy_collection_first_model_json - - -class TestModel_IKEPolicyCollectionNext: - """ - Test Class for IKEPolicyCollectionNext - """ - - def test_ike_policy_collection_next_serialization(self): - """ - Test serialization/deserialization for IKEPolicyCollectionNext - """ - - # Construct a json representation of a IKEPolicyCollectionNext model - ike_policy_collection_next_model_json = {} - ike_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - - # Construct a model instance of IKEPolicyCollectionNext by calling from_dict on the json representation - ike_policy_collection_next_model = IKEPolicyCollectionNext.from_dict(ike_policy_collection_next_model_json) - assert ike_policy_collection_next_model != False - - # Construct a model instance of IKEPolicyCollectionNext by calling from_dict on the json representation - ike_policy_collection_next_model_dict = IKEPolicyCollectionNext.from_dict(ike_policy_collection_next_model_json).__dict__ - ike_policy_collection_next_model2 = IKEPolicyCollectionNext(**ike_policy_collection_next_model_dict) - - # Verify the model instances are equivalent - assert ike_policy_collection_next_model == ike_policy_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - ike_policy_collection_next_model_json2 = ike_policy_collection_next_model.to_dict() - assert ike_policy_collection_next_model_json2 == ike_policy_collection_next_model_json - - class TestModel_IKEPolicyConnectionCollection: """ Test Class for IKEPolicyConnectionCollection @@ -56590,18 +60620,15 @@ def test_ike_policy_connection_collection_serialization(self): vpn_gateway_connection_model['local'] = vpn_gateway_connection_policy_mode_local_model vpn_gateway_connection_model['peer'] = vpn_gateway_connection_policy_mode_peer_model - ike_policy_connection_collection_first_model = {} # IKEPolicyConnectionCollectionFirst - ike_policy_connection_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?limit=20' - - ike_policy_connection_collection_next_model = {} # IKEPolicyConnectionCollectionNext - ike_policy_connection_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?start=c6d339ad873241c4acc936dfcff3f6d2&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?limit=20' # Construct a json representation of a IKEPolicyConnectionCollection model ike_policy_connection_collection_model_json = {} ike_policy_connection_collection_model_json['connections'] = [vpn_gateway_connection_model] - ike_policy_connection_collection_model_json['first'] = ike_policy_connection_collection_first_model + ike_policy_connection_collection_model_json['first'] = page_link_model ike_policy_connection_collection_model_json['limit'] = 20 - ike_policy_connection_collection_model_json['next'] = ike_policy_connection_collection_next_model + ike_policy_connection_collection_model_json['next'] = page_link_model ike_policy_connection_collection_model_json['total_count'] = 132 # Construct a model instance of IKEPolicyConnectionCollection by calling from_dict on the json representation @@ -56620,66 +60647,6 @@ def test_ike_policy_connection_collection_serialization(self): assert ike_policy_connection_collection_model_json2 == ike_policy_connection_collection_model_json -class TestModel_IKEPolicyConnectionCollectionFirst: - """ - Test Class for IKEPolicyConnectionCollectionFirst - """ - - def test_ike_policy_connection_collection_first_serialization(self): - """ - Test serialization/deserialization for IKEPolicyConnectionCollectionFirst - """ - - # Construct a json representation of a IKEPolicyConnectionCollectionFirst model - ike_policy_connection_collection_first_model_json = {} - ike_policy_connection_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?limit=20' - - # Construct a model instance of IKEPolicyConnectionCollectionFirst by calling from_dict on the json representation - ike_policy_connection_collection_first_model = IKEPolicyConnectionCollectionFirst.from_dict(ike_policy_connection_collection_first_model_json) - assert ike_policy_connection_collection_first_model != False - - # Construct a model instance of IKEPolicyConnectionCollectionFirst by calling from_dict on the json representation - ike_policy_connection_collection_first_model_dict = IKEPolicyConnectionCollectionFirst.from_dict(ike_policy_connection_collection_first_model_json).__dict__ - ike_policy_connection_collection_first_model2 = IKEPolicyConnectionCollectionFirst(**ike_policy_connection_collection_first_model_dict) - - # Verify the model instances are equivalent - assert ike_policy_connection_collection_first_model == ike_policy_connection_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - ike_policy_connection_collection_first_model_json2 = ike_policy_connection_collection_first_model.to_dict() - assert ike_policy_connection_collection_first_model_json2 == ike_policy_connection_collection_first_model_json - - -class TestModel_IKEPolicyConnectionCollectionNext: - """ - Test Class for IKEPolicyConnectionCollectionNext - """ - - def test_ike_policy_connection_collection_next_serialization(self): - """ - Test serialization/deserialization for IKEPolicyConnectionCollectionNext - """ - - # Construct a json representation of a IKEPolicyConnectionCollectionNext model - ike_policy_connection_collection_next_model_json = {} - ike_policy_connection_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/e98f46a3-1e4e-4195-b4e5-b8155192689d/connections?start=c6d339ad873241c4acc936dfcff3f6d2&limit=20' - - # Construct a model instance of IKEPolicyConnectionCollectionNext by calling from_dict on the json representation - ike_policy_connection_collection_next_model = IKEPolicyConnectionCollectionNext.from_dict(ike_policy_connection_collection_next_model_json) - assert ike_policy_connection_collection_next_model != False - - # Construct a model instance of IKEPolicyConnectionCollectionNext by calling from_dict on the json representation - ike_policy_connection_collection_next_model_dict = IKEPolicyConnectionCollectionNext.from_dict(ike_policy_connection_collection_next_model_json).__dict__ - ike_policy_connection_collection_next_model2 = IKEPolicyConnectionCollectionNext(**ike_policy_connection_collection_next_model_dict) - - # Verify the model instances are equivalent - assert ike_policy_connection_collection_next_model == ike_policy_connection_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - ike_policy_connection_collection_next_model_json2 = ike_policy_connection_collection_next_model.to_dict() - assert ike_policy_connection_collection_next_model_json2 == ike_policy_connection_collection_next_model_json - - class TestModel_IKEPolicyPatch: """ Test Class for IKEPolicyPatch @@ -56855,8 +60822,8 @@ def test_i_psec_policy_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - i_psec_policy_collection_first_model = {} # IPsecPolicyCollectionFirst - i_psec_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -56888,15 +60855,12 @@ def test_i_psec_policy_collection_serialization(self): i_psec_policy_model['resource_type'] = 'ipsec_policy' i_psec_policy_model['transform_protocol'] = 'esp' - i_psec_policy_collection_next_model = {} # IPsecPolicyCollectionNext - i_psec_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - # Construct a json representation of a IPsecPolicyCollection model i_psec_policy_collection_model_json = {} - i_psec_policy_collection_model_json['first'] = i_psec_policy_collection_first_model + i_psec_policy_collection_model_json['first'] = page_link_model i_psec_policy_collection_model_json['ipsec_policies'] = [i_psec_policy_model] i_psec_policy_collection_model_json['limit'] = 20 - i_psec_policy_collection_model_json['next'] = i_psec_policy_collection_next_model + i_psec_policy_collection_model_json['next'] = page_link_model i_psec_policy_collection_model_json['total_count'] = 132 # Construct a model instance of IPsecPolicyCollection by calling from_dict on the json representation @@ -56915,66 +60879,6 @@ def test_i_psec_policy_collection_serialization(self): assert i_psec_policy_collection_model_json2 == i_psec_policy_collection_model_json -class TestModel_IPsecPolicyCollectionFirst: - """ - Test Class for IPsecPolicyCollectionFirst - """ - - def test_i_psec_policy_collection_first_serialization(self): - """ - Test serialization/deserialization for IPsecPolicyCollectionFirst - """ - - # Construct a json representation of a IPsecPolicyCollectionFirst model - i_psec_policy_collection_first_model_json = {} - i_psec_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20' - - # Construct a model instance of IPsecPolicyCollectionFirst by calling from_dict on the json representation - i_psec_policy_collection_first_model = IPsecPolicyCollectionFirst.from_dict(i_psec_policy_collection_first_model_json) - assert i_psec_policy_collection_first_model != False - - # Construct a model instance of IPsecPolicyCollectionFirst by calling from_dict on the json representation - i_psec_policy_collection_first_model_dict = IPsecPolicyCollectionFirst.from_dict(i_psec_policy_collection_first_model_json).__dict__ - i_psec_policy_collection_first_model2 = IPsecPolicyCollectionFirst(**i_psec_policy_collection_first_model_dict) - - # Verify the model instances are equivalent - assert i_psec_policy_collection_first_model == i_psec_policy_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - i_psec_policy_collection_first_model_json2 = i_psec_policy_collection_first_model.to_dict() - assert i_psec_policy_collection_first_model_json2 == i_psec_policy_collection_first_model_json - - -class TestModel_IPsecPolicyCollectionNext: - """ - Test Class for IPsecPolicyCollectionNext - """ - - def test_i_psec_policy_collection_next_serialization(self): - """ - Test serialization/deserialization for IPsecPolicyCollectionNext - """ - - # Construct a json representation of a IPsecPolicyCollectionNext model - i_psec_policy_collection_next_model_json = {} - i_psec_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - - # Construct a model instance of IPsecPolicyCollectionNext by calling from_dict on the json representation - i_psec_policy_collection_next_model = IPsecPolicyCollectionNext.from_dict(i_psec_policy_collection_next_model_json) - assert i_psec_policy_collection_next_model != False - - # Construct a model instance of IPsecPolicyCollectionNext by calling from_dict on the json representation - i_psec_policy_collection_next_model_dict = IPsecPolicyCollectionNext.from_dict(i_psec_policy_collection_next_model_json).__dict__ - i_psec_policy_collection_next_model2 = IPsecPolicyCollectionNext(**i_psec_policy_collection_next_model_dict) - - # Verify the model instances are equivalent - assert i_psec_policy_collection_next_model == i_psec_policy_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - i_psec_policy_collection_next_model_json2 = i_psec_policy_collection_next_model.to_dict() - assert i_psec_policy_collection_next_model_json2 == i_psec_policy_collection_next_model_json - - class TestModel_IPsecPolicyConnectionCollection: """ Test Class for IPsecPolicyConnectionCollection @@ -57047,18 +60951,15 @@ def test_i_psec_policy_connection_collection_serialization(self): vpn_gateway_connection_model['local'] = vpn_gateway_connection_policy_mode_local_model vpn_gateway_connection_model['peer'] = vpn_gateway_connection_policy_mode_peer_model - i_psec_policy_connection_collection_first_model = {} # IPsecPolicyConnectionCollectionFirst - i_psec_policy_connection_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?limit=20' - - i_psec_policy_connection_collection_next_model = {} # IPsecPolicyConnectionCollectionNext - i_psec_policy_connection_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?start=250337b8fa72455c962e-c23e5706d452&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?limit=20' # Construct a json representation of a IPsecPolicyConnectionCollection model i_psec_policy_connection_collection_model_json = {} i_psec_policy_connection_collection_model_json['connections'] = [vpn_gateway_connection_model] - i_psec_policy_connection_collection_model_json['first'] = i_psec_policy_connection_collection_first_model + i_psec_policy_connection_collection_model_json['first'] = page_link_model i_psec_policy_connection_collection_model_json['limit'] = 20 - i_psec_policy_connection_collection_model_json['next'] = i_psec_policy_connection_collection_next_model + i_psec_policy_connection_collection_model_json['next'] = page_link_model i_psec_policy_connection_collection_model_json['total_count'] = 132 # Construct a model instance of IPsecPolicyConnectionCollection by calling from_dict on the json representation @@ -57077,66 +60978,6 @@ def test_i_psec_policy_connection_collection_serialization(self): assert i_psec_policy_connection_collection_model_json2 == i_psec_policy_connection_collection_model_json -class TestModel_IPsecPolicyConnectionCollectionFirst: - """ - Test Class for IPsecPolicyConnectionCollectionFirst - """ - - def test_i_psec_policy_connection_collection_first_serialization(self): - """ - Test serialization/deserialization for IPsecPolicyConnectionCollectionFirst - """ - - # Construct a json representation of a IPsecPolicyConnectionCollectionFirst model - i_psec_policy_connection_collection_first_model_json = {} - i_psec_policy_connection_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?limit=20' - - # Construct a model instance of IPsecPolicyConnectionCollectionFirst by calling from_dict on the json representation - i_psec_policy_connection_collection_first_model = IPsecPolicyConnectionCollectionFirst.from_dict(i_psec_policy_connection_collection_first_model_json) - assert i_psec_policy_connection_collection_first_model != False - - # Construct a model instance of IPsecPolicyConnectionCollectionFirst by calling from_dict on the json representation - i_psec_policy_connection_collection_first_model_dict = IPsecPolicyConnectionCollectionFirst.from_dict(i_psec_policy_connection_collection_first_model_json).__dict__ - i_psec_policy_connection_collection_first_model2 = IPsecPolicyConnectionCollectionFirst(**i_psec_policy_connection_collection_first_model_dict) - - # Verify the model instances are equivalent - assert i_psec_policy_connection_collection_first_model == i_psec_policy_connection_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - i_psec_policy_connection_collection_first_model_json2 = i_psec_policy_connection_collection_first_model.to_dict() - assert i_psec_policy_connection_collection_first_model_json2 == i_psec_policy_connection_collection_first_model_json - - -class TestModel_IPsecPolicyConnectionCollectionNext: - """ - Test Class for IPsecPolicyConnectionCollectionNext - """ - - def test_i_psec_policy_connection_collection_next_serialization(self): - """ - Test serialization/deserialization for IPsecPolicyConnectionCollectionNext - """ - - # Construct a json representation of a IPsecPolicyConnectionCollectionNext model - i_psec_policy_connection_collection_next_model_json = {} - i_psec_policy_connection_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?start=250337b8fa72455c962e-c23e5706d452&limit=20' - - # Construct a model instance of IPsecPolicyConnectionCollectionNext by calling from_dict on the json representation - i_psec_policy_connection_collection_next_model = IPsecPolicyConnectionCollectionNext.from_dict(i_psec_policy_connection_collection_next_model_json) - assert i_psec_policy_connection_collection_next_model != False - - # Construct a model instance of IPsecPolicyConnectionCollectionNext by calling from_dict on the json representation - i_psec_policy_connection_collection_next_model_dict = IPsecPolicyConnectionCollectionNext.from_dict(i_psec_policy_connection_collection_next_model_json).__dict__ - i_psec_policy_connection_collection_next_model2 = IPsecPolicyConnectionCollectionNext(**i_psec_policy_connection_collection_next_model_dict) - - # Verify the model instances are equivalent - assert i_psec_policy_connection_collection_next_model == i_psec_policy_connection_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - i_psec_policy_connection_collection_next_model_json2 = i_psec_policy_connection_collection_next_model.to_dict() - assert i_psec_policy_connection_collection_next_model_json2 == i_psec_policy_connection_collection_next_model_json - - class TestModel_IPsecPolicyPatch: """ Test Class for IPsecPolicyPatch @@ -57367,8 +61208,8 @@ def test_image_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - image_collection_first_model = {} # ImageCollectionFirst - image_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=50' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=50' catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' @@ -57450,15 +61291,12 @@ def test_image_collection_serialization(self): image_model['user_data_format'] = 'cloud_init' image_model['visibility'] = 'private' - image_collection_next_model = {} # ImageCollectionNext - image_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a ImageCollection model image_collection_model_json = {} - image_collection_model_json['first'] = image_collection_first_model + image_collection_model_json['first'] = page_link_model image_collection_model_json['images'] = [image_model] image_collection_model_json['limit'] = 20 - image_collection_model_json['next'] = image_collection_next_model + image_collection_model_json['next'] = page_link_model image_collection_model_json['total_count'] = 132 # Construct a model instance of ImageCollection by calling from_dict on the json representation @@ -57477,66 +61315,6 @@ def test_image_collection_serialization(self): assert image_collection_model_json2 == image_collection_model_json -class TestModel_ImageCollectionFirst: - """ - Test Class for ImageCollectionFirst - """ - - def test_image_collection_first_serialization(self): - """ - Test serialization/deserialization for ImageCollectionFirst - """ - - # Construct a json representation of a ImageCollectionFirst model - image_collection_first_model_json = {} - image_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20' - - # Construct a model instance of ImageCollectionFirst by calling from_dict on the json representation - image_collection_first_model = ImageCollectionFirst.from_dict(image_collection_first_model_json) - assert image_collection_first_model != False - - # Construct a model instance of ImageCollectionFirst by calling from_dict on the json representation - image_collection_first_model_dict = ImageCollectionFirst.from_dict(image_collection_first_model_json).__dict__ - image_collection_first_model2 = ImageCollectionFirst(**image_collection_first_model_dict) - - # Verify the model instances are equivalent - assert image_collection_first_model == image_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - image_collection_first_model_json2 = image_collection_first_model.to_dict() - assert image_collection_first_model_json2 == image_collection_first_model_json - - -class TestModel_ImageCollectionNext: - """ - Test Class for ImageCollectionNext - """ - - def test_image_collection_next_serialization(self): - """ - Test serialization/deserialization for ImageCollectionNext - """ - - # Construct a json representation of a ImageCollectionNext model - image_collection_next_model_json = {} - image_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of ImageCollectionNext by calling from_dict on the json representation - image_collection_next_model = ImageCollectionNext.from_dict(image_collection_next_model_json) - assert image_collection_next_model != False - - # Construct a model instance of ImageCollectionNext by calling from_dict on the json representation - image_collection_next_model_dict = ImageCollectionNext.from_dict(image_collection_next_model_json).__dict__ - image_collection_next_model2 = ImageCollectionNext(**image_collection_next_model_dict) - - # Verify the model instances are equivalent - assert image_collection_next_model == image_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - image_collection_next_model_json2 = image_collection_next_model.to_dict() - assert image_collection_next_model_json2 == image_collection_next_model_json - - class TestModel_ImageExportJob: """ Test Class for ImageExportJob @@ -57989,7 +61767,7 @@ def test_instance_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a-w8mw8' + volume_attachment_device_model['id'] = '0717-80b3e36e-41f4-40e9-bd56-beae81792a68-679qb' volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' @@ -58002,7 +61780,7 @@ def test_instance_serialization(self): volume_attachment_reference_instance_context_model = {} # VolumeAttachmentReferenceInstanceContext volume_attachment_reference_instance_context_model['deleted'] = deleted_model volume_attachment_reference_instance_context_model['device'] = volume_attachment_device_model - volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_instance_context_model['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_instance_context_model['name'] = 'my-volume-attachment' volume_attachment_reference_instance_context_model['volume'] = volume_reference_volume_attachment_context_model @@ -58018,6 +61796,20 @@ def test_instance_serialization(self): instance_catalog_offering_model['plan'] = catalog_offering_version_plan_reference_model instance_catalog_offering_model['version'] = catalog_offering_version_reference_model + cluster_network_reference_model = {} # ClusterNetworkReference + cluster_network_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model['deleted'] = deleted_model + cluster_network_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model['id'] = '0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model['name'] = 'my-cluster-network' + cluster_network_reference_model['resource_type'] = 'cluster_network' + + instance_cluster_network_attachment_reference_model = {} # InstanceClusterNetworkAttachmentReference + instance_cluster_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_reference_model['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_reference_model['name'] = 'my-instance-network-attachment' + instance_cluster_network_attachment_reference_model['resource_type'] = 'instance_cluster_network_attachment' + dedicated_host_reference_model = {} # DedicatedHostReference dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_reference_model['deleted'] = deleted_model @@ -58028,7 +61820,7 @@ def test_instance_serialization(self): instance_disk_model = {} # InstanceDisk instance_disk_model['created_at'] = '2019-01-01T12:00:00Z' - instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_model['interface_type'] = 'nvme' instance_disk_model['name'] = 'my-instance-disk' @@ -58078,9 +61870,9 @@ def test_instance_serialization(self): instance_metadata_service_model['response_hop_limit'] = 1 reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -58094,15 +61886,15 @@ def test_instance_serialization(self): subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' instance_network_attachment_reference_model = {} # InstanceNetworkAttachmentReference instance_network_attachment_reference_model['deleted'] = deleted_model - instance_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717-eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + instance_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_reference_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_reference_model['name'] = 'my-instance-network-attachment' instance_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model @@ -58112,8 +61904,8 @@ def test_instance_serialization(self): network_interface_instance_context_reference_model = {} # NetworkInterfaceInstanceContextReference network_interface_instance_context_reference_model['deleted'] = deleted_model - network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + network_interface_instance_context_reference_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' network_interface_instance_context_reference_model['name'] = 'my-instance-network-interface' network_interface_instance_context_reference_model['primary_ip'] = reserved_ip_reference_model network_interface_instance_context_reference_model['resource_type'] = 'network_interface' @@ -58133,10 +61925,10 @@ def test_instance_serialization(self): instance_profile_reference_model['resource_type'] = 'instance_profile' reservation_reference_model = {} # ReservationReference - reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_reference_model['deleted'] = deleted_model - reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63' - reservation_reference_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_reference_model['name'] = 'my-reservation' reservation_reference_model['resource_type'] = 'reservation' @@ -58177,17 +61969,19 @@ def test_instance_serialization(self): instance_model_json['bandwidth'] = 1000 instance_model_json['boot_volume_attachment'] = volume_attachment_reference_instance_context_model instance_model_json['catalog_offering'] = instance_catalog_offering_model + instance_model_json['cluster_network'] = cluster_network_reference_model + instance_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_reference_model] instance_model_json['confidential_compute_mode'] = 'disabled' instance_model_json['created_at'] = '2019-01-01T12:00:00Z' - instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_model_json['dedicated_host'] = dedicated_host_reference_model instance_model_json['disks'] = [instance_disk_model] instance_model_json['enable_secure_boot'] = True instance_model_json['gpu'] = instance_gpu_model instance_model_json['health_reasons'] = [instance_health_reason_model] instance_model_json['health_state'] = 'ok' - instance_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - instance_model_json['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + instance_model_json['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_model_json['image'] = image_reference_model instance_model_json['lifecycle_reasons'] = [instance_lifecycle_reason_model] instance_model_json['lifecycle_state'] = 'stable' @@ -58246,7 +62040,7 @@ def test_instance_action_serialization(self): instance_action_model_json['completed_at'] = '2019-01-01T12:00:00Z' instance_action_model_json['created_at'] = '2019-01-01T12:00:00Z' instance_action_model_json['force'] = True - instance_action_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed' + instance_action_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/actions/109a1b6e-1242-4de1-be44-38705e9474ed' instance_action_model_json['id'] = '109a1b6e-1242-4de1-be44-38705e9474ed' instance_action_model_json['started_at'] = '2019-01-01T12:00:00Z' instance_action_model_json['status'] = 'completed' @@ -58401,6 +62195,345 @@ def test_instance_catalog_offering_serialization(self): assert instance_catalog_offering_model_json2 == instance_catalog_offering_model_json +class TestModel_InstanceClusterNetworkAttachment: + """ + Test Class for InstanceClusterNetworkAttachment + """ + + def test_instance_cluster_network_attachment_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachment + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_cluster_network_attachment_before_model = {} # InstanceClusterNetworkAttachmentBefore + instance_cluster_network_attachment_before_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-a69563fa-0415-4d6e-aeb3-a3f14654bf90' + instance_cluster_network_attachment_before_model['id'] = '0717-a69563fa-0415-4d6e-aeb3-a3f14654bf90' + instance_cluster_network_attachment_before_model['name'] = 'other-instance-cluster-network-attachment' + instance_cluster_network_attachment_before_model['resource_type'] = 'instance_cluster_network_attachment' + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + cluster_network_subnet_reserved_ip_reference_model = {} # ClusterNetworkSubnetReservedIPReference + cluster_network_subnet_reserved_ip_reference_model['address'] = '10.1.0.6' + cluster_network_subnet_reserved_ip_reference_model['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['id'] = '63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['name'] = 'my-cluster-network-subnet-reserved-ip' + cluster_network_subnet_reserved_ip_reference_model['resource_type'] = 'cluster_network_subnet_reserved_ip' + + cluster_network_subnet_reference_model = {} # ClusterNetworkSubnetReference + cluster_network_subnet_reference_model['deleted'] = deleted_model + cluster_network_subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_reference_model['resource_type'] = 'cluster_network_subnet' + + cluster_network_interface_reference_model = {} # ClusterNetworkInterfaceReference + cluster_network_interface_reference_model['deleted'] = deleted_model + cluster_network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_reference_model['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_reference_model['name'] = 'my-cluster-network-interface' + cluster_network_interface_reference_model['primary_ip'] = cluster_network_subnet_reserved_ip_reference_model + cluster_network_interface_reference_model['resource_type'] = 'cluster_network_interface' + cluster_network_interface_reference_model['subnet'] = cluster_network_subnet_reference_model + + instance_cluster_network_attachment_lifecycle_reason_model = {} # InstanceClusterNetworkAttachmentLifecycleReason + instance_cluster_network_attachment_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + instance_cluster_network_attachment_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + instance_cluster_network_attachment_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + + # Construct a json representation of a InstanceClusterNetworkAttachment model + instance_cluster_network_attachment_model_json = {} + instance_cluster_network_attachment_model_json['before'] = instance_cluster_network_attachment_before_model + instance_cluster_network_attachment_model_json['cluster_network_interface'] = cluster_network_interface_reference_model + instance_cluster_network_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_model_json['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_model_json['lifecycle_reasons'] = [instance_cluster_network_attachment_lifecycle_reason_model] + instance_cluster_network_attachment_model_json['lifecycle_state'] = 'stable' + instance_cluster_network_attachment_model_json['name'] = 'my-instance-network-attachment' + instance_cluster_network_attachment_model_json['resource_type'] = 'instance_cluster_network_attachment' + + # Construct a model instance of InstanceClusterNetworkAttachment by calling from_dict on the json representation + instance_cluster_network_attachment_model = InstanceClusterNetworkAttachment.from_dict(instance_cluster_network_attachment_model_json) + assert instance_cluster_network_attachment_model != False + + # Construct a model instance of InstanceClusterNetworkAttachment by calling from_dict on the json representation + instance_cluster_network_attachment_model_dict = InstanceClusterNetworkAttachment.from_dict(instance_cluster_network_attachment_model_json).__dict__ + instance_cluster_network_attachment_model2 = InstanceClusterNetworkAttachment(**instance_cluster_network_attachment_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_model == instance_cluster_network_attachment_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_model_json2 = instance_cluster_network_attachment_model.to_dict() + assert instance_cluster_network_attachment_model_json2 == instance_cluster_network_attachment_model_json + + +class TestModel_InstanceClusterNetworkAttachmentBefore: + """ + Test Class for InstanceClusterNetworkAttachmentBefore + """ + + def test_instance_cluster_network_attachment_before_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentBefore + """ + + # Construct a json representation of a InstanceClusterNetworkAttachmentBefore model + instance_cluster_network_attachment_before_model_json = {} + instance_cluster_network_attachment_before_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_before_model_json['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_before_model_json['name'] = 'my-instance-network-attachment' + instance_cluster_network_attachment_before_model_json['resource_type'] = 'instance_cluster_network_attachment' + + # Construct a model instance of InstanceClusterNetworkAttachmentBefore by calling from_dict on the json representation + instance_cluster_network_attachment_before_model = InstanceClusterNetworkAttachmentBefore.from_dict(instance_cluster_network_attachment_before_model_json) + assert instance_cluster_network_attachment_before_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentBefore by calling from_dict on the json representation + instance_cluster_network_attachment_before_model_dict = InstanceClusterNetworkAttachmentBefore.from_dict(instance_cluster_network_attachment_before_model_json).__dict__ + instance_cluster_network_attachment_before_model2 = InstanceClusterNetworkAttachmentBefore(**instance_cluster_network_attachment_before_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_before_model == instance_cluster_network_attachment_before_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_before_model_json2 = instance_cluster_network_attachment_before_model.to_dict() + assert instance_cluster_network_attachment_before_model_json2 == instance_cluster_network_attachment_before_model_json + + +class TestModel_InstanceClusterNetworkAttachmentCollection: + """ + Test Class for InstanceClusterNetworkAttachmentCollection + """ + + def test_instance_cluster_network_attachment_collection_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + instance_cluster_network_attachment_before_model = {} # InstanceClusterNetworkAttachmentBefore + instance_cluster_network_attachment_before_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-a69563fa-0415-4d6e-aeb3-a3f14654bf90' + instance_cluster_network_attachment_before_model['id'] = '0717-a69563fa-0415-4d6e-aeb3-a3f14654bf90' + instance_cluster_network_attachment_before_model['name'] = 'other-instance-cluster-network-attachment' + instance_cluster_network_attachment_before_model['resource_type'] = 'instance_cluster_network_attachment' + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + cluster_network_subnet_reserved_ip_reference_model = {} # ClusterNetworkSubnetReservedIPReference + cluster_network_subnet_reserved_ip_reference_model['address'] = '10.1.0.6' + cluster_network_subnet_reserved_ip_reference_model['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['id'] = '63341ffa-1037-4b50-be40-676e3e9ac0c7' + cluster_network_subnet_reserved_ip_reference_model['name'] = 'my-cluster-network-subnet-reserved-ip' + cluster_network_subnet_reserved_ip_reference_model['resource_type'] = 'cluster_network_subnet_reserved_ip' + + cluster_network_subnet_reference_model = {} # ClusterNetworkSubnetReference + cluster_network_subnet_reference_model['deleted'] = deleted_model + cluster_network_subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + cluster_network_subnet_reference_model['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_reference_model['resource_type'] = 'cluster_network_subnet' + + cluster_network_interface_reference_model = {} # ClusterNetworkInterfaceReference + cluster_network_interface_reference_model['deleted'] = deleted_model + cluster_network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_reference_model['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_interface_reference_model['name'] = 'my-cluster-network-interface' + cluster_network_interface_reference_model['primary_ip'] = cluster_network_subnet_reserved_ip_reference_model + cluster_network_interface_reference_model['resource_type'] = 'cluster_network_interface' + cluster_network_interface_reference_model['subnet'] = cluster_network_subnet_reference_model + + instance_cluster_network_attachment_lifecycle_reason_model = {} # InstanceClusterNetworkAttachmentLifecycleReason + instance_cluster_network_attachment_lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + instance_cluster_network_attachment_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + instance_cluster_network_attachment_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + + instance_cluster_network_attachment_model = {} # InstanceClusterNetworkAttachment + instance_cluster_network_attachment_model['before'] = instance_cluster_network_attachment_before_model + instance_cluster_network_attachment_model['cluster_network_interface'] = cluster_network_interface_reference_model + instance_cluster_network_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_model['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_model['lifecycle_reasons'] = [instance_cluster_network_attachment_lifecycle_reason_model] + instance_cluster_network_attachment_model['lifecycle_state'] = 'stable' + instance_cluster_network_attachment_model['name'] = 'my-instance-cluster-network-attachment' + instance_cluster_network_attachment_model['resource_type'] = 'instance_cluster_network_attachment' + + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments?limit=20' + + # Construct a json representation of a InstanceClusterNetworkAttachmentCollection model + instance_cluster_network_attachment_collection_model_json = {} + instance_cluster_network_attachment_collection_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_model] + instance_cluster_network_attachment_collection_model_json['first'] = page_link_model + instance_cluster_network_attachment_collection_model_json['limit'] = 20 + instance_cluster_network_attachment_collection_model_json['next'] = page_link_model + instance_cluster_network_attachment_collection_model_json['total_count'] = 132 + + # Construct a model instance of InstanceClusterNetworkAttachmentCollection by calling from_dict on the json representation + instance_cluster_network_attachment_collection_model = InstanceClusterNetworkAttachmentCollection.from_dict(instance_cluster_network_attachment_collection_model_json) + assert instance_cluster_network_attachment_collection_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentCollection by calling from_dict on the json representation + instance_cluster_network_attachment_collection_model_dict = InstanceClusterNetworkAttachmentCollection.from_dict(instance_cluster_network_attachment_collection_model_json).__dict__ + instance_cluster_network_attachment_collection_model2 = InstanceClusterNetworkAttachmentCollection(**instance_cluster_network_attachment_collection_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_collection_model == instance_cluster_network_attachment_collection_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_collection_model_json2 = instance_cluster_network_attachment_collection_model.to_dict() + assert instance_cluster_network_attachment_collection_model_json2 == instance_cluster_network_attachment_collection_model_json + + +class TestModel_InstanceClusterNetworkAttachmentLifecycleReason: + """ + Test Class for InstanceClusterNetworkAttachmentLifecycleReason + """ + + def test_instance_cluster_network_attachment_lifecycle_reason_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentLifecycleReason + """ + + # Construct a json representation of a InstanceClusterNetworkAttachmentLifecycleReason model + instance_cluster_network_attachment_lifecycle_reason_model_json = {} + instance_cluster_network_attachment_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider' + instance_cluster_network_attachment_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + instance_cluster_network_attachment_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + + # Construct a model instance of InstanceClusterNetworkAttachmentLifecycleReason by calling from_dict on the json representation + instance_cluster_network_attachment_lifecycle_reason_model = InstanceClusterNetworkAttachmentLifecycleReason.from_dict(instance_cluster_network_attachment_lifecycle_reason_model_json) + assert instance_cluster_network_attachment_lifecycle_reason_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentLifecycleReason by calling from_dict on the json representation + instance_cluster_network_attachment_lifecycle_reason_model_dict = InstanceClusterNetworkAttachmentLifecycleReason.from_dict(instance_cluster_network_attachment_lifecycle_reason_model_json).__dict__ + instance_cluster_network_attachment_lifecycle_reason_model2 = InstanceClusterNetworkAttachmentLifecycleReason(**instance_cluster_network_attachment_lifecycle_reason_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_lifecycle_reason_model == instance_cluster_network_attachment_lifecycle_reason_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_lifecycle_reason_model_json2 = instance_cluster_network_attachment_lifecycle_reason_model.to_dict() + assert instance_cluster_network_attachment_lifecycle_reason_model_json2 == instance_cluster_network_attachment_lifecycle_reason_model_json + + +class TestModel_InstanceClusterNetworkAttachmentPatch: + """ + Test Class for InstanceClusterNetworkAttachmentPatch + """ + + def test_instance_cluster_network_attachment_patch_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentPatch + """ + + # Construct a json representation of a InstanceClusterNetworkAttachmentPatch model + instance_cluster_network_attachment_patch_model_json = {} + instance_cluster_network_attachment_patch_model_json['name'] = 'my-instance-network-attachment-updated' + + # Construct a model instance of InstanceClusterNetworkAttachmentPatch by calling from_dict on the json representation + instance_cluster_network_attachment_patch_model = InstanceClusterNetworkAttachmentPatch.from_dict(instance_cluster_network_attachment_patch_model_json) + assert instance_cluster_network_attachment_patch_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentPatch by calling from_dict on the json representation + instance_cluster_network_attachment_patch_model_dict = InstanceClusterNetworkAttachmentPatch.from_dict(instance_cluster_network_attachment_patch_model_json).__dict__ + instance_cluster_network_attachment_patch_model2 = InstanceClusterNetworkAttachmentPatch(**instance_cluster_network_attachment_patch_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_patch_model == instance_cluster_network_attachment_patch_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_patch_model_json2 = instance_cluster_network_attachment_patch_model.to_dict() + assert instance_cluster_network_attachment_patch_model_json2 == instance_cluster_network_attachment_patch_model_json + + +class TestModel_InstanceClusterNetworkAttachmentPrototypeInstanceContext: + """ + Test Class for InstanceClusterNetworkAttachmentPrototypeInstanceContext + """ + + def test_instance_cluster_network_attachment_prototype_instance_context_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentPrototypeInstanceContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + # Construct a json representation of a InstanceClusterNetworkAttachmentPrototypeInstanceContext model + instance_cluster_network_attachment_prototype_instance_context_model_json = {} + instance_cluster_network_attachment_prototype_instance_context_model_json['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model_json['name'] = 'my-instance-network-attachment' + + # Construct a model instance of InstanceClusterNetworkAttachmentPrototypeInstanceContext by calling from_dict on the json representation + instance_cluster_network_attachment_prototype_instance_context_model = InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(instance_cluster_network_attachment_prototype_instance_context_model_json) + assert instance_cluster_network_attachment_prototype_instance_context_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentPrototypeInstanceContext by calling from_dict on the json representation + instance_cluster_network_attachment_prototype_instance_context_model_dict = InstanceClusterNetworkAttachmentPrototypeInstanceContext.from_dict(instance_cluster_network_attachment_prototype_instance_context_model_json).__dict__ + instance_cluster_network_attachment_prototype_instance_context_model2 = InstanceClusterNetworkAttachmentPrototypeInstanceContext(**instance_cluster_network_attachment_prototype_instance_context_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_prototype_instance_context_model == instance_cluster_network_attachment_prototype_instance_context_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_prototype_instance_context_model_json2 = instance_cluster_network_attachment_prototype_instance_context_model.to_dict() + assert instance_cluster_network_attachment_prototype_instance_context_model_json2 == instance_cluster_network_attachment_prototype_instance_context_model_json + + +class TestModel_InstanceClusterNetworkAttachmentReference: + """ + Test Class for InstanceClusterNetworkAttachmentReference + """ + + def test_instance_cluster_network_attachment_reference_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentReference + """ + + # Construct a json representation of a InstanceClusterNetworkAttachmentReference model + instance_cluster_network_attachment_reference_model_json = {} + instance_cluster_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_reference_model_json['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_reference_model_json['name'] = 'my-instance-network-attachment' + instance_cluster_network_attachment_reference_model_json['resource_type'] = 'instance_cluster_network_attachment' + + # Construct a model instance of InstanceClusterNetworkAttachmentReference by calling from_dict on the json representation + instance_cluster_network_attachment_reference_model = InstanceClusterNetworkAttachmentReference.from_dict(instance_cluster_network_attachment_reference_model_json) + assert instance_cluster_network_attachment_reference_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentReference by calling from_dict on the json representation + instance_cluster_network_attachment_reference_model_dict = InstanceClusterNetworkAttachmentReference.from_dict(instance_cluster_network_attachment_reference_model_json).__dict__ + instance_cluster_network_attachment_reference_model2 = InstanceClusterNetworkAttachmentReference(**instance_cluster_network_attachment_reference_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_reference_model == instance_cluster_network_attachment_reference_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_reference_model_json2 = instance_cluster_network_attachment_reference_model.to_dict() + assert instance_cluster_network_attachment_reference_model_json2 == instance_cluster_network_attachment_reference_model_json + + class TestModel_InstanceCollection: """ Test Class for InstanceCollection @@ -58413,8 +62546,8 @@ def test_instance_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_collection_first_model = {} # InstanceCollectionFirst - instance_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20' instance_availability_policy_model = {} # InstanceAvailabilityPolicy instance_availability_policy_model['host_failure'] = 'restart' @@ -58423,7 +62556,7 @@ def test_instance_collection_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a-w8mw8' + volume_attachment_device_model['id'] = '0717-80b3e36e-41f4-40e9-bd56-beae81792a68-679qb' volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' @@ -58436,7 +62569,7 @@ def test_instance_collection_serialization(self): volume_attachment_reference_instance_context_model = {} # VolumeAttachmentReferenceInstanceContext volume_attachment_reference_instance_context_model['deleted'] = deleted_model volume_attachment_reference_instance_context_model['device'] = volume_attachment_device_model - volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_instance_context_model['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_instance_context_model['name'] = 'my-volume-attachment' volume_attachment_reference_instance_context_model['volume'] = volume_reference_volume_attachment_context_model @@ -58452,6 +62585,20 @@ def test_instance_collection_serialization(self): instance_catalog_offering_model['plan'] = catalog_offering_version_plan_reference_model instance_catalog_offering_model['version'] = catalog_offering_version_reference_model + cluster_network_reference_model = {} # ClusterNetworkReference + cluster_network_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model['deleted'] = deleted_model + cluster_network_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model['id'] = '0717-da0df18c-7598-4633-a648-fdaac28a5573' + cluster_network_reference_model['name'] = 'my-cluster-network' + cluster_network_reference_model['resource_type'] = 'cluster_network' + + instance_cluster_network_attachment_reference_model = {} # InstanceClusterNetworkAttachmentReference + instance_cluster_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_reference_model['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + instance_cluster_network_attachment_reference_model['name'] = 'my-instance-network-attachment' + instance_cluster_network_attachment_reference_model['resource_type'] = 'instance_cluster_network_attachment' + dedicated_host_reference_model = {} # DedicatedHostReference dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a' dedicated_host_reference_model['deleted'] = deleted_model @@ -58462,7 +62609,7 @@ def test_instance_collection_serialization(self): instance_disk_model = {} # InstanceDisk instance_disk_model['created_at'] = '2019-01-01T12:00:00Z' - instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_model['interface_type'] = 'nvme' instance_disk_model['name'] = 'my-instance-disk' @@ -58512,9 +62659,9 @@ def test_instance_collection_serialization(self): instance_metadata_service_model['response_hop_limit'] = 1 reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -58528,15 +62675,15 @@ def test_instance_collection_serialization(self): subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' instance_network_attachment_reference_model = {} # InstanceNetworkAttachmentReference instance_network_attachment_reference_model['deleted'] = deleted_model - instance_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717-eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + instance_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_reference_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_reference_model['name'] = 'my-instance-network-attachment' instance_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model @@ -58546,8 +62693,8 @@ def test_instance_collection_serialization(self): network_interface_instance_context_reference_model = {} # NetworkInterfaceInstanceContextReference network_interface_instance_context_reference_model['deleted'] = deleted_model - network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + network_interface_instance_context_reference_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' network_interface_instance_context_reference_model['name'] = 'my-instance-network-interface' network_interface_instance_context_reference_model['primary_ip'] = reserved_ip_reference_model network_interface_instance_context_reference_model['resource_type'] = 'network_interface' @@ -58567,10 +62714,10 @@ def test_instance_collection_serialization(self): instance_profile_reference_model['resource_type'] = 'instance_profile' reservation_reference_model = {} # ReservationReference - reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_reference_model['deleted'] = deleted_model - reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63' - reservation_reference_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_reference_model['name'] = 'my-reservation' reservation_reference_model['resource_type'] = 'reservation' @@ -58610,6 +62757,8 @@ def test_instance_collection_serialization(self): instance_model['bandwidth'] = 4000 instance_model['boot_volume_attachment'] = volume_attachment_reference_instance_context_model instance_model['catalog_offering'] = instance_catalog_offering_model + instance_model['cluster_network'] = cluster_network_reference_model + instance_model['cluster_network_attachments'] = [instance_cluster_network_attachment_reference_model] instance_model['confidential_compute_mode'] = 'sgx' instance_model['created_at'] = '2020-03-26T16:11:57Z' instance_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' @@ -58620,7 +62769,7 @@ def test_instance_collection_serialization(self): instance_model['health_reasons'] = [instance_health_reason_model] instance_model['health_state'] = 'ok' instance_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' - instance_model['id'] = 'eb1b7391-2ca2-4ab5-84a8-b92157a633b0' + instance_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_model['image'] = image_reference_model instance_model['lifecycle_reasons'] = [instance_lifecycle_reason_model] instance_model['lifecycle_state'] = 'stable' @@ -58648,15 +62797,12 @@ def test_instance_collection_serialization(self): instance_model['vpc'] = vpc_reference_model instance_model['zone'] = zone_reference_model - instance_collection_next_model = {} # InstanceCollectionNext - instance_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a InstanceCollection model instance_collection_model_json = {} - instance_collection_model_json['first'] = instance_collection_first_model + instance_collection_model_json['first'] = page_link_model instance_collection_model_json['instances'] = [instance_model] instance_collection_model_json['limit'] = 20 - instance_collection_model_json['next'] = instance_collection_next_model + instance_collection_model_json['next'] = page_link_model instance_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceCollection by calling from_dict on the json representation @@ -58675,66 +62821,6 @@ def test_instance_collection_serialization(self): assert instance_collection_model_json2 == instance_collection_model_json -class TestModel_InstanceCollectionFirst: - """ - Test Class for InstanceCollectionFirst - """ - - def test_instance_collection_first_serialization(self): - """ - Test serialization/deserialization for InstanceCollectionFirst - """ - - # Construct a json representation of a InstanceCollectionFirst model - instance_collection_first_model_json = {} - instance_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20' - - # Construct a model instance of InstanceCollectionFirst by calling from_dict on the json representation - instance_collection_first_model = InstanceCollectionFirst.from_dict(instance_collection_first_model_json) - assert instance_collection_first_model != False - - # Construct a model instance of InstanceCollectionFirst by calling from_dict on the json representation - instance_collection_first_model_dict = InstanceCollectionFirst.from_dict(instance_collection_first_model_json).__dict__ - instance_collection_first_model2 = InstanceCollectionFirst(**instance_collection_first_model_dict) - - # Verify the model instances are equivalent - assert instance_collection_first_model == instance_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - instance_collection_first_model_json2 = instance_collection_first_model.to_dict() - assert instance_collection_first_model_json2 == instance_collection_first_model_json - - -class TestModel_InstanceCollectionNext: - """ - Test Class for InstanceCollectionNext - """ - - def test_instance_collection_next_serialization(self): - """ - Test serialization/deserialization for InstanceCollectionNext - """ - - # Construct a json representation of a InstanceCollectionNext model - instance_collection_next_model_json = {} - instance_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of InstanceCollectionNext by calling from_dict on the json representation - instance_collection_next_model = InstanceCollectionNext.from_dict(instance_collection_next_model_json) - assert instance_collection_next_model != False - - # Construct a model instance of InstanceCollectionNext by calling from_dict on the json representation - instance_collection_next_model_dict = InstanceCollectionNext.from_dict(instance_collection_next_model_json).__dict__ - instance_collection_next_model2 = InstanceCollectionNext(**instance_collection_next_model_dict) - - # Verify the model instances are equivalent - assert instance_collection_next_model == instance_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - instance_collection_next_model_json2 = instance_collection_next_model.to_dict() - assert instance_collection_next_model_json2 == instance_collection_next_model_json - - class TestModel_InstanceConsoleAccessToken: """ Test Class for InstanceConsoleAccessToken @@ -58752,7 +62838,7 @@ def test_instance_console_access_token_serialization(self): instance_console_access_token_model_json['created_at'] = '2020-07-27T21:50:14Z' instance_console_access_token_model_json['expires_at'] = '2020-07-27T21:51:14Z' instance_console_access_token_model_json['force'] = False - instance_console_access_token_model_json['href'] = 'wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI' + instance_console_access_token_model_json['href'] = 'wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI' # Construct a model instance of InstanceConsoleAccessToken by calling from_dict on the json representation instance_console_access_token_model = InstanceConsoleAccessToken.from_dict(instance_console_access_token_model_json) @@ -58782,7 +62868,7 @@ def test_instance_default_trusted_profile_prototype_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' # Construct a json representation of a InstanceDefaultTrustedProfilePrototype model @@ -58819,7 +62905,7 @@ def test_instance_disk_serialization(self): # Construct a json representation of a InstanceDisk model instance_disk_model_json = {} instance_disk_model_json['created_at'] = '2019-01-01T12:00:00Z' - instance_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_model_json['interface_type'] = 'nvme' instance_disk_model_json['name'] = 'my-instance-disk' @@ -58856,7 +62942,7 @@ def test_instance_disk_collection_serialization(self): instance_disk_model = {} # InstanceDisk instance_disk_model['created_at'] = '2019-01-01T12:00:00Z' - instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_model['interface_type'] = 'nvme' instance_disk_model['name'] = 'my-instance-disk' @@ -58931,7 +63017,7 @@ def test_instance_disk_reference_serialization(self): # Construct a json representation of a InstanceDiskReference model instance_disk_reference_model_json = {} instance_disk_reference_model_json['deleted'] = deleted_model - instance_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + instance_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' instance_disk_reference_model_json['name'] = 'my-instance-disk' instance_disk_reference_model_json['resource_type'] = 'instance_disk' @@ -59093,8 +63179,8 @@ def test_instance_group_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_collection_first_model = {} # InstanceGroupCollectionFirst - instance_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -59163,15 +63249,12 @@ def test_instance_group_collection_serialization(self): instance_group_model['updated_at'] = '2019-01-01T12:00:00Z' instance_group_model['vpc'] = vpc_reference_model - instance_group_collection_next_model = {} # InstanceGroupCollectionNext - instance_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a InstanceGroupCollection model instance_group_collection_model_json = {} - instance_group_collection_model_json['first'] = instance_group_collection_first_model + instance_group_collection_model_json['first'] = page_link_model instance_group_collection_model_json['instance_groups'] = [instance_group_model] instance_group_collection_model_json['limit'] = 20 - instance_group_collection_model_json['next'] = instance_group_collection_next_model + instance_group_collection_model_json['next'] = page_link_model instance_group_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceGroupCollection by calling from_dict on the json representation @@ -59190,66 +63273,6 @@ def test_instance_group_collection_serialization(self): assert instance_group_collection_model_json2 == instance_group_collection_model_json -class TestModel_InstanceGroupCollectionFirst: - """ - Test Class for InstanceGroupCollectionFirst - """ - - def test_instance_group_collection_first_serialization(self): - """ - Test serialization/deserialization for InstanceGroupCollectionFirst - """ - - # Construct a json representation of a InstanceGroupCollectionFirst model - instance_group_collection_first_model_json = {} - instance_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20' - - # Construct a model instance of InstanceGroupCollectionFirst by calling from_dict on the json representation - instance_group_collection_first_model = InstanceGroupCollectionFirst.from_dict(instance_group_collection_first_model_json) - assert instance_group_collection_first_model != False - - # Construct a model instance of InstanceGroupCollectionFirst by calling from_dict on the json representation - instance_group_collection_first_model_dict = InstanceGroupCollectionFirst.from_dict(instance_group_collection_first_model_json).__dict__ - instance_group_collection_first_model2 = InstanceGroupCollectionFirst(**instance_group_collection_first_model_dict) - - # Verify the model instances are equivalent - assert instance_group_collection_first_model == instance_group_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_collection_first_model_json2 = instance_group_collection_first_model.to_dict() - assert instance_group_collection_first_model_json2 == instance_group_collection_first_model_json - - -class TestModel_InstanceGroupCollectionNext: - """ - Test Class for InstanceGroupCollectionNext - """ - - def test_instance_group_collection_next_serialization(self): - """ - Test serialization/deserialization for InstanceGroupCollectionNext - """ - - # Construct a json representation of a InstanceGroupCollectionNext model - instance_group_collection_next_model_json = {} - instance_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of InstanceGroupCollectionNext by calling from_dict on the json representation - instance_group_collection_next_model = InstanceGroupCollectionNext.from_dict(instance_group_collection_next_model_json) - assert instance_group_collection_next_model != False - - # Construct a model instance of InstanceGroupCollectionNext by calling from_dict on the json representation - instance_group_collection_next_model_dict = InstanceGroupCollectionNext.from_dict(instance_group_collection_next_model_json).__dict__ - instance_group_collection_next_model2 = InstanceGroupCollectionNext(**instance_group_collection_next_model_dict) - - # Verify the model instances are equivalent - assert instance_group_collection_next_model == instance_group_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_collection_next_model_json2 = instance_group_collection_next_model.to_dict() - assert instance_group_collection_next_model_json2 == instance_group_collection_next_model_json - - class TestModel_InstanceGroupLifecycleReason: """ Test Class for InstanceGroupLifecycleReason @@ -59458,18 +63481,15 @@ def test_instance_group_manager_actions_collection_serialization(self): instance_group_manager_action_model['next_run_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_model['group'] = instance_group_manager_scheduled_action_group_model - instance_group_manager_actions_collection_first_model = {} # InstanceGroupManagerActionsCollectionFirst - instance_group_manager_actions_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20' - - instance_group_manager_actions_collection_next_model = {} # InstanceGroupManagerActionsCollectionNext - instance_group_manager_actions_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20' # Construct a json representation of a InstanceGroupManagerActionsCollection model instance_group_manager_actions_collection_model_json = {} instance_group_manager_actions_collection_model_json['actions'] = [instance_group_manager_action_model] - instance_group_manager_actions_collection_model_json['first'] = instance_group_manager_actions_collection_first_model + instance_group_manager_actions_collection_model_json['first'] = page_link_model instance_group_manager_actions_collection_model_json['limit'] = 20 - instance_group_manager_actions_collection_model_json['next'] = instance_group_manager_actions_collection_next_model + instance_group_manager_actions_collection_model_json['next'] = page_link_model instance_group_manager_actions_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceGroupManagerActionsCollection by calling from_dict on the json representation @@ -59488,66 +63508,6 @@ def test_instance_group_manager_actions_collection_serialization(self): assert instance_group_manager_actions_collection_model_json2 == instance_group_manager_actions_collection_model_json -class TestModel_InstanceGroupManagerActionsCollectionFirst: - """ - Test Class for InstanceGroupManagerActionsCollectionFirst - """ - - def test_instance_group_manager_actions_collection_first_serialization(self): - """ - Test serialization/deserialization for InstanceGroupManagerActionsCollectionFirst - """ - - # Construct a json representation of a InstanceGroupManagerActionsCollectionFirst model - instance_group_manager_actions_collection_first_model_json = {} - instance_group_manager_actions_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20' - - # Construct a model instance of InstanceGroupManagerActionsCollectionFirst by calling from_dict on the json representation - instance_group_manager_actions_collection_first_model = InstanceGroupManagerActionsCollectionFirst.from_dict(instance_group_manager_actions_collection_first_model_json) - assert instance_group_manager_actions_collection_first_model != False - - # Construct a model instance of InstanceGroupManagerActionsCollectionFirst by calling from_dict on the json representation - instance_group_manager_actions_collection_first_model_dict = InstanceGroupManagerActionsCollectionFirst.from_dict(instance_group_manager_actions_collection_first_model_json).__dict__ - instance_group_manager_actions_collection_first_model2 = InstanceGroupManagerActionsCollectionFirst(**instance_group_manager_actions_collection_first_model_dict) - - # Verify the model instances are equivalent - assert instance_group_manager_actions_collection_first_model == instance_group_manager_actions_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_manager_actions_collection_first_model_json2 = instance_group_manager_actions_collection_first_model.to_dict() - assert instance_group_manager_actions_collection_first_model_json2 == instance_group_manager_actions_collection_first_model_json - - -class TestModel_InstanceGroupManagerActionsCollectionNext: - """ - Test Class for InstanceGroupManagerActionsCollectionNext - """ - - def test_instance_group_manager_actions_collection_next_serialization(self): - """ - Test serialization/deserialization for InstanceGroupManagerActionsCollectionNext - """ - - # Construct a json representation of a InstanceGroupManagerActionsCollectionNext model - instance_group_manager_actions_collection_next_model_json = {} - instance_group_manager_actions_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of InstanceGroupManagerActionsCollectionNext by calling from_dict on the json representation - instance_group_manager_actions_collection_next_model = InstanceGroupManagerActionsCollectionNext.from_dict(instance_group_manager_actions_collection_next_model_json) - assert instance_group_manager_actions_collection_next_model != False - - # Construct a model instance of InstanceGroupManagerActionsCollectionNext by calling from_dict on the json representation - instance_group_manager_actions_collection_next_model_dict = InstanceGroupManagerActionsCollectionNext.from_dict(instance_group_manager_actions_collection_next_model_json).__dict__ - instance_group_manager_actions_collection_next_model2 = InstanceGroupManagerActionsCollectionNext(**instance_group_manager_actions_collection_next_model_dict) - - # Verify the model instances are equivalent - assert instance_group_manager_actions_collection_next_model == instance_group_manager_actions_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_manager_actions_collection_next_model_json2 = instance_group_manager_actions_collection_next_model.to_dict() - assert instance_group_manager_actions_collection_next_model_json2 == instance_group_manager_actions_collection_next_model_json - - class TestModel_InstanceGroupManagerCollection: """ Test Class for InstanceGroupManagerCollection @@ -59560,8 +63520,8 @@ def test_instance_group_manager_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_manager_collection_first_model = {} # InstanceGroupManagerCollectionFirst - instance_group_manager_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -59586,15 +63546,12 @@ def test_instance_group_manager_collection_serialization(self): instance_group_manager_model['min_membership_count'] = 10 instance_group_manager_model['policies'] = [instance_group_manager_policy_reference_model] - instance_group_manager_collection_next_model = {} # InstanceGroupManagerCollectionNext - instance_group_manager_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a InstanceGroupManagerCollection model instance_group_manager_collection_model_json = {} - instance_group_manager_collection_model_json['first'] = instance_group_manager_collection_first_model + instance_group_manager_collection_model_json['first'] = page_link_model instance_group_manager_collection_model_json['limit'] = 20 instance_group_manager_collection_model_json['managers'] = [instance_group_manager_model] - instance_group_manager_collection_model_json['next'] = instance_group_manager_collection_next_model + instance_group_manager_collection_model_json['next'] = page_link_model instance_group_manager_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceGroupManagerCollection by calling from_dict on the json representation @@ -59613,66 +63570,6 @@ def test_instance_group_manager_collection_serialization(self): assert instance_group_manager_collection_model_json2 == instance_group_manager_collection_model_json -class TestModel_InstanceGroupManagerCollectionFirst: - """ - Test Class for InstanceGroupManagerCollectionFirst - """ - - def test_instance_group_manager_collection_first_serialization(self): - """ - Test serialization/deserialization for InstanceGroupManagerCollectionFirst - """ - - # Construct a json representation of a InstanceGroupManagerCollectionFirst model - instance_group_manager_collection_first_model_json = {} - instance_group_manager_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20' - - # Construct a model instance of InstanceGroupManagerCollectionFirst by calling from_dict on the json representation - instance_group_manager_collection_first_model = InstanceGroupManagerCollectionFirst.from_dict(instance_group_manager_collection_first_model_json) - assert instance_group_manager_collection_first_model != False - - # Construct a model instance of InstanceGroupManagerCollectionFirst by calling from_dict on the json representation - instance_group_manager_collection_first_model_dict = InstanceGroupManagerCollectionFirst.from_dict(instance_group_manager_collection_first_model_json).__dict__ - instance_group_manager_collection_first_model2 = InstanceGroupManagerCollectionFirst(**instance_group_manager_collection_first_model_dict) - - # Verify the model instances are equivalent - assert instance_group_manager_collection_first_model == instance_group_manager_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_manager_collection_first_model_json2 = instance_group_manager_collection_first_model.to_dict() - assert instance_group_manager_collection_first_model_json2 == instance_group_manager_collection_first_model_json - - -class TestModel_InstanceGroupManagerCollectionNext: - """ - Test Class for InstanceGroupManagerCollectionNext - """ - - def test_instance_group_manager_collection_next_serialization(self): - """ - Test serialization/deserialization for InstanceGroupManagerCollectionNext - """ - - # Construct a json representation of a InstanceGroupManagerCollectionNext model - instance_group_manager_collection_next_model_json = {} - instance_group_manager_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of InstanceGroupManagerCollectionNext by calling from_dict on the json representation - instance_group_manager_collection_next_model = InstanceGroupManagerCollectionNext.from_dict(instance_group_manager_collection_next_model_json) - assert instance_group_manager_collection_next_model != False - - # Construct a model instance of InstanceGroupManagerCollectionNext by calling from_dict on the json representation - instance_group_manager_collection_next_model_dict = InstanceGroupManagerCollectionNext.from_dict(instance_group_manager_collection_next_model_json).__dict__ - instance_group_manager_collection_next_model2 = InstanceGroupManagerCollectionNext(**instance_group_manager_collection_next_model_dict) - - # Verify the model instances are equivalent - assert instance_group_manager_collection_next_model == instance_group_manager_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_manager_collection_next_model_json2 = instance_group_manager_collection_next_model.to_dict() - assert instance_group_manager_collection_next_model_json2 == instance_group_manager_collection_next_model_json - - class TestModel_InstanceGroupManagerPatch: """ Test Class for InstanceGroupManagerPatch @@ -59720,11 +63617,8 @@ def test_instance_group_manager_policy_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_manager_policy_collection_first_model = {} # InstanceGroupManagerPolicyCollectionFirst - instance_group_manager_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20' - - instance_group_manager_policy_collection_next_model = {} # InstanceGroupManagerPolicyCollectionNext - instance_group_manager_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20' instance_group_manager_policy_model = {} # InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy instance_group_manager_policy_model['created_at'] = '2019-01-01T12:00:00Z' @@ -59738,9 +63632,9 @@ def test_instance_group_manager_policy_collection_serialization(self): # Construct a json representation of a InstanceGroupManagerPolicyCollection model instance_group_manager_policy_collection_model_json = {} - instance_group_manager_policy_collection_model_json['first'] = instance_group_manager_policy_collection_first_model + instance_group_manager_policy_collection_model_json['first'] = page_link_model instance_group_manager_policy_collection_model_json['limit'] = 20 - instance_group_manager_policy_collection_model_json['next'] = instance_group_manager_policy_collection_next_model + instance_group_manager_policy_collection_model_json['next'] = page_link_model instance_group_manager_policy_collection_model_json['policies'] = [instance_group_manager_policy_model] instance_group_manager_policy_collection_model_json['total_count'] = 132 @@ -59760,66 +63654,6 @@ def test_instance_group_manager_policy_collection_serialization(self): assert instance_group_manager_policy_collection_model_json2 == instance_group_manager_policy_collection_model_json -class TestModel_InstanceGroupManagerPolicyCollectionFirst: - """ - Test Class for InstanceGroupManagerPolicyCollectionFirst - """ - - def test_instance_group_manager_policy_collection_first_serialization(self): - """ - Test serialization/deserialization for InstanceGroupManagerPolicyCollectionFirst - """ - - # Construct a json representation of a InstanceGroupManagerPolicyCollectionFirst model - instance_group_manager_policy_collection_first_model_json = {} - instance_group_manager_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20' - - # Construct a model instance of InstanceGroupManagerPolicyCollectionFirst by calling from_dict on the json representation - instance_group_manager_policy_collection_first_model = InstanceGroupManagerPolicyCollectionFirst.from_dict(instance_group_manager_policy_collection_first_model_json) - assert instance_group_manager_policy_collection_first_model != False - - # Construct a model instance of InstanceGroupManagerPolicyCollectionFirst by calling from_dict on the json representation - instance_group_manager_policy_collection_first_model_dict = InstanceGroupManagerPolicyCollectionFirst.from_dict(instance_group_manager_policy_collection_first_model_json).__dict__ - instance_group_manager_policy_collection_first_model2 = InstanceGroupManagerPolicyCollectionFirst(**instance_group_manager_policy_collection_first_model_dict) - - # Verify the model instances are equivalent - assert instance_group_manager_policy_collection_first_model == instance_group_manager_policy_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_collection_first_model_json2 = instance_group_manager_policy_collection_first_model.to_dict() - assert instance_group_manager_policy_collection_first_model_json2 == instance_group_manager_policy_collection_first_model_json - - -class TestModel_InstanceGroupManagerPolicyCollectionNext: - """ - Test Class for InstanceGroupManagerPolicyCollectionNext - """ - - def test_instance_group_manager_policy_collection_next_serialization(self): - """ - Test serialization/deserialization for InstanceGroupManagerPolicyCollectionNext - """ - - # Construct a json representation of a InstanceGroupManagerPolicyCollectionNext model - instance_group_manager_policy_collection_next_model_json = {} - instance_group_manager_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of InstanceGroupManagerPolicyCollectionNext by calling from_dict on the json representation - instance_group_manager_policy_collection_next_model = InstanceGroupManagerPolicyCollectionNext.from_dict(instance_group_manager_policy_collection_next_model_json) - assert instance_group_manager_policy_collection_next_model != False - - # Construct a model instance of InstanceGroupManagerPolicyCollectionNext by calling from_dict on the json representation - instance_group_manager_policy_collection_next_model_dict = InstanceGroupManagerPolicyCollectionNext.from_dict(instance_group_manager_policy_collection_next_model_json).__dict__ - instance_group_manager_policy_collection_next_model2 = InstanceGroupManagerPolicyCollectionNext(**instance_group_manager_policy_collection_next_model_dict) - - # Verify the model instances are equivalent - assert instance_group_manager_policy_collection_next_model == instance_group_manager_policy_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_manager_policy_collection_next_model_json2 = instance_group_manager_policy_collection_next_model.to_dict() - assert instance_group_manager_policy_collection_next_model_json2 == instance_group_manager_policy_collection_next_model_json - - class TestModel_InstanceGroupManagerPolicyPatch: """ Test Class for InstanceGroupManagerPolicyPatch @@ -60004,10 +63838,10 @@ def test_instance_group_membership_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' instance_reference_model = {} # InstanceReference - instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model['deleted'] = deleted_model - instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - instance_reference_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + instance_reference_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model['name'] = 'my-instance' instance_template_reference_model = {} # InstanceTemplateReference @@ -60063,17 +63897,17 @@ def test_instance_group_membership_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_group_membership_collection_first_model = {} # InstanceGroupMembershipCollectionFirst - instance_group_membership_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' instance_reference_model = {} # InstanceReference - instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model['deleted'] = deleted_model - instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - instance_reference_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + instance_reference_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model['name'] = 'my-instance' instance_template_reference_model = {} # InstanceTemplateReference @@ -60100,15 +63934,12 @@ def test_instance_group_membership_collection_serialization(self): instance_group_membership_model['status'] = 'deleting' instance_group_membership_model['updated_at'] = '2019-01-01T12:00:00Z' - instance_group_membership_collection_next_model = {} # InstanceGroupMembershipCollectionNext - instance_group_membership_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a InstanceGroupMembershipCollection model instance_group_membership_collection_model_json = {} - instance_group_membership_collection_model_json['first'] = instance_group_membership_collection_first_model + instance_group_membership_collection_model_json['first'] = page_link_model instance_group_membership_collection_model_json['limit'] = 20 instance_group_membership_collection_model_json['memberships'] = [instance_group_membership_model] - instance_group_membership_collection_model_json['next'] = instance_group_membership_collection_next_model + instance_group_membership_collection_model_json['next'] = page_link_model instance_group_membership_collection_model_json['total_count'] = 132 # Construct a model instance of InstanceGroupMembershipCollection by calling from_dict on the json representation @@ -60127,66 +63958,6 @@ def test_instance_group_membership_collection_serialization(self): assert instance_group_membership_collection_model_json2 == instance_group_membership_collection_model_json -class TestModel_InstanceGroupMembershipCollectionFirst: - """ - Test Class for InstanceGroupMembershipCollectionFirst - """ - - def test_instance_group_membership_collection_first_serialization(self): - """ - Test serialization/deserialization for InstanceGroupMembershipCollectionFirst - """ - - # Construct a json representation of a InstanceGroupMembershipCollectionFirst model - instance_group_membership_collection_first_model_json = {} - instance_group_membership_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20' - - # Construct a model instance of InstanceGroupMembershipCollectionFirst by calling from_dict on the json representation - instance_group_membership_collection_first_model = InstanceGroupMembershipCollectionFirst.from_dict(instance_group_membership_collection_first_model_json) - assert instance_group_membership_collection_first_model != False - - # Construct a model instance of InstanceGroupMembershipCollectionFirst by calling from_dict on the json representation - instance_group_membership_collection_first_model_dict = InstanceGroupMembershipCollectionFirst.from_dict(instance_group_membership_collection_first_model_json).__dict__ - instance_group_membership_collection_first_model2 = InstanceGroupMembershipCollectionFirst(**instance_group_membership_collection_first_model_dict) - - # Verify the model instances are equivalent - assert instance_group_membership_collection_first_model == instance_group_membership_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_membership_collection_first_model_json2 = instance_group_membership_collection_first_model.to_dict() - assert instance_group_membership_collection_first_model_json2 == instance_group_membership_collection_first_model_json - - -class TestModel_InstanceGroupMembershipCollectionNext: - """ - Test Class for InstanceGroupMembershipCollectionNext - """ - - def test_instance_group_membership_collection_next_serialization(self): - """ - Test serialization/deserialization for InstanceGroupMembershipCollectionNext - """ - - # Construct a json representation of a InstanceGroupMembershipCollectionNext model - instance_group_membership_collection_next_model_json = {} - instance_group_membership_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of InstanceGroupMembershipCollectionNext by calling from_dict on the json representation - instance_group_membership_collection_next_model = InstanceGroupMembershipCollectionNext.from_dict(instance_group_membership_collection_next_model_json) - assert instance_group_membership_collection_next_model != False - - # Construct a model instance of InstanceGroupMembershipCollectionNext by calling from_dict on the json representation - instance_group_membership_collection_next_model_dict = InstanceGroupMembershipCollectionNext.from_dict(instance_group_membership_collection_next_model_json).__dict__ - instance_group_membership_collection_next_model2 = InstanceGroupMembershipCollectionNext(**instance_group_membership_collection_next_model_dict) - - # Verify the model instances are equivalent - assert instance_group_membership_collection_next_model == instance_group_membership_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - instance_group_membership_collection_next_model_json2 = instance_group_membership_collection_next_model.to_dict() - assert instance_group_membership_collection_next_model_json2 == instance_group_membership_collection_next_model_json - - class TestModel_InstanceGroupMembershipPatch: """ Test Class for InstanceGroupMembershipPatch @@ -60352,7 +64123,7 @@ def test_instance_initialization_serialization(self): # Construct dict forms of any model objects needed in order to build this model. trusted_profile_reference_model = {} # TrustedProfileReference - trusted_profile_reference_model['crn'] = 'crn:[...]' + trusted_profile_reference_model['crn'] = 'crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' trusted_profile_reference_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' trusted_profile_reference_model['resource_type'] = 'trusted_profile' @@ -60364,11 +64135,11 @@ def test_instance_initialization_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' key_reference_model = {} # KeyReference - key_reference_model['crn'] = 'crn:[...]' + key_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_reference_model['deleted'] = deleted_model key_reference_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E' - key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' - key_reference_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['id'] = 'r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_reference_model['name'] = 'my-key-1' key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint @@ -60618,32 +64389,32 @@ def test_instance_network_attachment_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.0.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5/reserved_ips/5e2c7f65-6393-4345-a5b7-3d13242ae68d' - reserved_ip_reference_model['id'] = '5e2c7f65-6393-4345-a5b7-3d13242ae68d' - reserved_ip_reference_model['name'] = 'my-reserved-ip-1' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:[...]' + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' - subnet_reference_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:[...]' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-54eb57ee-86f2-4796-90bb-d7874e0831ef' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' # Construct a json representation of a InstanceNetworkAttachment model instance_network_attachment_model_json = {} instance_network_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z' - instance_network_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + instance_network_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_model_json['lifecycle_state'] = 'stable' instance_network_attachment_model_json['name'] = 'my-instance-network-attachment' @@ -60686,32 +64457,32 @@ def test_instance_network_attachment_collection_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.0.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5/reserved_ips/5e2c7f65-6393-4345-a5b7-3d13242ae68d' - reserved_ip_reference_model['id'] = '5e2c7f65-6393-4345-a5b7-3d13242ae68d' - reserved_ip_reference_model['name'] = 'my-reserved-ip-1' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:[...]' + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' - subnet_reference_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:[...]' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-54eb57ee-86f2-4796-90bb-d7874e0831ef' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' instance_network_attachment_model = {} # InstanceNetworkAttachment instance_network_attachment_model['created_at'] = '2023-09-30T23:42:32.993000Z' - instance_network_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/123a490a-9e64-4254-a93b-9a3af3ede270/network_attachments/2be851a6-930e-4724-980d-f03e31b00295' - instance_network_attachment_model['id'] = '2be851a6-930e-4724-980d-f03e31b00295' + instance_network_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + instance_network_attachment_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_model['lifecycle_state'] = 'stable' instance_network_attachment_model['name'] = 'my-instance-network-attachment' instance_network_attachment_model['port_speed'] = 1000 @@ -60797,7 +64568,7 @@ def test_instance_network_attachment_prototype_serialization(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -60851,9 +64622,9 @@ def test_instance_network_attachment_reference_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -60867,16 +64638,16 @@ def test_instance_network_attachment_reference_serialization(self): subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' # Construct a json representation of a InstanceNetworkAttachmentReference model instance_network_attachment_reference_model_json = {} instance_network_attachment_reference_model_json['deleted'] = deleted_model - instance_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + instance_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_reference_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' instance_network_attachment_reference_model_json['name'] = 'my-instance-network-attachment' instance_network_attachment_reference_model_json['primary_ip'] = reserved_ip_reference_model @@ -60927,7 +64698,7 @@ def test_instance_patch_serialization(self): instance_patch_profile_model['name'] = 'bx2-4x16' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_patch_model = {} # InstanceReservationAffinityPatch instance_reservation_affinity_patch_model['policy'] = 'disabled' @@ -60977,6 +64748,9 @@ def test_instance_profile_serialization(self): instance_profile_bandwidth_model['type'] = 'fixed' instance_profile_bandwidth_model['value'] = 20000 + instance_profile_cluster_network_attachment_count_model = {} # InstanceProfileClusterNetworkAttachmentCountDependent + instance_profile_cluster_network_attachment_count_model['type'] = 'dependent' + instance_profile_supported_confidential_compute_modes_model = {} # InstanceProfileSupportedConfidentialComputeModes instance_profile_supported_confidential_compute_modes_model['default'] = 'disabled' instance_profile_supported_confidential_compute_modes_model['type'] = 'enum' @@ -61052,6 +64826,11 @@ def test_instance_profile_serialization(self): instance_profile_supported_secure_boot_modes_model['type'] = 'enum' instance_profile_supported_secure_boot_modes_model['values'] = [True] + cluster_network_profile_reference_model = {} # ClusterNetworkProfileReference + cluster_network_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100' + cluster_network_profile_reference_model['name'] = 'h100' + cluster_network_profile_reference_model['resource_type'] = 'cluster_network_profile' + instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed instance_profile_volume_bandwidth_model['type'] = 'fixed' instance_profile_volume_bandwidth_model['value'] = 20000 @@ -61073,6 +64852,7 @@ def test_instance_profile_serialization(self): # Construct a json representation of a InstanceProfile model instance_profile_model_json = {} instance_profile_model_json['bandwidth'] = instance_profile_bandwidth_model + instance_profile_model_json['cluster_network_attachment_count'] = instance_profile_cluster_network_attachment_count_model instance_profile_model_json['confidential_compute_modes'] = instance_profile_supported_confidential_compute_modes_model instance_profile_model_json['disks'] = [instance_profile_disk_model] instance_profile_model_json['family'] = 'balanced' @@ -61092,6 +64872,7 @@ def test_instance_profile_serialization(self): instance_profile_model_json['resource_type'] = 'instance_profile' instance_profile_model_json['secure_boot_modes'] = instance_profile_supported_secure_boot_modes_model instance_profile_model_json['status'] = 'current' + instance_profile_model_json['supported_cluster_network_profiles'] = [cluster_network_profile_reference_model] instance_profile_model_json['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model instance_profile_model_json['vcpu_architecture'] = instance_profile_vcpu_architecture_model instance_profile_model_json['vcpu_count'] = instance_profile_vcpu_model @@ -61129,6 +64910,9 @@ def test_instance_profile_collection_serialization(self): instance_profile_bandwidth_model['type'] = 'fixed' instance_profile_bandwidth_model['value'] = 20000 + instance_profile_cluster_network_attachment_count_model = {} # InstanceProfileClusterNetworkAttachmentCountDependent + instance_profile_cluster_network_attachment_count_model['type'] = 'dependent' + instance_profile_supported_confidential_compute_modes_model = {} # InstanceProfileSupportedConfidentialComputeModes instance_profile_supported_confidential_compute_modes_model['default'] = 'disabled' instance_profile_supported_confidential_compute_modes_model['type'] = 'enum' @@ -61204,6 +64988,11 @@ def test_instance_profile_collection_serialization(self): instance_profile_supported_secure_boot_modes_model['type'] = 'enum' instance_profile_supported_secure_boot_modes_model['values'] = [True] + cluster_network_profile_reference_model = {} # ClusterNetworkProfileReference + cluster_network_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100' + cluster_network_profile_reference_model['name'] = 'h100' + cluster_network_profile_reference_model['resource_type'] = 'cluster_network_profile' + instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed instance_profile_volume_bandwidth_model['type'] = 'fixed' instance_profile_volume_bandwidth_model['value'] = 20000 @@ -61224,6 +65013,7 @@ def test_instance_profile_collection_serialization(self): instance_profile_model = {} # InstanceProfile instance_profile_model['bandwidth'] = instance_profile_bandwidth_model + instance_profile_model['cluster_network_attachment_count'] = instance_profile_cluster_network_attachment_count_model instance_profile_model['confidential_compute_modes'] = instance_profile_supported_confidential_compute_modes_model instance_profile_model['disks'] = [instance_profile_disk_model] instance_profile_model['family'] = 'balanced' @@ -61243,6 +65033,7 @@ def test_instance_profile_collection_serialization(self): instance_profile_model['resource_type'] = 'instance_profile' instance_profile_model['secure_boot_modes'] = instance_profile_supported_secure_boot_modes_model instance_profile_model['status'] = 'current' + instance_profile_model['supported_cluster_network_profiles'] = [cluster_network_profile_reference_model] instance_profile_model['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model instance_profile_model['vcpu_architecture'] = instance_profile_vcpu_architecture_model instance_profile_model['vcpu_count'] = instance_profile_vcpu_model @@ -61649,10 +65440,10 @@ def test_instance_reference_serialization(self): # Construct a json representation of a InstanceReference model instance_reference_model_json = {} - instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model_json['deleted'] = deleted_model - instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - instance_reference_model_json['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + instance_reference_model_json['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' instance_reference_model_json['name'] = 'my-instance' # Construct a model instance of InstanceReference by calling from_dict on the json representation @@ -61687,10 +65478,10 @@ def test_instance_reservation_affinity_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reservation_reference_model = {} # ReservationReference - reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_reference_model['deleted'] = deleted_model - reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63' - reservation_reference_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_reference_model['name'] = 'my-reservation' reservation_reference_model['resource_type'] = 'reservation' @@ -61728,7 +65519,7 @@ def test_instance_reservation_affinity_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a json representation of a InstanceReservationAffinityPatch model instance_reservation_affinity_patch_model_json = {} @@ -61764,7 +65555,7 @@ def test_instance_reservation_affinity_prototype_serialization(self): # Construct dict forms of any model objects needed in order to build this model. reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a json representation of a InstanceReservationAffinityPrototype model instance_reservation_affinity_prototype_model_json = {} @@ -61831,16 +65622,31 @@ def test_instance_template_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - instance_template_collection_first_model = {} # InstanceTemplateCollectionFirst - instance_template_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20' - - instance_template_collection_next_model = {} # InstanceTemplateCollectionNext - instance_template_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20' instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -61862,7 +65668,7 @@ def test_instance_template_collection_serialization(self): instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -61924,7 +65730,7 @@ def test_instance_template_collection_serialization(self): virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -61947,6 +65753,7 @@ def test_instance_template_collection_serialization(self): instance_template_model = {} # InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment instance_template_model['availability_policy'] = instance_availability_policy_prototype_model + instance_template_model['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_model['confidential_compute_mode'] = 'disabled' instance_template_model['created_at'] = '2019-01-01T12:00:00Z' instance_template_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' @@ -61973,9 +65780,9 @@ def test_instance_template_collection_serialization(self): # Construct a json representation of a InstanceTemplateCollection model instance_template_collection_model_json = {} - instance_template_collection_model_json['first'] = instance_template_collection_first_model + instance_template_collection_model_json['first'] = page_link_model instance_template_collection_model_json['limit'] = 20 - instance_template_collection_model_json['next'] = instance_template_collection_next_model + instance_template_collection_model_json['next'] = page_link_model instance_template_collection_model_json['templates'] = [instance_template_model] instance_template_collection_model_json['total_count'] = 132 @@ -61995,66 +65802,6 @@ def test_instance_template_collection_serialization(self): assert instance_template_collection_model_json2 == instance_template_collection_model_json -class TestModel_InstanceTemplateCollectionFirst: - """ - Test Class for InstanceTemplateCollectionFirst - """ - - def test_instance_template_collection_first_serialization(self): - """ - Test serialization/deserialization for InstanceTemplateCollectionFirst - """ - - # Construct a json representation of a InstanceTemplateCollectionFirst model - instance_template_collection_first_model_json = {} - instance_template_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20' - - # Construct a model instance of InstanceTemplateCollectionFirst by calling from_dict on the json representation - instance_template_collection_first_model = InstanceTemplateCollectionFirst.from_dict(instance_template_collection_first_model_json) - assert instance_template_collection_first_model != False - - # Construct a model instance of InstanceTemplateCollectionFirst by calling from_dict on the json representation - instance_template_collection_first_model_dict = InstanceTemplateCollectionFirst.from_dict(instance_template_collection_first_model_json).__dict__ - instance_template_collection_first_model2 = InstanceTemplateCollectionFirst(**instance_template_collection_first_model_dict) - - # Verify the model instances are equivalent - assert instance_template_collection_first_model == instance_template_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - instance_template_collection_first_model_json2 = instance_template_collection_first_model.to_dict() - assert instance_template_collection_first_model_json2 == instance_template_collection_first_model_json - - -class TestModel_InstanceTemplateCollectionNext: - """ - Test Class for InstanceTemplateCollectionNext - """ - - def test_instance_template_collection_next_serialization(self): - """ - Test serialization/deserialization for InstanceTemplateCollectionNext - """ - - # Construct a json representation of a InstanceTemplateCollectionNext model - instance_template_collection_next_model_json = {} - instance_template_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of InstanceTemplateCollectionNext by calling from_dict on the json representation - instance_template_collection_next_model = InstanceTemplateCollectionNext.from_dict(instance_template_collection_next_model_json) - assert instance_template_collection_next_model != False - - # Construct a model instance of InstanceTemplateCollectionNext by calling from_dict on the json representation - instance_template_collection_next_model_dict = InstanceTemplateCollectionNext.from_dict(instance_template_collection_next_model_json).__dict__ - instance_template_collection_next_model2 = InstanceTemplateCollectionNext(**instance_template_collection_next_model_dict) - - # Verify the model instances are equivalent - assert instance_template_collection_next_model == instance_template_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - instance_template_collection_next_model_json2 = instance_template_collection_next_model.to_dict() - assert instance_template_collection_next_model_json2 == instance_template_collection_next_model_json - - class TestModel_InstanceTemplatePatch: """ Test Class for InstanceTemplatePatch @@ -62176,10 +65923,10 @@ def test_key_serialization(self): # Construct a json representation of a Key model key_model_json = {} key_model_json['created_at'] = '2019-01-01T12:00:00Z' - key_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45' + key_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' - key_model_json['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' + key_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45' + key_model_json['id'] = 'r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_model_json['length'] = 2048 key_model_json['name'] = 'my-key-1' key_model_json['public_key'] = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' @@ -62214,8 +65961,8 @@ def test_key_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_collection_first_model = {} # KeyCollectionFirst - key_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=50' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=50' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' @@ -62224,25 +65971,22 @@ def test_key_collection_serialization(self): key_model = {} # Key key_model['created_at'] = '2019-01-29T03:48:11Z' - key_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45' + key_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E' - key_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' - key_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' + key_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45' + key_model['id'] = 'r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_model['length'] = 2048 key_model['name'] = 'my-key-1' key_model['public_key'] = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En' key_model['resource_group'] = resource_group_reference_model key_model['type'] = 'rsa' - key_collection_next_model = {} # KeyCollectionNext - key_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a KeyCollection model key_collection_model_json = {} - key_collection_model_json['first'] = key_collection_first_model + key_collection_model_json['first'] = page_link_model key_collection_model_json['keys'] = [key_model] key_collection_model_json['limit'] = 20 - key_collection_model_json['next'] = key_collection_next_model + key_collection_model_json['next'] = page_link_model key_collection_model_json['total_count'] = 132 # Construct a model instance of KeyCollection by calling from_dict on the json representation @@ -62261,66 +66005,6 @@ def test_key_collection_serialization(self): assert key_collection_model_json2 == key_collection_model_json -class TestModel_KeyCollectionFirst: - """ - Test Class for KeyCollectionFirst - """ - - def test_key_collection_first_serialization(self): - """ - Test serialization/deserialization for KeyCollectionFirst - """ - - # Construct a json representation of a KeyCollectionFirst model - key_collection_first_model_json = {} - key_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20' - - # Construct a model instance of KeyCollectionFirst by calling from_dict on the json representation - key_collection_first_model = KeyCollectionFirst.from_dict(key_collection_first_model_json) - assert key_collection_first_model != False - - # Construct a model instance of KeyCollectionFirst by calling from_dict on the json representation - key_collection_first_model_dict = KeyCollectionFirst.from_dict(key_collection_first_model_json).__dict__ - key_collection_first_model2 = KeyCollectionFirst(**key_collection_first_model_dict) - - # Verify the model instances are equivalent - assert key_collection_first_model == key_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - key_collection_first_model_json2 = key_collection_first_model.to_dict() - assert key_collection_first_model_json2 == key_collection_first_model_json - - -class TestModel_KeyCollectionNext: - """ - Test Class for KeyCollectionNext - """ - - def test_key_collection_next_serialization(self): - """ - Test serialization/deserialization for KeyCollectionNext - """ - - # Construct a json representation of a KeyCollectionNext model - key_collection_next_model_json = {} - key_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of KeyCollectionNext by calling from_dict on the json representation - key_collection_next_model = KeyCollectionNext.from_dict(key_collection_next_model_json) - assert key_collection_next_model != False - - # Construct a model instance of KeyCollectionNext by calling from_dict on the json representation - key_collection_next_model_dict = KeyCollectionNext.from_dict(key_collection_next_model_json).__dict__ - key_collection_next_model2 = KeyCollectionNext(**key_collection_next_model_dict) - - # Verify the model instances are equivalent - assert key_collection_next_model == key_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - key_collection_next_model_json2 = key_collection_next_model.to_dict() - assert key_collection_next_model_json2 == key_collection_next_model_json - - class TestModel_KeyPatch: """ Test Class for KeyPatch @@ -62368,11 +66052,11 @@ def test_key_reference_serialization(self): # Construct a json representation of a KeyReference model key_reference_model_json = {} - key_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_reference_model_json['deleted'] = deleted_model key_reference_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' - key_reference_model_json['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model_json['id'] = 'r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_reference_model_json['name'] = 'my-key-1' # Construct a model instance of KeyReference by calling from_dict on the json representation @@ -62558,8 +66242,8 @@ def test_load_balancer_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_collection_first_model = {} # LoadBalancerCollectionFirst - load_balancer_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20' dns_instance_reference_load_balancer_dns_context_model = {} # DNSInstanceReferenceLoadBalancerDNSContext dns_instance_reference_load_balancer_dns_context_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::' @@ -62657,15 +66341,12 @@ def test_load_balancer_collection_serialization(self): load_balancer_model['subnets'] = [subnet_reference_model] load_balancer_model['udp_supported'] = True - load_balancer_collection_next_model = {} # LoadBalancerCollectionNext - load_balancer_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - # Construct a json representation of a LoadBalancerCollection model load_balancer_collection_model_json = {} - load_balancer_collection_model_json['first'] = load_balancer_collection_first_model + load_balancer_collection_model_json['first'] = page_link_model load_balancer_collection_model_json['limit'] = 20 load_balancer_collection_model_json['load_balancers'] = [load_balancer_model] - load_balancer_collection_model_json['next'] = load_balancer_collection_next_model + load_balancer_collection_model_json['next'] = page_link_model load_balancer_collection_model_json['total_count'] = 132 # Construct a model instance of LoadBalancerCollection by calling from_dict on the json representation @@ -62684,66 +66365,6 @@ def test_load_balancer_collection_serialization(self): assert load_balancer_collection_model_json2 == load_balancer_collection_model_json -class TestModel_LoadBalancerCollectionFirst: - """ - Test Class for LoadBalancerCollectionFirst - """ - - def test_load_balancer_collection_first_serialization(self): - """ - Test serialization/deserialization for LoadBalancerCollectionFirst - """ - - # Construct a json representation of a LoadBalancerCollectionFirst model - load_balancer_collection_first_model_json = {} - load_balancer_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20' - - # Construct a model instance of LoadBalancerCollectionFirst by calling from_dict on the json representation - load_balancer_collection_first_model = LoadBalancerCollectionFirst.from_dict(load_balancer_collection_first_model_json) - assert load_balancer_collection_first_model != False - - # Construct a model instance of LoadBalancerCollectionFirst by calling from_dict on the json representation - load_balancer_collection_first_model_dict = LoadBalancerCollectionFirst.from_dict(load_balancer_collection_first_model_json).__dict__ - load_balancer_collection_first_model2 = LoadBalancerCollectionFirst(**load_balancer_collection_first_model_dict) - - # Verify the model instances are equivalent - assert load_balancer_collection_first_model == load_balancer_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - load_balancer_collection_first_model_json2 = load_balancer_collection_first_model.to_dict() - assert load_balancer_collection_first_model_json2 == load_balancer_collection_first_model_json - - -class TestModel_LoadBalancerCollectionNext: - """ - Test Class for LoadBalancerCollectionNext - """ - - def test_load_balancer_collection_next_serialization(self): - """ - Test serialization/deserialization for LoadBalancerCollectionNext - """ - - # Construct a json representation of a LoadBalancerCollectionNext model - load_balancer_collection_next_model_json = {} - load_balancer_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - - # Construct a model instance of LoadBalancerCollectionNext by calling from_dict on the json representation - load_balancer_collection_next_model = LoadBalancerCollectionNext.from_dict(load_balancer_collection_next_model_json) - assert load_balancer_collection_next_model != False - - # Construct a model instance of LoadBalancerCollectionNext by calling from_dict on the json representation - load_balancer_collection_next_model_dict = LoadBalancerCollectionNext.from_dict(load_balancer_collection_next_model_json).__dict__ - load_balancer_collection_next_model2 = LoadBalancerCollectionNext(**load_balancer_collection_next_model_dict) - - # Verify the model instances are equivalent - assert load_balancer_collection_next_model == load_balancer_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - load_balancer_collection_next_model_json2 = load_balancer_collection_next_model.to_dict() - assert load_balancer_collection_next_model_json2 == load_balancer_collection_next_model_json - - class TestModel_LoadBalancerDNS: """ Test Class for LoadBalancerDNS @@ -63955,7 +67576,6 @@ def test_load_balancer_pool_serialization(self): load_balancer_pool_health_monitor_model['port'] = 22 load_balancer_pool_health_monitor_model['timeout'] = 2 load_balancer_pool_health_monitor_model['type'] = 'http' - load_balancer_pool_health_monitor_model['url'] = 'testString' load_balancer_pool_health_monitor_model['url_path'] = '/' deleted_model = {} # Deleted @@ -64026,7 +67646,6 @@ def test_load_balancer_pool_collection_serialization(self): load_balancer_pool_health_monitor_model['port'] = 22 load_balancer_pool_health_monitor_model['timeout'] = 2 load_balancer_pool_health_monitor_model['type'] = 'http' - load_balancer_pool_health_monitor_model['url'] = 'testString' load_balancer_pool_health_monitor_model['url_path'] = '/' deleted_model = {} # Deleted @@ -64099,7 +67718,6 @@ def test_load_balancer_pool_health_monitor_serialization(self): load_balancer_pool_health_monitor_model_json['port'] = 22 load_balancer_pool_health_monitor_model_json['timeout'] = 2 load_balancer_pool_health_monitor_model_json['type'] = 'http' - load_balancer_pool_health_monitor_model_json['url'] = 'testString' load_balancer_pool_health_monitor_model_json['url_path'] = '/' # Construct a model instance of LoadBalancerPoolHealthMonitor by calling from_dict on the json representation @@ -64234,10 +67852,10 @@ def test_load_balancer_pool_member_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' load_balancer_pool_member_target_model = {} # LoadBalancerPoolMemberTargetInstanceReference - load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' load_balancer_pool_member_target_model['deleted'] = deleted_model - load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - load_balancer_pool_member_target_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + load_balancer_pool_member_target_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' load_balancer_pool_member_target_model['name'] = 'my-instance' # Construct a json representation of a LoadBalancerPoolMember model @@ -64283,10 +67901,10 @@ def test_load_balancer_pool_member_collection_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' load_balancer_pool_member_target_model = {} # LoadBalancerPoolMemberTargetInstanceReference - load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' load_balancer_pool_member_target_model['deleted'] = deleted_model - load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - load_balancer_pool_member_target_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + load_balancer_pool_member_target_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' load_balancer_pool_member_target_model['name'] = 'my-instance' load_balancer_pool_member_model = {} # LoadBalancerPoolMember @@ -64332,7 +67950,7 @@ def test_load_balancer_pool_member_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a json representation of a LoadBalancerPoolMemberPatch model load_balancer_pool_member_patch_model_json = {} @@ -64369,7 +67987,7 @@ def test_load_balancer_pool_member_prototype_serialization(self): # Construct dict forms of any model objects needed in order to build this model. load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a json representation of a LoadBalancerPoolMemberPrototype model load_balancer_pool_member_prototype_model_json = {} @@ -64500,7 +68118,7 @@ def test_load_balancer_pool_prototype_serialization(self): load_balancer_pool_health_monitor_prototype_model['url_path'] = '/' load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById - load_balancer_pool_member_target_prototype_model['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_prototype_model['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' load_balancer_pool_member_prototype_model = {} # LoadBalancerPoolMemberPrototype load_balancer_pool_member_prototype_model['port'] = 80 @@ -64785,11 +68403,8 @@ def test_load_balancer_profile_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - load_balancer_profile_collection_first_model = {} # LoadBalancerProfileCollectionFirst - load_balancer_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20' - - load_balancer_profile_collection_next_model = {} # LoadBalancerProfileCollectionNext - load_balancer_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20' load_balancer_profile_access_modes_model = {} # LoadBalancerProfileAccessModes load_balancer_profile_access_modes_model['type'] = 'enum' @@ -64838,9 +68453,9 @@ def test_load_balancer_profile_collection_serialization(self): # Construct a json representation of a LoadBalancerProfileCollection model load_balancer_profile_collection_model_json = {} - load_balancer_profile_collection_model_json['first'] = load_balancer_profile_collection_first_model + load_balancer_profile_collection_model_json['first'] = page_link_model load_balancer_profile_collection_model_json['limit'] = 20 - load_balancer_profile_collection_model_json['next'] = load_balancer_profile_collection_next_model + load_balancer_profile_collection_model_json['next'] = page_link_model load_balancer_profile_collection_model_json['profiles'] = [load_balancer_profile_model] load_balancer_profile_collection_model_json['total_count'] = 132 @@ -64860,66 +68475,6 @@ def test_load_balancer_profile_collection_serialization(self): assert load_balancer_profile_collection_model_json2 == load_balancer_profile_collection_model_json -class TestModel_LoadBalancerProfileCollectionFirst: - """ - Test Class for LoadBalancerProfileCollectionFirst - """ - - def test_load_balancer_profile_collection_first_serialization(self): - """ - Test serialization/deserialization for LoadBalancerProfileCollectionFirst - """ - - # Construct a json representation of a LoadBalancerProfileCollectionFirst model - load_balancer_profile_collection_first_model_json = {} - load_balancer_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20' - - # Construct a model instance of LoadBalancerProfileCollectionFirst by calling from_dict on the json representation - load_balancer_profile_collection_first_model = LoadBalancerProfileCollectionFirst.from_dict(load_balancer_profile_collection_first_model_json) - assert load_balancer_profile_collection_first_model != False - - # Construct a model instance of LoadBalancerProfileCollectionFirst by calling from_dict on the json representation - load_balancer_profile_collection_first_model_dict = LoadBalancerProfileCollectionFirst.from_dict(load_balancer_profile_collection_first_model_json).__dict__ - load_balancer_profile_collection_first_model2 = LoadBalancerProfileCollectionFirst(**load_balancer_profile_collection_first_model_dict) - - # Verify the model instances are equivalent - assert load_balancer_profile_collection_first_model == load_balancer_profile_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - load_balancer_profile_collection_first_model_json2 = load_balancer_profile_collection_first_model.to_dict() - assert load_balancer_profile_collection_first_model_json2 == load_balancer_profile_collection_first_model_json - - -class TestModel_LoadBalancerProfileCollectionNext: - """ - Test Class for LoadBalancerProfileCollectionNext - """ - - def test_load_balancer_profile_collection_next_serialization(self): - """ - Test serialization/deserialization for LoadBalancerProfileCollectionNext - """ - - # Construct a json representation of a LoadBalancerProfileCollectionNext model - load_balancer_profile_collection_next_model_json = {} - load_balancer_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of LoadBalancerProfileCollectionNext by calling from_dict on the json representation - load_balancer_profile_collection_next_model = LoadBalancerProfileCollectionNext.from_dict(load_balancer_profile_collection_next_model_json) - assert load_balancer_profile_collection_next_model != False - - # Construct a model instance of LoadBalancerProfileCollectionNext by calling from_dict on the json representation - load_balancer_profile_collection_next_model_dict = LoadBalancerProfileCollectionNext.from_dict(load_balancer_profile_collection_next_model_json).__dict__ - load_balancer_profile_collection_next_model2 = LoadBalancerProfileCollectionNext(**load_balancer_profile_collection_next_model_dict) - - # Verify the model instances are equivalent - assert load_balancer_profile_collection_next_model == load_balancer_profile_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - load_balancer_profile_collection_next_model_json2 = load_balancer_profile_collection_next_model.to_dict() - assert load_balancer_profile_collection_next_model_json2 == load_balancer_profile_collection_next_model_json - - class TestModel_LoadBalancerProfileLoggingSupported: """ Test Class for LoadBalancerProfileLoggingSupported @@ -65155,8 +68710,8 @@ def test_network_acl_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_acl_collection_first_model = {} # NetworkACLCollectionFirst - network_acl_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' @@ -65189,315 +68744,189 @@ def test_network_acl_collection_serialization(self): network_acl_rule_item_model['source_port_max'] = 65535 network_acl_rule_item_model['source_port_min'] = 49152 - subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['name'] = 'my-subnet' - subnet_reference_model['resource_type'] = 'subnet' - - vpc_reference_model = {} # VPCReference - vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' - vpc_reference_model['deleted'] = deleted_model - vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' - vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' - vpc_reference_model['name'] = 'my-vpc' - vpc_reference_model['resource_type'] = 'vpc' - - network_acl_model = {} # NetworkACL - network_acl_model['created_at'] = '2019-01-01T12:00:00Z' - network_acl_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_model['id'] = 'r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_model['name'] = 'my-network-acl' - network_acl_model['resource_group'] = resource_group_reference_model - network_acl_model['rules'] = [network_acl_rule_item_model] - network_acl_model['subnets'] = [subnet_reference_model] - network_acl_model['vpc'] = vpc_reference_model - - network_acl_collection_next_model = {} # NetworkACLCollectionNext - network_acl_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a json representation of a NetworkACLCollection model - network_acl_collection_model_json = {} - network_acl_collection_model_json['first'] = network_acl_collection_first_model - network_acl_collection_model_json['limit'] = 20 - network_acl_collection_model_json['network_acls'] = [network_acl_model] - network_acl_collection_model_json['next'] = network_acl_collection_next_model - network_acl_collection_model_json['total_count'] = 132 - - # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation - network_acl_collection_model = NetworkACLCollection.from_dict(network_acl_collection_model_json) - assert network_acl_collection_model != False - - # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation - network_acl_collection_model_dict = NetworkACLCollection.from_dict(network_acl_collection_model_json).__dict__ - network_acl_collection_model2 = NetworkACLCollection(**network_acl_collection_model_dict) - - # Verify the model instances are equivalent - assert network_acl_collection_model == network_acl_collection_model2 - - # Convert model instance back to dict and verify no loss of data - network_acl_collection_model_json2 = network_acl_collection_model.to_dict() - assert network_acl_collection_model_json2 == network_acl_collection_model_json - - -class TestModel_NetworkACLCollectionFirst: - """ - Test Class for NetworkACLCollectionFirst - """ - - def test_network_acl_collection_first_serialization(self): - """ - Test serialization/deserialization for NetworkACLCollectionFirst - """ - - # Construct a json representation of a NetworkACLCollectionFirst model - network_acl_collection_first_model_json = {} - network_acl_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20' - - # Construct a model instance of NetworkACLCollectionFirst by calling from_dict on the json representation - network_acl_collection_first_model = NetworkACLCollectionFirst.from_dict(network_acl_collection_first_model_json) - assert network_acl_collection_first_model != False - - # Construct a model instance of NetworkACLCollectionFirst by calling from_dict on the json representation - network_acl_collection_first_model_dict = NetworkACLCollectionFirst.from_dict(network_acl_collection_first_model_json).__dict__ - network_acl_collection_first_model2 = NetworkACLCollectionFirst(**network_acl_collection_first_model_dict) - - # Verify the model instances are equivalent - assert network_acl_collection_first_model == network_acl_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - network_acl_collection_first_model_json2 = network_acl_collection_first_model.to_dict() - assert network_acl_collection_first_model_json2 == network_acl_collection_first_model_json - - -class TestModel_NetworkACLCollectionNext: - """ - Test Class for NetworkACLCollectionNext - """ - - def test_network_acl_collection_next_serialization(self): - """ - Test serialization/deserialization for NetworkACLCollectionNext - """ - - # Construct a json representation of a NetworkACLCollectionNext model - network_acl_collection_next_model_json = {} - network_acl_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of NetworkACLCollectionNext by calling from_dict on the json representation - network_acl_collection_next_model = NetworkACLCollectionNext.from_dict(network_acl_collection_next_model_json) - assert network_acl_collection_next_model != False - - # Construct a model instance of NetworkACLCollectionNext by calling from_dict on the json representation - network_acl_collection_next_model_dict = NetworkACLCollectionNext.from_dict(network_acl_collection_next_model_json).__dict__ - network_acl_collection_next_model2 = NetworkACLCollectionNext(**network_acl_collection_next_model_dict) - - # Verify the model instances are equivalent - assert network_acl_collection_next_model == network_acl_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - network_acl_collection_next_model_json2 = network_acl_collection_next_model.to_dict() - assert network_acl_collection_next_model_json2 == network_acl_collection_next_model_json - - -class TestModel_NetworkACLPatch: - """ - Test Class for NetworkACLPatch - """ - - def test_network_acl_patch_serialization(self): - """ - Test serialization/deserialization for NetworkACLPatch - """ - - # Construct a json representation of a NetworkACLPatch model - network_acl_patch_model_json = {} - network_acl_patch_model_json['name'] = 'my-network-acl' - - # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation - network_acl_patch_model = NetworkACLPatch.from_dict(network_acl_patch_model_json) - assert network_acl_patch_model != False - - # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation - network_acl_patch_model_dict = NetworkACLPatch.from_dict(network_acl_patch_model_json).__dict__ - network_acl_patch_model2 = NetworkACLPatch(**network_acl_patch_model_dict) - - # Verify the model instances are equivalent - assert network_acl_patch_model == network_acl_patch_model2 - - # Convert model instance back to dict and verify no loss of data - network_acl_patch_model_json2 = network_acl_patch_model.to_dict() - assert network_acl_patch_model_json2 == network_acl_patch_model_json - - -class TestModel_NetworkACLReference: - """ - Test Class for NetworkACLReference - """ - - def test_network_acl_reference_serialization(self): - """ - Test serialization/deserialization for NetworkACLReference - """ - - # Construct dict forms of any model objects needed in order to build this model. - - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - # Construct a json representation of a NetworkACLReference model - network_acl_reference_model_json = {} - network_acl_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model_json['deleted'] = deleted_model - network_acl_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model_json['id'] = 'r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' - network_acl_reference_model_json['name'] = 'my-network-acl' - - # Construct a model instance of NetworkACLReference by calling from_dict on the json representation - network_acl_reference_model = NetworkACLReference.from_dict(network_acl_reference_model_json) - assert network_acl_reference_model != False - - # Construct a model instance of NetworkACLReference by calling from_dict on the json representation - network_acl_reference_model_dict = NetworkACLReference.from_dict(network_acl_reference_model_json).__dict__ - network_acl_reference_model2 = NetworkACLReference(**network_acl_reference_model_dict) - - # Verify the model instances are equivalent - assert network_acl_reference_model == network_acl_reference_model2 - - # Convert model instance back to dict and verify no loss of data - network_acl_reference_model_json2 = network_acl_reference_model.to_dict() - assert network_acl_reference_model_json2 == network_acl_reference_model_json - - -class TestModel_NetworkACLRuleCollection: - """ - Test Class for NetworkACLRuleCollection - """ - - def test_network_acl_rule_collection_serialization(self): - """ - Test serialization/deserialization for NetworkACLRuleCollection - """ - - # Construct dict forms of any model objects needed in order to build this model. - - network_acl_rule_collection_first_model = {} # NetworkACLRuleCollectionFirst - network_acl_rule_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20' - - network_acl_rule_collection_next_model = {} # NetworkACLRuleCollectionNext - network_acl_rule_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - deleted_model = {} # Deleted - deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_acl_rule_reference_model = {} # NetworkACLRuleReference - network_acl_rule_reference_model['deleted'] = deleted_model - network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_reference_model['name'] = 'my-rule-1' - - network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP - network_acl_rule_item_model['action'] = 'allow' - network_acl_rule_item_model['before'] = network_acl_rule_reference_model - network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z' - network_acl_rule_item_model['destination'] = '192.168.3.0/24' - network_acl_rule_item_model['direction'] = 'inbound' - network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - network_acl_rule_item_model['ip_version'] = 'ipv4' - network_acl_rule_item_model['name'] = 'my-rule-1' - network_acl_rule_item_model['source'] = '192.168.3.0/24' - network_acl_rule_item_model['destination_port_max'] = 22 - network_acl_rule_item_model['destination_port_min'] = 22 - network_acl_rule_item_model['protocol'] = 'udp' - network_acl_rule_item_model['source_port_max'] = 65535 - network_acl_rule_item_model['source_port_min'] = 49152 - - # Construct a json representation of a NetworkACLRuleCollection model - network_acl_rule_collection_model_json = {} - network_acl_rule_collection_model_json['first'] = network_acl_rule_collection_first_model - network_acl_rule_collection_model_json['limit'] = 20 - network_acl_rule_collection_model_json['next'] = network_acl_rule_collection_next_model - network_acl_rule_collection_model_json['rules'] = [network_acl_rule_item_model] - network_acl_rule_collection_model_json['total_count'] = 132 + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' - # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation - network_acl_rule_collection_model = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json) - assert network_acl_rule_collection_model != False + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' - # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation - network_acl_rule_collection_model_dict = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json).__dict__ - network_acl_rule_collection_model2 = NetworkACLRuleCollection(**network_acl_rule_collection_model_dict) + network_acl_model = {} # NetworkACL + network_acl_model['created_at'] = '2019-01-01T12:00:00Z' + network_acl_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_model['id'] = 'r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_model['name'] = 'my-network-acl' + network_acl_model['resource_group'] = resource_group_reference_model + network_acl_model['rules'] = [network_acl_rule_item_model] + network_acl_model['subnets'] = [subnet_reference_model] + network_acl_model['vpc'] = vpc_reference_model + + # Construct a json representation of a NetworkACLCollection model + network_acl_collection_model_json = {} + network_acl_collection_model_json['first'] = page_link_model + network_acl_collection_model_json['limit'] = 20 + network_acl_collection_model_json['network_acls'] = [network_acl_model] + network_acl_collection_model_json['next'] = page_link_model + network_acl_collection_model_json['total_count'] = 132 + + # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation + network_acl_collection_model = NetworkACLCollection.from_dict(network_acl_collection_model_json) + assert network_acl_collection_model != False + + # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation + network_acl_collection_model_dict = NetworkACLCollection.from_dict(network_acl_collection_model_json).__dict__ + network_acl_collection_model2 = NetworkACLCollection(**network_acl_collection_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_collection_model == network_acl_rule_collection_model2 + assert network_acl_collection_model == network_acl_collection_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_collection_model_json2 = network_acl_rule_collection_model.to_dict() - assert network_acl_rule_collection_model_json2 == network_acl_rule_collection_model_json + network_acl_collection_model_json2 = network_acl_collection_model.to_dict() + assert network_acl_collection_model_json2 == network_acl_collection_model_json -class TestModel_NetworkACLRuleCollectionFirst: +class TestModel_NetworkACLPatch: """ - Test Class for NetworkACLRuleCollectionFirst + Test Class for NetworkACLPatch """ - def test_network_acl_rule_collection_first_serialization(self): + def test_network_acl_patch_serialization(self): """ - Test serialization/deserialization for NetworkACLRuleCollectionFirst + Test serialization/deserialization for NetworkACLPatch """ - # Construct a json representation of a NetworkACLRuleCollectionFirst model - network_acl_rule_collection_first_model_json = {} - network_acl_rule_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20' + # Construct a json representation of a NetworkACLPatch model + network_acl_patch_model_json = {} + network_acl_patch_model_json['name'] = 'my-network-acl' - # Construct a model instance of NetworkACLRuleCollectionFirst by calling from_dict on the json representation - network_acl_rule_collection_first_model = NetworkACLRuleCollectionFirst.from_dict(network_acl_rule_collection_first_model_json) - assert network_acl_rule_collection_first_model != False + # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation + network_acl_patch_model = NetworkACLPatch.from_dict(network_acl_patch_model_json) + assert network_acl_patch_model != False - # Construct a model instance of NetworkACLRuleCollectionFirst by calling from_dict on the json representation - network_acl_rule_collection_first_model_dict = NetworkACLRuleCollectionFirst.from_dict(network_acl_rule_collection_first_model_json).__dict__ - network_acl_rule_collection_first_model2 = NetworkACLRuleCollectionFirst(**network_acl_rule_collection_first_model_dict) + # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation + network_acl_patch_model_dict = NetworkACLPatch.from_dict(network_acl_patch_model_json).__dict__ + network_acl_patch_model2 = NetworkACLPatch(**network_acl_patch_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_collection_first_model == network_acl_rule_collection_first_model2 + assert network_acl_patch_model == network_acl_patch_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_collection_first_model_json2 = network_acl_rule_collection_first_model.to_dict() - assert network_acl_rule_collection_first_model_json2 == network_acl_rule_collection_first_model_json + network_acl_patch_model_json2 = network_acl_patch_model.to_dict() + assert network_acl_patch_model_json2 == network_acl_patch_model_json -class TestModel_NetworkACLRuleCollectionNext: +class TestModel_NetworkACLReference: """ - Test Class for NetworkACLRuleCollectionNext + Test Class for NetworkACLReference """ - def test_network_acl_rule_collection_next_serialization(self): + def test_network_acl_reference_serialization(self): """ - Test serialization/deserialization for NetworkACLRuleCollectionNext + Test serialization/deserialization for NetworkACLReference """ - # Construct a json representation of a NetworkACLRuleCollectionNext model - network_acl_rule_collection_next_model_json = {} - network_acl_rule_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + # Construct dict forms of any model objects needed in order to build this model. - # Construct a model instance of NetworkACLRuleCollectionNext by calling from_dict on the json representation - network_acl_rule_collection_next_model = NetworkACLRuleCollectionNext.from_dict(network_acl_rule_collection_next_model_json) - assert network_acl_rule_collection_next_model != False + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - # Construct a model instance of NetworkACLRuleCollectionNext by calling from_dict on the json representation - network_acl_rule_collection_next_model_dict = NetworkACLRuleCollectionNext.from_dict(network_acl_rule_collection_next_model_json).__dict__ - network_acl_rule_collection_next_model2 = NetworkACLRuleCollectionNext(**network_acl_rule_collection_next_model_dict) + # Construct a json representation of a NetworkACLReference model + network_acl_reference_model_json = {} + network_acl_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model_json['deleted'] = deleted_model + network_acl_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model_json['id'] = 'r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf' + network_acl_reference_model_json['name'] = 'my-network-acl' + + # Construct a model instance of NetworkACLReference by calling from_dict on the json representation + network_acl_reference_model = NetworkACLReference.from_dict(network_acl_reference_model_json) + assert network_acl_reference_model != False + + # Construct a model instance of NetworkACLReference by calling from_dict on the json representation + network_acl_reference_model_dict = NetworkACLReference.from_dict(network_acl_reference_model_json).__dict__ + network_acl_reference_model2 = NetworkACLReference(**network_acl_reference_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_collection_next_model == network_acl_rule_collection_next_model2 + assert network_acl_reference_model == network_acl_reference_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_collection_next_model_json2 = network_acl_rule_collection_next_model.to_dict() - assert network_acl_rule_collection_next_model_json2 == network_acl_rule_collection_next_model_json + network_acl_reference_model_json2 = network_acl_reference_model.to_dict() + assert network_acl_reference_model_json2 == network_acl_reference_model_json + + +class TestModel_NetworkACLRuleCollection: + """ + Test Class for NetworkACLRuleCollection + """ + + def test_network_acl_rule_collection_serialization(self): + """ + Test serialization/deserialization for NetworkACLRuleCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20' + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + network_acl_rule_reference_model = {} # NetworkACLRuleReference + network_acl_rule_reference_model['deleted'] = deleted_model + network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_reference_model['name'] = 'my-rule-1' + + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP + network_acl_rule_item_model['action'] = 'allow' + network_acl_rule_item_model['before'] = network_acl_rule_reference_model + network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z' + network_acl_rule_item_model['destination'] = '192.168.3.0/24' + network_acl_rule_item_model['direction'] = 'inbound' + network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' + network_acl_rule_item_model['ip_version'] = 'ipv4' + network_acl_rule_item_model['name'] = 'my-rule-1' + network_acl_rule_item_model['source'] = '192.168.3.0/24' + network_acl_rule_item_model['destination_port_max'] = 22 + network_acl_rule_item_model['destination_port_min'] = 22 + network_acl_rule_item_model['protocol'] = 'udp' + network_acl_rule_item_model['source_port_max'] = 65535 + network_acl_rule_item_model['source_port_min'] = 49152 + + # Construct a json representation of a NetworkACLRuleCollection model + network_acl_rule_collection_model_json = {} + network_acl_rule_collection_model_json['first'] = page_link_model + network_acl_rule_collection_model_json['limit'] = 20 + network_acl_rule_collection_model_json['next'] = page_link_model + network_acl_rule_collection_model_json['rules'] = [network_acl_rule_item_model] + network_acl_rule_collection_model_json['total_count'] = 132 + + # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation + network_acl_rule_collection_model = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json) + assert network_acl_rule_collection_model != False + + # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation + network_acl_rule_collection_model_dict = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json).__dict__ + network_acl_rule_collection_model2 = NetworkACLRuleCollection(**network_acl_rule_collection_model_dict) + + # Verify the model instances are equivalent + assert network_acl_rule_collection_model == network_acl_rule_collection_model2 + + # Convert model instance back to dict and verify no loss of data + network_acl_rule_collection_model_json2 = network_acl_rule_collection_model.to_dict() + assert network_acl_rule_collection_model_json2 == network_acl_rule_collection_model_json class TestModel_NetworkACLRulePatch: @@ -65601,33 +69030,33 @@ def test_network_interface_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' floating_ip_reference_model = {} # FloatingIPReference - floating_ip_reference_model['address'] = '192.0.2.2' - floating_ip_reference_model['crn'] = 'crn:[...]' + floating_ip_reference_model['address'] = '203.0.113.1' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['deleted'] = deleted_model - floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/181b8670-52bf-47af-a5ca-7aff7f3824d1' - floating_ip_reference_model['id'] = '181b8670-52bf-47af-a5ca-7aff7f3824d1' + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['name'] = 'my-floating-ip' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.0.0.32' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' - reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' - reserved_ip_reference_model['name'] = 'my-reserved-ip-1' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model['crn'] = 'crn:[...]' + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['deleted'] = deleted_model - security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589' - security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589' - security_group_reference_model['name'] = 'before-entrance-mountain-paralegal-photo-uninstall' + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['name'] = 'my-security-group' subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:[...]' + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c' - subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' @@ -65636,8 +69065,8 @@ def test_network_interface_serialization(self): network_interface_model_json['allow_ip_spoofing'] = True network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z' network_interface_model_json['floating_ips'] = [floating_ip_reference_model] - network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + network_interface_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' network_interface_model_json['name'] = 'my-instance-network-interface' network_interface_model_json['port_speed'] = 1000 network_interface_model_json['primary_ip'] = reserved_ip_reference_model @@ -65697,8 +69126,8 @@ def test_network_interface_bare_metal_server_context_reference_serialization(sel # Construct a json representation of a NetworkInterfaceBareMetalServerContextReference model network_interface_bare_metal_server_context_reference_model_json = {} network_interface_bare_metal_server_context_reference_model_json['deleted'] = deleted_model - network_interface_bare_metal_server_context_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_bare_metal_server_context_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_bare_metal_server_context_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + network_interface_bare_metal_server_context_reference_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' network_interface_bare_metal_server_context_reference_model_json['name'] = 'my-bare-metal-server-network-interface' network_interface_bare_metal_server_context_reference_model_json['primary_ip'] = reserved_ip_reference_model network_interface_bare_metal_server_context_reference_model_json['resource_type'] = 'network_interface' @@ -65736,9 +69165,9 @@ def test_network_interface_instance_context_reference_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -65754,8 +69183,8 @@ def test_network_interface_instance_context_reference_serialization(self): # Construct a json representation of a NetworkInterfaceInstanceContextReference model network_interface_instance_context_reference_model_json = {} network_interface_instance_context_reference_model_json['deleted'] = deleted_model - network_interface_instance_context_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + network_interface_instance_context_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + network_interface_instance_context_reference_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' network_interface_instance_context_reference_model_json['name'] = 'my-instance-network-interface' network_interface_instance_context_reference_model_json['primary_ip'] = reserved_ip_reference_model network_interface_instance_context_reference_model_json['resource_type'] = 'network_interface' @@ -65826,7 +69255,7 @@ def test_network_interface_prototype_serialization(self): network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -65871,43 +69300,43 @@ def test_network_interface_unpaginated_collection_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' floating_ip_reference_model = {} # FloatingIPReference - floating_ip_reference_model['address'] = '192.0.2.2' - floating_ip_reference_model['crn'] = 'crn:[...]' + floating_ip_reference_model['address'] = '203.0.113.1' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['deleted'] = deleted_model - floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/181b8670-52bf-47af-a5ca-7aff7f3824d1' - floating_ip_reference_model['id'] = '181b8670-52bf-47af-a5ca-7aff7f3824d1' + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['name'] = 'my-floating-ip' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.0.0.32' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' - reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' - reserved_ip_reference_model['name'] = 'my-reserved-ip-1' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model['crn'] = 'crn:[...]' + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['deleted'] = deleted_model - security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589' - security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589' - security_group_reference_model['name'] = 'before-entrance-mountain-paralegal-photo-uninstall' + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['name'] = 'my-security-group' subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:[...]' + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c' - subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' network_interface_model = {} # NetworkInterface network_interface_model['allow_ip_spoofing'] = False - network_interface_model['created_at'] = '2019-01-31T03:42:32.993000Z' + network_interface_model['created_at'] = '2024-10-15T03:24:32.993000Z' network_interface_model['floating_ips'] = [floating_ip_reference_model] - network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/123a490a-9e64-4254-a93b-9a3af3ede270/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20' - network_interface_model['id'] = '35bd3f19-bdd4-434b-ad6a-5e9358d65e20' - network_interface_model['name'] = 'molecule-find-wild-name-dictionary-trench' + network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + network_interface_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + network_interface_model['name'] = 'my-instance-network-interface' network_interface_model['port_speed'] = 1000 network_interface_model['primary_ip'] = reserved_ip_reference_model network_interface_model['resource_type'] = 'network_interface' @@ -65987,11 +69416,8 @@ def test_operating_system_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - operating_system_collection_first_model = {} # OperatingSystemCollectionFirst - operating_system_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20' - - operating_system_collection_next_model = {} # OperatingSystemCollectionNext - operating_system_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20' operating_system_model = {} # OperatingSystem operating_system_model['allow_user_image_creation'] = True @@ -66007,9 +69433,9 @@ def test_operating_system_collection_serialization(self): # Construct a json representation of a OperatingSystemCollection model operating_system_collection_model_json = {} - operating_system_collection_model_json['first'] = operating_system_collection_first_model + operating_system_collection_model_json['first'] = page_link_model operating_system_collection_model_json['limit'] = 20 - operating_system_collection_model_json['next'] = operating_system_collection_next_model + operating_system_collection_model_json['next'] = page_link_model operating_system_collection_model_json['operating_systems'] = [operating_system_model] operating_system_collection_model_json['total_count'] = 132 @@ -66029,64 +69455,34 @@ def test_operating_system_collection_serialization(self): assert operating_system_collection_model_json2 == operating_system_collection_model_json -class TestModel_OperatingSystemCollectionFirst: +class TestModel_PageLink: """ - Test Class for OperatingSystemCollectionFirst + Test Class for PageLink """ - def test_operating_system_collection_first_serialization(self): + def test_page_link_serialization(self): """ - Test serialization/deserialization for OperatingSystemCollectionFirst + Test serialization/deserialization for PageLink """ - # Construct a json representation of a OperatingSystemCollectionFirst model - operating_system_collection_first_model_json = {} - operating_system_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20' + # Construct a json representation of a PageLink model + page_link_model_json = {} + page_link_model_json['href'] = 'testString' - # Construct a model instance of OperatingSystemCollectionFirst by calling from_dict on the json representation - operating_system_collection_first_model = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json) - assert operating_system_collection_first_model != False + # Construct a model instance of PageLink by calling from_dict on the json representation + page_link_model = PageLink.from_dict(page_link_model_json) + assert page_link_model != False - # Construct a model instance of OperatingSystemCollectionFirst by calling from_dict on the json representation - operating_system_collection_first_model_dict = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json).__dict__ - operating_system_collection_first_model2 = OperatingSystemCollectionFirst(**operating_system_collection_first_model_dict) + # Construct a model instance of PageLink by calling from_dict on the json representation + page_link_model_dict = PageLink.from_dict(page_link_model_json).__dict__ + page_link_model2 = PageLink(**page_link_model_dict) # Verify the model instances are equivalent - assert operating_system_collection_first_model == operating_system_collection_first_model2 + assert page_link_model == page_link_model2 # Convert model instance back to dict and verify no loss of data - operating_system_collection_first_model_json2 = operating_system_collection_first_model.to_dict() - assert operating_system_collection_first_model_json2 == operating_system_collection_first_model_json - - -class TestModel_OperatingSystemCollectionNext: - """ - Test Class for OperatingSystemCollectionNext - """ - - def test_operating_system_collection_next_serialization(self): - """ - Test serialization/deserialization for OperatingSystemCollectionNext - """ - - # Construct a json representation of a OperatingSystemCollectionNext model - operating_system_collection_next_model_json = {} - operating_system_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of OperatingSystemCollectionNext by calling from_dict on the json representation - operating_system_collection_next_model = OperatingSystemCollectionNext.from_dict(operating_system_collection_next_model_json) - assert operating_system_collection_next_model != False - - # Construct a model instance of OperatingSystemCollectionNext by calling from_dict on the json representation - operating_system_collection_next_model_dict = OperatingSystemCollectionNext.from_dict(operating_system_collection_next_model_json).__dict__ - operating_system_collection_next_model2 = OperatingSystemCollectionNext(**operating_system_collection_next_model_dict) - - # Verify the model instances are equivalent - assert operating_system_collection_next_model == operating_system_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - operating_system_collection_next_model_json2 = operating_system_collection_next_model.to_dict() - assert operating_system_collection_next_model_json2 == operating_system_collection_next_model_json + page_link_model_json2 = page_link_model.to_dict() + assert page_link_model_json2 == page_link_model_json class TestModel_PlacementGroup: @@ -66102,16 +69498,16 @@ def test_placement_group_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['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' - resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'Default' # Construct a json representation of a PlacementGroup model placement_group_model_json = {} placement_group_model_json['created_at'] = '2019-01-01T12:00:00Z' - placement_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871' - placement_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871' - placement_group_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model_json['id'] = 'r006-418fe842-a3e9-47b9-a938-1aa5bd632871' placement_group_model_json['lifecycle_state'] = 'stable' placement_group_model_json['name'] = 'my-placement-group' placement_group_model_json['resource_group'] = resource_group_reference_model @@ -66146,33 +69542,30 @@ def test_placement_group_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - placement_group_collection_first_model = {} # PlacementGroupCollectionFirst - placement_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=50' - - placement_group_collection_next_model = {} # PlacementGroupCollectionNext - placement_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=50' resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' - resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'Default' placement_group_model = {} # PlacementGroup placement_group_model['created_at'] = '2020-12-29T19:55:00Z' - placement_group_model['crn'] = 'crn:[...]' - placement_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871' - placement_group_model['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871' + placement_group_model['id'] = 'r006-418fe842-a3e9-47b9-a938-1aa5bd632871' placement_group_model['lifecycle_state'] = 'stable' - placement_group_model['name'] = 'my-updated-placement-group' + placement_group_model['name'] = 'my-placement-group' placement_group_model['resource_group'] = resource_group_reference_model placement_group_model['resource_type'] = 'placement_group' placement_group_model['strategy'] = 'host_spread' # Construct a json representation of a PlacementGroupCollection model placement_group_collection_model_json = {} - placement_group_collection_model_json['first'] = placement_group_collection_first_model + placement_group_collection_model_json['first'] = page_link_model placement_group_collection_model_json['limit'] = 20 - placement_group_collection_model_json['next'] = placement_group_collection_next_model + placement_group_collection_model_json['next'] = page_link_model placement_group_collection_model_json['placement_groups'] = [placement_group_model] placement_group_collection_model_json['total_count'] = 132 @@ -66192,66 +69585,6 @@ def test_placement_group_collection_serialization(self): assert placement_group_collection_model_json2 == placement_group_collection_model_json -class TestModel_PlacementGroupCollectionFirst: - """ - Test Class for PlacementGroupCollectionFirst - """ - - def test_placement_group_collection_first_serialization(self): - """ - Test serialization/deserialization for PlacementGroupCollectionFirst - """ - - # Construct a json representation of a PlacementGroupCollectionFirst model - placement_group_collection_first_model_json = {} - placement_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20' - - # Construct a model instance of PlacementGroupCollectionFirst by calling from_dict on the json representation - placement_group_collection_first_model = PlacementGroupCollectionFirst.from_dict(placement_group_collection_first_model_json) - assert placement_group_collection_first_model != False - - # Construct a model instance of PlacementGroupCollectionFirst by calling from_dict on the json representation - placement_group_collection_first_model_dict = PlacementGroupCollectionFirst.from_dict(placement_group_collection_first_model_json).__dict__ - placement_group_collection_first_model2 = PlacementGroupCollectionFirst(**placement_group_collection_first_model_dict) - - # Verify the model instances are equivalent - assert placement_group_collection_first_model == placement_group_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - placement_group_collection_first_model_json2 = placement_group_collection_first_model.to_dict() - assert placement_group_collection_first_model_json2 == placement_group_collection_first_model_json - - -class TestModel_PlacementGroupCollectionNext: - """ - Test Class for PlacementGroupCollectionNext - """ - - def test_placement_group_collection_next_serialization(self): - """ - Test serialization/deserialization for PlacementGroupCollectionNext - """ - - # Construct a json representation of a PlacementGroupCollectionNext model - placement_group_collection_next_model_json = {} - placement_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of PlacementGroupCollectionNext by calling from_dict on the json representation - placement_group_collection_next_model = PlacementGroupCollectionNext.from_dict(placement_group_collection_next_model_json) - assert placement_group_collection_next_model != False - - # Construct a model instance of PlacementGroupCollectionNext by calling from_dict on the json representation - placement_group_collection_next_model_dict = PlacementGroupCollectionNext.from_dict(placement_group_collection_next_model_json).__dict__ - placement_group_collection_next_model2 = PlacementGroupCollectionNext(**placement_group_collection_next_model_dict) - - # Verify the model instances are equivalent - assert placement_group_collection_next_model == placement_group_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - placement_group_collection_next_model_json2 = placement_group_collection_next_model.to_dict() - assert placement_group_collection_next_model_json2 == placement_group_collection_next_model_json - - class TestModel_PlacementGroupPatch: """ Test Class for PlacementGroupPatch @@ -66419,18 +69752,15 @@ def test_private_path_service_gateway_account_policy_collection_serialization(se private_path_service_gateway_account_policy_model['id'] = 'r134-fb880975-db45-4459-8548-64e3995ac213' private_path_service_gateway_account_policy_model['resource_type'] = 'private_path_service_gateway_account_policy' - private_path_service_gateway_account_policy_collection_first_model = {} # PrivatePathServiceGatewayAccountPolicyCollectionFirst - private_path_service_gateway_account_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?limit=20' - - private_path_service_gateway_account_policy_collection_next_model = {} # PrivatePathServiceGatewayAccountPolicyCollectionNext - private_path_service_gateway_account_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?limit=20' # Construct a json representation of a PrivatePathServiceGatewayAccountPolicyCollection model private_path_service_gateway_account_policy_collection_model_json = {} private_path_service_gateway_account_policy_collection_model_json['account_policies'] = [private_path_service_gateway_account_policy_model] - private_path_service_gateway_account_policy_collection_model_json['first'] = private_path_service_gateway_account_policy_collection_first_model + private_path_service_gateway_account_policy_collection_model_json['first'] = page_link_model private_path_service_gateway_account_policy_collection_model_json['limit'] = 20 - private_path_service_gateway_account_policy_collection_model_json['next'] = private_path_service_gateway_account_policy_collection_next_model + private_path_service_gateway_account_policy_collection_model_json['next'] = page_link_model private_path_service_gateway_account_policy_collection_model_json['total_count'] = 132 # Construct a model instance of PrivatePathServiceGatewayAccountPolicyCollection by calling from_dict on the json representation @@ -66449,66 +69779,6 @@ def test_private_path_service_gateway_account_policy_collection_serialization(se assert private_path_service_gateway_account_policy_collection_model_json2 == private_path_service_gateway_account_policy_collection_model_json -class TestModel_PrivatePathServiceGatewayAccountPolicyCollectionFirst: - """ - Test Class for PrivatePathServiceGatewayAccountPolicyCollectionFirst - """ - - def test_private_path_service_gateway_account_policy_collection_first_serialization(self): - """ - Test serialization/deserialization for PrivatePathServiceGatewayAccountPolicyCollectionFirst - """ - - # Construct a json representation of a PrivatePathServiceGatewayAccountPolicyCollectionFirst model - private_path_service_gateway_account_policy_collection_first_model_json = {} - private_path_service_gateway_account_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?limit=20' - - # Construct a model instance of PrivatePathServiceGatewayAccountPolicyCollectionFirst by calling from_dict on the json representation - private_path_service_gateway_account_policy_collection_first_model = PrivatePathServiceGatewayAccountPolicyCollectionFirst.from_dict(private_path_service_gateway_account_policy_collection_first_model_json) - assert private_path_service_gateway_account_policy_collection_first_model != False - - # Construct a model instance of PrivatePathServiceGatewayAccountPolicyCollectionFirst by calling from_dict on the json representation - private_path_service_gateway_account_policy_collection_first_model_dict = PrivatePathServiceGatewayAccountPolicyCollectionFirst.from_dict(private_path_service_gateway_account_policy_collection_first_model_json).__dict__ - private_path_service_gateway_account_policy_collection_first_model2 = PrivatePathServiceGatewayAccountPolicyCollectionFirst(**private_path_service_gateway_account_policy_collection_first_model_dict) - - # Verify the model instances are equivalent - assert private_path_service_gateway_account_policy_collection_first_model == private_path_service_gateway_account_policy_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - private_path_service_gateway_account_policy_collection_first_model_json2 = private_path_service_gateway_account_policy_collection_first_model.to_dict() - assert private_path_service_gateway_account_policy_collection_first_model_json2 == private_path_service_gateway_account_policy_collection_first_model_json - - -class TestModel_PrivatePathServiceGatewayAccountPolicyCollectionNext: - """ - Test Class for PrivatePathServiceGatewayAccountPolicyCollectionNext - """ - - def test_private_path_service_gateway_account_policy_collection_next_serialization(self): - """ - Test serialization/deserialization for PrivatePathServiceGatewayAccountPolicyCollectionNext - """ - - # Construct a json representation of a PrivatePathServiceGatewayAccountPolicyCollectionNext model - private_path_service_gateway_account_policy_collection_next_model_json = {} - private_path_service_gateway_account_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/account_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - - # Construct a model instance of PrivatePathServiceGatewayAccountPolicyCollectionNext by calling from_dict on the json representation - private_path_service_gateway_account_policy_collection_next_model = PrivatePathServiceGatewayAccountPolicyCollectionNext.from_dict(private_path_service_gateway_account_policy_collection_next_model_json) - assert private_path_service_gateway_account_policy_collection_next_model != False - - # Construct a model instance of PrivatePathServiceGatewayAccountPolicyCollectionNext by calling from_dict on the json representation - private_path_service_gateway_account_policy_collection_next_model_dict = PrivatePathServiceGatewayAccountPolicyCollectionNext.from_dict(private_path_service_gateway_account_policy_collection_next_model_json).__dict__ - private_path_service_gateway_account_policy_collection_next_model2 = PrivatePathServiceGatewayAccountPolicyCollectionNext(**private_path_service_gateway_account_policy_collection_next_model_dict) - - # Verify the model instances are equivalent - assert private_path_service_gateway_account_policy_collection_next_model == private_path_service_gateway_account_policy_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - private_path_service_gateway_account_policy_collection_next_model_json2 = private_path_service_gateway_account_policy_collection_next_model.to_dict() - assert private_path_service_gateway_account_policy_collection_next_model_json2 == private_path_service_gateway_account_policy_collection_next_model_json - - class TestModel_PrivatePathServiceGatewayAccountPolicyPatch: """ Test Class for PrivatePathServiceGatewayAccountPolicyPatch @@ -66551,11 +69821,8 @@ def test_private_path_service_gateway_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - private_path_service_gateway_collection_first_model = {} # PrivatePathServiceGatewayCollectionFirst - private_path_service_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?limit=20' - - private_path_service_gateway_collection_next_model = {} # PrivatePathServiceGatewayCollectionNext - private_path_service_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -66602,9 +69869,9 @@ def test_private_path_service_gateway_collection_serialization(self): # Construct a json representation of a PrivatePathServiceGatewayCollection model private_path_service_gateway_collection_model_json = {} - private_path_service_gateway_collection_model_json['first'] = private_path_service_gateway_collection_first_model + private_path_service_gateway_collection_model_json['first'] = page_link_model private_path_service_gateway_collection_model_json['limit'] = 20 - private_path_service_gateway_collection_model_json['next'] = private_path_service_gateway_collection_next_model + private_path_service_gateway_collection_model_json['next'] = page_link_model private_path_service_gateway_collection_model_json['private_path_service_gateways'] = [private_path_service_gateway_model] private_path_service_gateway_collection_model_json['total_count'] = 132 @@ -66624,66 +69891,6 @@ def test_private_path_service_gateway_collection_serialization(self): assert private_path_service_gateway_collection_model_json2 == private_path_service_gateway_collection_model_json -class TestModel_PrivatePathServiceGatewayCollectionFirst: - """ - Test Class for PrivatePathServiceGatewayCollectionFirst - """ - - def test_private_path_service_gateway_collection_first_serialization(self): - """ - Test serialization/deserialization for PrivatePathServiceGatewayCollectionFirst - """ - - # Construct a json representation of a PrivatePathServiceGatewayCollectionFirst model - private_path_service_gateway_collection_first_model_json = {} - private_path_service_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?limit=20' - - # Construct a model instance of PrivatePathServiceGatewayCollectionFirst by calling from_dict on the json representation - private_path_service_gateway_collection_first_model = PrivatePathServiceGatewayCollectionFirst.from_dict(private_path_service_gateway_collection_first_model_json) - assert private_path_service_gateway_collection_first_model != False - - # Construct a model instance of PrivatePathServiceGatewayCollectionFirst by calling from_dict on the json representation - private_path_service_gateway_collection_first_model_dict = PrivatePathServiceGatewayCollectionFirst.from_dict(private_path_service_gateway_collection_first_model_json).__dict__ - private_path_service_gateway_collection_first_model2 = PrivatePathServiceGatewayCollectionFirst(**private_path_service_gateway_collection_first_model_dict) - - # Verify the model instances are equivalent - assert private_path_service_gateway_collection_first_model == private_path_service_gateway_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - private_path_service_gateway_collection_first_model_json2 = private_path_service_gateway_collection_first_model.to_dict() - assert private_path_service_gateway_collection_first_model_json2 == private_path_service_gateway_collection_first_model_json - - -class TestModel_PrivatePathServiceGatewayCollectionNext: - """ - Test Class for PrivatePathServiceGatewayCollectionNext - """ - - def test_private_path_service_gateway_collection_next_serialization(self): - """ - Test serialization/deserialization for PrivatePathServiceGatewayCollectionNext - """ - - # Construct a json representation of a PrivatePathServiceGatewayCollectionNext model - private_path_service_gateway_collection_next_model_json = {} - private_path_service_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of PrivatePathServiceGatewayCollectionNext by calling from_dict on the json representation - private_path_service_gateway_collection_next_model = PrivatePathServiceGatewayCollectionNext.from_dict(private_path_service_gateway_collection_next_model_json) - assert private_path_service_gateway_collection_next_model != False - - # Construct a model instance of PrivatePathServiceGatewayCollectionNext by calling from_dict on the json representation - private_path_service_gateway_collection_next_model_dict = PrivatePathServiceGatewayCollectionNext.from_dict(private_path_service_gateway_collection_next_model_json).__dict__ - private_path_service_gateway_collection_next_model2 = PrivatePathServiceGatewayCollectionNext(**private_path_service_gateway_collection_next_model_dict) - - # Verify the model instances are equivalent - assert private_path_service_gateway_collection_next_model == private_path_service_gateway_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - private_path_service_gateway_collection_next_model_json2 = private_path_service_gateway_collection_next_model.to_dict() - assert private_path_service_gateway_collection_next_model_json2 == private_path_service_gateway_collection_next_model_json - - class TestModel_PrivatePathServiceGatewayEndpointGatewayBinding: """ Test Class for PrivatePathServiceGatewayEndpointGatewayBinding @@ -66753,18 +69960,15 @@ def test_private_path_service_gateway_endpoint_gateway_binding_collection_serial private_path_service_gateway_endpoint_gateway_binding_model['resource_type'] = 'private_path_service_gateway_endpoint_gateway_binding' private_path_service_gateway_endpoint_gateway_binding_model['status'] = 'abandoned' - private_path_service_gateway_endpoint_gateway_binding_collection_first_model = {} # PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst - private_path_service_gateway_endpoint_gateway_binding_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?limit=20' - - private_path_service_gateway_endpoint_gateway_binding_collection_next_model = {} # PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext - private_path_service_gateway_endpoint_gateway_binding_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?limit=20' # Construct a json representation of a PrivatePathServiceGatewayEndpointGatewayBindingCollection model private_path_service_gateway_endpoint_gateway_binding_collection_model_json = {} private_path_service_gateway_endpoint_gateway_binding_collection_model_json['endpoint_gateway_bindings'] = [private_path_service_gateway_endpoint_gateway_binding_model] - private_path_service_gateway_endpoint_gateway_binding_collection_model_json['first'] = private_path_service_gateway_endpoint_gateway_binding_collection_first_model + private_path_service_gateway_endpoint_gateway_binding_collection_model_json['first'] = page_link_model private_path_service_gateway_endpoint_gateway_binding_collection_model_json['limit'] = 20 - private_path_service_gateway_endpoint_gateway_binding_collection_model_json['next'] = private_path_service_gateway_endpoint_gateway_binding_collection_next_model + private_path_service_gateway_endpoint_gateway_binding_collection_model_json['next'] = page_link_model private_path_service_gateway_endpoint_gateway_binding_collection_model_json['total_count'] = 132 # Construct a model instance of PrivatePathServiceGatewayEndpointGatewayBindingCollection by calling from_dict on the json representation @@ -66783,66 +69987,6 @@ def test_private_path_service_gateway_endpoint_gateway_binding_collection_serial assert private_path_service_gateway_endpoint_gateway_binding_collection_model_json2 == private_path_service_gateway_endpoint_gateway_binding_collection_model_json -class TestModel_PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst: - """ - Test Class for PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst - """ - - def test_private_path_service_gateway_endpoint_gateway_binding_collection_first_serialization(self): - """ - Test serialization/deserialization for PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst - """ - - # Construct a json representation of a PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst model - private_path_service_gateway_endpoint_gateway_binding_collection_first_model_json = {} - private_path_service_gateway_endpoint_gateway_binding_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?limit=20' - - # Construct a model instance of PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst by calling from_dict on the json representation - private_path_service_gateway_endpoint_gateway_binding_collection_first_model = PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst.from_dict(private_path_service_gateway_endpoint_gateway_binding_collection_first_model_json) - assert private_path_service_gateway_endpoint_gateway_binding_collection_first_model != False - - # Construct a model instance of PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst by calling from_dict on the json representation - private_path_service_gateway_endpoint_gateway_binding_collection_first_model_dict = PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst.from_dict(private_path_service_gateway_endpoint_gateway_binding_collection_first_model_json).__dict__ - private_path_service_gateway_endpoint_gateway_binding_collection_first_model2 = PrivatePathServiceGatewayEndpointGatewayBindingCollectionFirst(**private_path_service_gateway_endpoint_gateway_binding_collection_first_model_dict) - - # Verify the model instances are equivalent - assert private_path_service_gateway_endpoint_gateway_binding_collection_first_model == private_path_service_gateway_endpoint_gateway_binding_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - private_path_service_gateway_endpoint_gateway_binding_collection_first_model_json2 = private_path_service_gateway_endpoint_gateway_binding_collection_first_model.to_dict() - assert private_path_service_gateway_endpoint_gateway_binding_collection_first_model_json2 == private_path_service_gateway_endpoint_gateway_binding_collection_first_model_json - - -class TestModel_PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext: - """ - Test Class for PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext - """ - - def test_private_path_service_gateway_endpoint_gateway_binding_collection_next_serialization(self): - """ - Test serialization/deserialization for PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext - """ - - # Construct a json representation of a PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext model - private_path_service_gateway_endpoint_gateway_binding_collection_next_model_json = {} - private_path_service_gateway_endpoint_gateway_binding_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/65f30e48-3074-4eb0-9ec4-51ce2ec968eb/endpoint_gateway_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - - # Construct a model instance of PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext by calling from_dict on the json representation - private_path_service_gateway_endpoint_gateway_binding_collection_next_model = PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext.from_dict(private_path_service_gateway_endpoint_gateway_binding_collection_next_model_json) - assert private_path_service_gateway_endpoint_gateway_binding_collection_next_model != False - - # Construct a model instance of PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext by calling from_dict on the json representation - private_path_service_gateway_endpoint_gateway_binding_collection_next_model_dict = PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext.from_dict(private_path_service_gateway_endpoint_gateway_binding_collection_next_model_json).__dict__ - private_path_service_gateway_endpoint_gateway_binding_collection_next_model2 = PrivatePathServiceGatewayEndpointGatewayBindingCollectionNext(**private_path_service_gateway_endpoint_gateway_binding_collection_next_model_dict) - - # Verify the model instances are equivalent - assert private_path_service_gateway_endpoint_gateway_binding_collection_next_model == private_path_service_gateway_endpoint_gateway_binding_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - private_path_service_gateway_endpoint_gateway_binding_collection_next_model_json2 = private_path_service_gateway_endpoint_gateway_binding_collection_next_model.to_dict() - assert private_path_service_gateway_endpoint_gateway_binding_collection_next_model_json2 == private_path_service_gateway_endpoint_gateway_binding_collection_next_model_json - - class TestModel_PrivatePathServiceGatewayPatch: """ Test Class for PrivatePathServiceGatewayPatch @@ -66939,10 +70083,10 @@ def test_public_gateway_serialization(self): public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp public_gateway_floating_ip_model['address'] = '203.0.113.1' - public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' public_gateway_floating_ip_model['deleted'] = deleted_model - public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + public_gateway_floating_ip_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' public_gateway_floating_ip_model['name'] = 'my-floating-ip' resource_group_reference_model = {} # ResourceGroupReference @@ -67004,21 +70148,18 @@ def test_public_gateway_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - public_gateway_collection_first_model = {} # PublicGatewayCollectionFirst - public_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20' - - public_gateway_collection_next_model = {} # PublicGatewayCollectionNext - public_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp public_gateway_floating_ip_model['address'] = '203.0.113.1' - public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' public_gateway_floating_ip_model['deleted'] = deleted_model - public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + public_gateway_floating_ip_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' public_gateway_floating_ip_model['name'] = 'my-floating-ip' resource_group_reference_model = {} # ResourceGroupReference @@ -67053,9 +70194,9 @@ def test_public_gateway_collection_serialization(self): # Construct a json representation of a PublicGatewayCollection model public_gateway_collection_model_json = {} - public_gateway_collection_model_json['first'] = public_gateway_collection_first_model + public_gateway_collection_model_json['first'] = page_link_model public_gateway_collection_model_json['limit'] = 20 - public_gateway_collection_model_json['next'] = public_gateway_collection_next_model + public_gateway_collection_model_json['next'] = page_link_model public_gateway_collection_model_json['public_gateways'] = [public_gateway_model] public_gateway_collection_model_json['total_count'] = 132 @@ -67075,66 +70216,6 @@ def test_public_gateway_collection_serialization(self): assert public_gateway_collection_model_json2 == public_gateway_collection_model_json -class TestModel_PublicGatewayCollectionFirst: - """ - Test Class for PublicGatewayCollectionFirst - """ - - def test_public_gateway_collection_first_serialization(self): - """ - Test serialization/deserialization for PublicGatewayCollectionFirst - """ - - # Construct a json representation of a PublicGatewayCollectionFirst model - public_gateway_collection_first_model_json = {} - public_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20' - - # Construct a model instance of PublicGatewayCollectionFirst by calling from_dict on the json representation - public_gateway_collection_first_model = PublicGatewayCollectionFirst.from_dict(public_gateway_collection_first_model_json) - assert public_gateway_collection_first_model != False - - # Construct a model instance of PublicGatewayCollectionFirst by calling from_dict on the json representation - public_gateway_collection_first_model_dict = PublicGatewayCollectionFirst.from_dict(public_gateway_collection_first_model_json).__dict__ - public_gateway_collection_first_model2 = PublicGatewayCollectionFirst(**public_gateway_collection_first_model_dict) - - # Verify the model instances are equivalent - assert public_gateway_collection_first_model == public_gateway_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - public_gateway_collection_first_model_json2 = public_gateway_collection_first_model.to_dict() - assert public_gateway_collection_first_model_json2 == public_gateway_collection_first_model_json - - -class TestModel_PublicGatewayCollectionNext: - """ - Test Class for PublicGatewayCollectionNext - """ - - def test_public_gateway_collection_next_serialization(self): - """ - Test serialization/deserialization for PublicGatewayCollectionNext - """ - - # Construct a json representation of a PublicGatewayCollectionNext model - public_gateway_collection_next_model_json = {} - public_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of PublicGatewayCollectionNext by calling from_dict on the json representation - public_gateway_collection_next_model = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json) - assert public_gateway_collection_next_model != False - - # Construct a model instance of PublicGatewayCollectionNext by calling from_dict on the json representation - public_gateway_collection_next_model_dict = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json).__dict__ - public_gateway_collection_next_model2 = PublicGatewayCollectionNext(**public_gateway_collection_next_model_dict) - - # Verify the model instances are equivalent - assert public_gateway_collection_next_model == public_gateway_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - public_gateway_collection_next_model_json2 = public_gateway_collection_next_model.to_dict() - assert public_gateway_collection_next_model_json2 == public_gateway_collection_next_model_json - - class TestModel_PublicGatewayFloatingIp: """ Test Class for PublicGatewayFloatingIp @@ -67153,10 +70234,10 @@ def test_public_gateway_floating_ip_serialization(self): # Construct a json representation of a PublicGatewayFloatingIp model public_gateway_floating_ip_model_json = {} public_gateway_floating_ip_model_json['address'] = '203.0.113.1' - public_gateway_floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' public_gateway_floating_ip_model_json['deleted'] = deleted_model - public_gateway_floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - public_gateway_floating_ip_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + public_gateway_floating_ip_model_json['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' public_gateway_floating_ip_model_json['name'] = 'my-floating-ip' # Construct a model instance of PublicGatewayFloatingIp by calling from_dict on the json representation @@ -67291,7 +70372,7 @@ def test_region_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. region_model = {} # Region - region_model['endpoint'] = 'https://eu-gb.iaas.cloud.ibm.com' + region_model['endpoint'] = 'https://us-south.iaas.cloud.ibm.com' region_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south' region_model['name'] = 'us-south' region_model['status'] = 'available' @@ -67372,13 +70453,13 @@ def test_reservation_serialization(self): reservation_committed_use_model['term'] = 'one_year' reservation_profile_model = {} # ReservationProfile - reservation_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8' - reservation_profile_model['name'] = 'bx2-2x8' + reservation_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + reservation_profile_model['name'] = 'bx2-4x16' reservation_profile_model['resource_type'] = 'instance_profile' resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' - resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'Default' reservation_status_reason_model = {} # ReservationStatusReason @@ -67396,9 +70477,9 @@ def test_reservation_serialization(self): reservation_model_json['capacity'] = reservation_capacity_model reservation_model_json['committed_use'] = reservation_committed_use_model reservation_model_json['created_at'] = '2019-01-01T12:00:00Z' - reservation_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63' - reservation_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63' - reservation_model_json['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_model_json['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_model_json['lifecycle_state'] = 'stable' reservation_model_json['name'] = 'my-reservation' reservation_model_json['profile'] = reservation_profile_model @@ -67530,11 +70611,8 @@ def test_reservation_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - reservation_collection_first_model = {} # ReservationCollectionFirst - reservation_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=50' - - reservation_collection_next_model = {} # ReservationCollectionNext - reservation_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=50' reservation_capacity_model = {} # ReservationCapacity reservation_capacity_model['allocated'] = 10 @@ -67549,13 +70627,13 @@ def test_reservation_collection_serialization(self): reservation_committed_use_model['term'] = 'one_year' reservation_profile_model = {} # ReservationProfile - reservation_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8' - reservation_profile_model['name'] = 'bx2-2x8' + reservation_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + reservation_profile_model['name'] = 'bx2-4x16' reservation_profile_model['resource_type'] = 'instance_profile' resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' - resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'Default' reservation_status_reason_model = {} # ReservationStatusReason @@ -67572,9 +70650,9 @@ def test_reservation_collection_serialization(self): reservation_model['capacity'] = reservation_capacity_model reservation_model['committed_use'] = reservation_committed_use_model reservation_model['created_at'] = '2020-12-29T19:55:00Z' - reservation_model['crn'] = 'crn:[...]' - reservation_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63' - reservation_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_model['lifecycle_state'] = 'stable' reservation_model['name'] = 'my-reservation' reservation_model['profile'] = reservation_profile_model @@ -67586,9 +70664,9 @@ def test_reservation_collection_serialization(self): # Construct a json representation of a ReservationCollection model reservation_collection_model_json = {} - reservation_collection_model_json['first'] = reservation_collection_first_model + reservation_collection_model_json['first'] = page_link_model reservation_collection_model_json['limit'] = 20 - reservation_collection_model_json['next'] = reservation_collection_next_model + reservation_collection_model_json['next'] = page_link_model reservation_collection_model_json['reservations'] = [reservation_model] reservation_collection_model_json['total_count'] = 132 @@ -67608,66 +70686,6 @@ def test_reservation_collection_serialization(self): assert reservation_collection_model_json2 == reservation_collection_model_json -class TestModel_ReservationCollectionFirst: - """ - Test Class for ReservationCollectionFirst - """ - - def test_reservation_collection_first_serialization(self): - """ - Test serialization/deserialization for ReservationCollectionFirst - """ - - # Construct a json representation of a ReservationCollectionFirst model - reservation_collection_first_model_json = {} - reservation_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=20' - - # Construct a model instance of ReservationCollectionFirst by calling from_dict on the json representation - reservation_collection_first_model = ReservationCollectionFirst.from_dict(reservation_collection_first_model_json) - assert reservation_collection_first_model != False - - # Construct a model instance of ReservationCollectionFirst by calling from_dict on the json representation - reservation_collection_first_model_dict = ReservationCollectionFirst.from_dict(reservation_collection_first_model_json).__dict__ - reservation_collection_first_model2 = ReservationCollectionFirst(**reservation_collection_first_model_dict) - - # Verify the model instances are equivalent - assert reservation_collection_first_model == reservation_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - reservation_collection_first_model_json2 = reservation_collection_first_model.to_dict() - assert reservation_collection_first_model_json2 == reservation_collection_first_model_json - - -class TestModel_ReservationCollectionNext: - """ - Test Class for ReservationCollectionNext - """ - - def test_reservation_collection_next_serialization(self): - """ - Test serialization/deserialization for ReservationCollectionNext - """ - - # Construct a json representation of a ReservationCollectionNext model - reservation_collection_next_model_json = {} - reservation_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of ReservationCollectionNext by calling from_dict on the json representation - reservation_collection_next_model = ReservationCollectionNext.from_dict(reservation_collection_next_model_json) - assert reservation_collection_next_model != False - - # Construct a model instance of ReservationCollectionNext by calling from_dict on the json representation - reservation_collection_next_model_dict = ReservationCollectionNext.from_dict(reservation_collection_next_model_json).__dict__ - reservation_collection_next_model2 = ReservationCollectionNext(**reservation_collection_next_model_dict) - - # Verify the model instances are equivalent - assert reservation_collection_next_model == reservation_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - reservation_collection_next_model_json2 = reservation_collection_next_model.to_dict() - assert reservation_collection_next_model_json2 == reservation_collection_next_model_json - - class TestModel_ReservationCommittedUse: """ Test Class for ReservationCommittedUse @@ -67919,10 +70937,10 @@ def test_reservation_reference_serialization(self): # Construct a json representation of a ReservationReference model reservation_reference_model_json = {} - reservation_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_reference_model_json['deleted'] = deleted_model - reservation_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63' - reservation_reference_model_json['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_reference_model_json['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' reservation_reference_model_json['name'] = 'my-reservation' reservation_reference_model_json['resource_type'] = 'reservation' @@ -68038,11 +71056,8 @@ def test_reserved_ip_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_collection_first_model = {} # ReservedIPCollectionFirst - reserved_ip_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20' - - reserved_ip_collection_next_model = {} # ReservedIPCollectionNext - reserved_ip_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips?limit=50' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -68056,22 +71071,22 @@ def test_reserved_ip_collection_serialization(self): reserved_ip_target_model['resource_type'] = 'endpoint_gateway' reserved_ip_model = {} # ReservedIP - reserved_ip_model['address'] = '192.168.3.4' + reserved_ip_model['address'] = '10.0.1.5' reserved_ip_model['auto_delete'] = False - reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z' - reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['created_at'] = '2024-10-15T19:52:13Z' + reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['lifecycle_state'] = 'stable' reserved_ip_model['name'] = 'my-reserved-ip' - reserved_ip_model['owner'] = 'provider' + reserved_ip_model['owner'] = 'user' reserved_ip_model['resource_type'] = 'subnet_reserved_ip' reserved_ip_model['target'] = reserved_ip_target_model # Construct a json representation of a ReservedIPCollection model reserved_ip_collection_model_json = {} - reserved_ip_collection_model_json['first'] = reserved_ip_collection_first_model + reserved_ip_collection_model_json['first'] = page_link_model reserved_ip_collection_model_json['limit'] = 20 - reserved_ip_collection_model_json['next'] = reserved_ip_collection_next_model + reserved_ip_collection_model_json['next'] = page_link_model reserved_ip_collection_model_json['reserved_ips'] = [reserved_ip_model] reserved_ip_collection_model_json['total_count'] = 132 @@ -68103,8 +71118,8 @@ def test_reserved_ip_collection_bare_metal_server_network_interface_context_seri # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_collection_bare_metal_server_network_interface_context_first_model = {} # ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst - reserved_ip_collection_bare_metal_server_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6/ips?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -68112,32 +71127,29 @@ def test_reserved_ip_collection_bare_metal_server_network_interface_context_seri reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5' reserved_ip_target_model['deleted'] = deleted_model - reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5' - reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5' - reserved_ip_target_model['name'] = 'my-endpoint-gateway' - reserved_ip_target_model['resource_type'] = 'endpoint_gateway' + reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + reserved_ip_target_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + reserved_ip_target_model['name'] = 'my-primary-network-interface' + reserved_ip_target_model['resource_type'] = 'network_interface' reserved_ip_model = {} # ReservedIP - reserved_ip_model['address'] = '192.168.3.4' + reserved_ip_model['address'] = '10.0.1.5' reserved_ip_model['auto_delete'] = False - reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z' - reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['created_at'] = '2024-10-15T19:52:13Z' + reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['lifecycle_state'] = 'stable' reserved_ip_model['name'] = 'my-reserved-ip' - reserved_ip_model['owner'] = 'provider' + reserved_ip_model['owner'] = 'user' reserved_ip_model['resource_type'] = 'subnet_reserved_ip' reserved_ip_model['target'] = reserved_ip_target_model - reserved_ip_collection_bare_metal_server_network_interface_context_next_model = {} # ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext - reserved_ip_collection_bare_metal_server_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' - # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContext model reserved_ip_collection_bare_metal_server_network_interface_context_model_json = {} - reserved_ip_collection_bare_metal_server_network_interface_context_model_json['first'] = reserved_ip_collection_bare_metal_server_network_interface_context_first_model + reserved_ip_collection_bare_metal_server_network_interface_context_model_json['first'] = page_link_model reserved_ip_collection_bare_metal_server_network_interface_context_model_json['ips'] = [reserved_ip_model] reserved_ip_collection_bare_metal_server_network_interface_context_model_json['limit'] = 20 - reserved_ip_collection_bare_metal_server_network_interface_context_model_json['next'] = reserved_ip_collection_bare_metal_server_network_interface_context_next_model + reserved_ip_collection_bare_metal_server_network_interface_context_model_json['next'] = page_link_model reserved_ip_collection_bare_metal_server_network_interface_context_model_json['total_count'] = 132 # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContext by calling from_dict on the json representation @@ -68156,66 +71168,6 @@ def test_reserved_ip_collection_bare_metal_server_network_interface_context_seri assert reserved_ip_collection_bare_metal_server_network_interface_context_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_model_json -class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst: - """ - Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst - """ - - def test_reserved_ip_collection_bare_metal_server_network_interface_context_first_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst - """ - - # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst model - reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json = {} - reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' - - # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst by calling from_dict on the json representation - reserved_ip_collection_bare_metal_server_network_interface_context_first_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json) - assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model != False - - # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst by calling from_dict on the json representation - reserved_ip_collection_bare_metal_server_network_interface_context_first_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json).__dict__ - reserved_ip_collection_bare_metal_server_network_interface_context_first_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst(**reserved_ip_collection_bare_metal_server_network_interface_context_first_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model == reserved_ip_collection_bare_metal_server_network_interface_context_first_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_first_model.to_dict() - assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json - - -class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext: - """ - Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext - """ - - def test_reserved_ip_collection_bare_metal_server_network_interface_context_next_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext - """ - - # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext model - reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json = {} - reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' - - # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext by calling from_dict on the json representation - reserved_ip_collection_bare_metal_server_network_interface_context_next_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json) - assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model != False - - # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext by calling from_dict on the json representation - reserved_ip_collection_bare_metal_server_network_interface_context_next_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json).__dict__ - reserved_ip_collection_bare_metal_server_network_interface_context_next_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext(**reserved_ip_collection_bare_metal_server_network_interface_context_next_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model == reserved_ip_collection_bare_metal_server_network_interface_context_next_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_next_model.to_dict() - assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json - - class TestModel_ReservedIPCollectionEndpointGatewayContext: """ Test Class for ReservedIPCollectionEndpointGatewayContext @@ -68228,8 +71180,8 @@ def test_reserved_ip_collection_endpoint_gateway_context_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_collection_endpoint_gateway_context_first_model = {} # ReservedIPCollectionEndpointGatewayContextFirst - reserved_ip_collection_endpoint_gateway_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -68254,15 +71206,12 @@ def test_reserved_ip_collection_endpoint_gateway_context_serialization(self): reserved_ip_model['resource_type'] = 'subnet_reserved_ip' reserved_ip_model['target'] = reserved_ip_target_model - reserved_ip_collection_endpoint_gateway_context_next_model = {} # ReservedIPCollectionEndpointGatewayContextNext - reserved_ip_collection_endpoint_gateway_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20' - # Construct a json representation of a ReservedIPCollectionEndpointGatewayContext model reserved_ip_collection_endpoint_gateway_context_model_json = {} - reserved_ip_collection_endpoint_gateway_context_model_json['first'] = reserved_ip_collection_endpoint_gateway_context_first_model + reserved_ip_collection_endpoint_gateway_context_model_json['first'] = page_link_model reserved_ip_collection_endpoint_gateway_context_model_json['ips'] = [reserved_ip_model] reserved_ip_collection_endpoint_gateway_context_model_json['limit'] = 20 - reserved_ip_collection_endpoint_gateway_context_model_json['next'] = reserved_ip_collection_endpoint_gateway_context_next_model + reserved_ip_collection_endpoint_gateway_context_model_json['next'] = page_link_model reserved_ip_collection_endpoint_gateway_context_model_json['total_count'] = 132 # Construct a model instance of ReservedIPCollectionEndpointGatewayContext by calling from_dict on the json representation @@ -68281,96 +71230,6 @@ def test_reserved_ip_collection_endpoint_gateway_context_serialization(self): assert reserved_ip_collection_endpoint_gateway_context_model_json2 == reserved_ip_collection_endpoint_gateway_context_model_json -class TestModel_ReservedIPCollectionEndpointGatewayContextFirst: - """ - Test Class for ReservedIPCollectionEndpointGatewayContextFirst - """ - - def test_reserved_ip_collection_endpoint_gateway_context_first_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextFirst - """ - - # Construct a json representation of a ReservedIPCollectionEndpointGatewayContextFirst model - reserved_ip_collection_endpoint_gateway_context_first_model_json = {} - reserved_ip_collection_endpoint_gateway_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20' - - # Construct a model instance of ReservedIPCollectionEndpointGatewayContextFirst by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_first_model = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(reserved_ip_collection_endpoint_gateway_context_first_model_json) - assert reserved_ip_collection_endpoint_gateway_context_first_model != False - - # Construct a model instance of ReservedIPCollectionEndpointGatewayContextFirst by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_first_model_dict = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(reserved_ip_collection_endpoint_gateway_context_first_model_json).__dict__ - reserved_ip_collection_endpoint_gateway_context_first_model2 = ReservedIPCollectionEndpointGatewayContextFirst(**reserved_ip_collection_endpoint_gateway_context_first_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_endpoint_gateway_context_first_model == reserved_ip_collection_endpoint_gateway_context_first_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_endpoint_gateway_context_first_model_json2 = reserved_ip_collection_endpoint_gateway_context_first_model.to_dict() - assert reserved_ip_collection_endpoint_gateway_context_first_model_json2 == reserved_ip_collection_endpoint_gateway_context_first_model_json - - -class TestModel_ReservedIPCollectionEndpointGatewayContextNext: - """ - Test Class for ReservedIPCollectionEndpointGatewayContextNext - """ - - def test_reserved_ip_collection_endpoint_gateway_context_next_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextNext - """ - - # Construct a json representation of a ReservedIPCollectionEndpointGatewayContextNext model - reserved_ip_collection_endpoint_gateway_context_next_model_json = {} - reserved_ip_collection_endpoint_gateway_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20' - - # Construct a model instance of ReservedIPCollectionEndpointGatewayContextNext by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_next_model = ReservedIPCollectionEndpointGatewayContextNext.from_dict(reserved_ip_collection_endpoint_gateway_context_next_model_json) - assert reserved_ip_collection_endpoint_gateway_context_next_model != False - - # Construct a model instance of ReservedIPCollectionEndpointGatewayContextNext by calling from_dict on the json representation - reserved_ip_collection_endpoint_gateway_context_next_model_dict = ReservedIPCollectionEndpointGatewayContextNext.from_dict(reserved_ip_collection_endpoint_gateway_context_next_model_json).__dict__ - reserved_ip_collection_endpoint_gateway_context_next_model2 = ReservedIPCollectionEndpointGatewayContextNext(**reserved_ip_collection_endpoint_gateway_context_next_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_endpoint_gateway_context_next_model == reserved_ip_collection_endpoint_gateway_context_next_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_endpoint_gateway_context_next_model_json2 = reserved_ip_collection_endpoint_gateway_context_next_model.to_dict() - assert reserved_ip_collection_endpoint_gateway_context_next_model_json2 == reserved_ip_collection_endpoint_gateway_context_next_model_json - - -class TestModel_ReservedIPCollectionFirst: - """ - Test Class for ReservedIPCollectionFirst - """ - - def test_reserved_ip_collection_first_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionFirst - """ - - # Construct a json representation of a ReservedIPCollectionFirst model - reserved_ip_collection_first_model_json = {} - reserved_ip_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20' - - # Construct a model instance of ReservedIPCollectionFirst by calling from_dict on the json representation - reserved_ip_collection_first_model = ReservedIPCollectionFirst.from_dict(reserved_ip_collection_first_model_json) - assert reserved_ip_collection_first_model != False - - # Construct a model instance of ReservedIPCollectionFirst by calling from_dict on the json representation - reserved_ip_collection_first_model_dict = ReservedIPCollectionFirst.from_dict(reserved_ip_collection_first_model_json).__dict__ - reserved_ip_collection_first_model2 = ReservedIPCollectionFirst(**reserved_ip_collection_first_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_first_model == reserved_ip_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_first_model_json2 = reserved_ip_collection_first_model.to_dict() - assert reserved_ip_collection_first_model_json2 == reserved_ip_collection_first_model_json - - class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContext: """ Test Class for ReservedIPCollectionInstanceNetworkInterfaceContext @@ -68383,8 +71242,8 @@ def test_reserved_ip_collection_instance_network_interface_context_serialization # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_collection_instance_network_interface_context_first_model = {} # ReservedIPCollectionInstanceNetworkInterfaceContextFirst - reserved_ip_collection_instance_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7/ips?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -68409,15 +71268,12 @@ def test_reserved_ip_collection_instance_network_interface_context_serialization reserved_ip_model['resource_type'] = 'subnet_reserved_ip' reserved_ip_model['target'] = reserved_ip_target_model - reserved_ip_collection_instance_network_interface_context_next_model = {} # ReservedIPCollectionInstanceNetworkInterfaceContextNext - reserved_ip_collection_instance_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' - # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContext model reserved_ip_collection_instance_network_interface_context_model_json = {} - reserved_ip_collection_instance_network_interface_context_model_json['first'] = reserved_ip_collection_instance_network_interface_context_first_model + reserved_ip_collection_instance_network_interface_context_model_json['first'] = page_link_model reserved_ip_collection_instance_network_interface_context_model_json['ips'] = [reserved_ip_model] reserved_ip_collection_instance_network_interface_context_model_json['limit'] = 20 - reserved_ip_collection_instance_network_interface_context_model_json['next'] = reserved_ip_collection_instance_network_interface_context_next_model + reserved_ip_collection_instance_network_interface_context_model_json['next'] = page_link_model reserved_ip_collection_instance_network_interface_context_model_json['total_count'] = 132 # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContext by calling from_dict on the json representation @@ -68436,96 +71292,6 @@ def test_reserved_ip_collection_instance_network_interface_context_serialization assert reserved_ip_collection_instance_network_interface_context_model_json2 == reserved_ip_collection_instance_network_interface_context_model_json -class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContextFirst: - """ - Test Class for ReservedIPCollectionInstanceNetworkInterfaceContextFirst - """ - - def test_reserved_ip_collection_instance_network_interface_context_first_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContextFirst - """ - - # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContextFirst model - reserved_ip_collection_instance_network_interface_context_first_model_json = {} - reserved_ip_collection_instance_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' - - # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst by calling from_dict on the json representation - reserved_ip_collection_instance_network_interface_context_first_model = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_instance_network_interface_context_first_model_json) - assert reserved_ip_collection_instance_network_interface_context_first_model != False - - # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst by calling from_dict on the json representation - reserved_ip_collection_instance_network_interface_context_first_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_instance_network_interface_context_first_model_json).__dict__ - reserved_ip_collection_instance_network_interface_context_first_model2 = ReservedIPCollectionInstanceNetworkInterfaceContextFirst(**reserved_ip_collection_instance_network_interface_context_first_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_instance_network_interface_context_first_model == reserved_ip_collection_instance_network_interface_context_first_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_instance_network_interface_context_first_model_json2 = reserved_ip_collection_instance_network_interface_context_first_model.to_dict() - assert reserved_ip_collection_instance_network_interface_context_first_model_json2 == reserved_ip_collection_instance_network_interface_context_first_model_json - - -class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContextNext: - """ - Test Class for ReservedIPCollectionInstanceNetworkInterfaceContextNext - """ - - def test_reserved_ip_collection_instance_network_interface_context_next_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContextNext - """ - - # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContextNext model - reserved_ip_collection_instance_network_interface_context_next_model_json = {} - reserved_ip_collection_instance_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' - - # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext by calling from_dict on the json representation - reserved_ip_collection_instance_network_interface_context_next_model = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(reserved_ip_collection_instance_network_interface_context_next_model_json) - assert reserved_ip_collection_instance_network_interface_context_next_model != False - - # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext by calling from_dict on the json representation - reserved_ip_collection_instance_network_interface_context_next_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(reserved_ip_collection_instance_network_interface_context_next_model_json).__dict__ - reserved_ip_collection_instance_network_interface_context_next_model2 = ReservedIPCollectionInstanceNetworkInterfaceContextNext(**reserved_ip_collection_instance_network_interface_context_next_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_instance_network_interface_context_next_model == reserved_ip_collection_instance_network_interface_context_next_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_instance_network_interface_context_next_model_json2 = reserved_ip_collection_instance_network_interface_context_next_model.to_dict() - assert reserved_ip_collection_instance_network_interface_context_next_model_json2 == reserved_ip_collection_instance_network_interface_context_next_model_json - - -class TestModel_ReservedIPCollectionNext: - """ - Test Class for ReservedIPCollectionNext - """ - - def test_reserved_ip_collection_next_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionNext - """ - - # Construct a json representation of a ReservedIPCollectionNext model - reserved_ip_collection_next_model_json = {} - reserved_ip_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of ReservedIPCollectionNext by calling from_dict on the json representation - reserved_ip_collection_next_model = ReservedIPCollectionNext.from_dict(reserved_ip_collection_next_model_json) - assert reserved_ip_collection_next_model != False - - # Construct a model instance of ReservedIPCollectionNext by calling from_dict on the json representation - reserved_ip_collection_next_model_dict = ReservedIPCollectionNext.from_dict(reserved_ip_collection_next_model_json).__dict__ - reserved_ip_collection_next_model2 = ReservedIPCollectionNext(**reserved_ip_collection_next_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_next_model == reserved_ip_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_next_model_json2 = reserved_ip_collection_next_model.to_dict() - assert reserved_ip_collection_next_model_json2 == reserved_ip_collection_next_model_json - - class TestModel_ReservedIPCollectionVirtualNetworkInterfaceContext: """ Test Class for ReservedIPCollectionVirtualNetworkInterfaceContext @@ -68538,8 +71304,8 @@ def test_reserved_ip_collection_virtual_network_interface_context_serialization( # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_collection_virtual_network_interface_context_first_model = {} # ReservedIPCollectionVirtualNetworkInterfaceContextFirst - reserved_ip_collection_virtual_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7/ips?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -68552,15 +71318,12 @@ def test_reserved_ip_collection_virtual_network_interface_context_serialization( reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' - reserved_ip_collection_virtual_network_interface_context_next_model = {} # ReservedIPCollectionVirtualNetworkInterfaceContextNext - reserved_ip_collection_virtual_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' - # Construct a json representation of a ReservedIPCollectionVirtualNetworkInterfaceContext model reserved_ip_collection_virtual_network_interface_context_model_json = {} - reserved_ip_collection_virtual_network_interface_context_model_json['first'] = reserved_ip_collection_virtual_network_interface_context_first_model + reserved_ip_collection_virtual_network_interface_context_model_json['first'] = page_link_model reserved_ip_collection_virtual_network_interface_context_model_json['ips'] = [reserved_ip_reference_model] reserved_ip_collection_virtual_network_interface_context_model_json['limit'] = 20 - reserved_ip_collection_virtual_network_interface_context_model_json['next'] = reserved_ip_collection_virtual_network_interface_context_next_model + reserved_ip_collection_virtual_network_interface_context_model_json['next'] = page_link_model reserved_ip_collection_virtual_network_interface_context_model_json['total_count'] = 132 # Construct a model instance of ReservedIPCollectionVirtualNetworkInterfaceContext by calling from_dict on the json representation @@ -68579,66 +71342,6 @@ def test_reserved_ip_collection_virtual_network_interface_context_serialization( assert reserved_ip_collection_virtual_network_interface_context_model_json2 == reserved_ip_collection_virtual_network_interface_context_model_json -class TestModel_ReservedIPCollectionVirtualNetworkInterfaceContextFirst: - """ - Test Class for ReservedIPCollectionVirtualNetworkInterfaceContextFirst - """ - - def test_reserved_ip_collection_virtual_network_interface_context_first_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionVirtualNetworkInterfaceContextFirst - """ - - # Construct a json representation of a ReservedIPCollectionVirtualNetworkInterfaceContextFirst model - reserved_ip_collection_virtual_network_interface_context_first_model_json = {} - reserved_ip_collection_virtual_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' - - # Construct a model instance of ReservedIPCollectionVirtualNetworkInterfaceContextFirst by calling from_dict on the json representation - reserved_ip_collection_virtual_network_interface_context_first_model = ReservedIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_virtual_network_interface_context_first_model_json) - assert reserved_ip_collection_virtual_network_interface_context_first_model != False - - # Construct a model instance of ReservedIPCollectionVirtualNetworkInterfaceContextFirst by calling from_dict on the json representation - reserved_ip_collection_virtual_network_interface_context_first_model_dict = ReservedIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_virtual_network_interface_context_first_model_json).__dict__ - reserved_ip_collection_virtual_network_interface_context_first_model2 = ReservedIPCollectionVirtualNetworkInterfaceContextFirst(**reserved_ip_collection_virtual_network_interface_context_first_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_virtual_network_interface_context_first_model == reserved_ip_collection_virtual_network_interface_context_first_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_virtual_network_interface_context_first_model_json2 = reserved_ip_collection_virtual_network_interface_context_first_model.to_dict() - assert reserved_ip_collection_virtual_network_interface_context_first_model_json2 == reserved_ip_collection_virtual_network_interface_context_first_model_json - - -class TestModel_ReservedIPCollectionVirtualNetworkInterfaceContextNext: - """ - Test Class for ReservedIPCollectionVirtualNetworkInterfaceContextNext - """ - - def test_reserved_ip_collection_virtual_network_interface_context_next_serialization(self): - """ - Test serialization/deserialization for ReservedIPCollectionVirtualNetworkInterfaceContextNext - """ - - # Construct a json representation of a ReservedIPCollectionVirtualNetworkInterfaceContextNext model - reserved_ip_collection_virtual_network_interface_context_next_model_json = {} - reserved_ip_collection_virtual_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' - - # Construct a model instance of ReservedIPCollectionVirtualNetworkInterfaceContextNext by calling from_dict on the json representation - reserved_ip_collection_virtual_network_interface_context_next_model = ReservedIPCollectionVirtualNetworkInterfaceContextNext.from_dict(reserved_ip_collection_virtual_network_interface_context_next_model_json) - assert reserved_ip_collection_virtual_network_interface_context_next_model != False - - # Construct a model instance of ReservedIPCollectionVirtualNetworkInterfaceContextNext by calling from_dict on the json representation - reserved_ip_collection_virtual_network_interface_context_next_model_dict = ReservedIPCollectionVirtualNetworkInterfaceContextNext.from_dict(reserved_ip_collection_virtual_network_interface_context_next_model_json).__dict__ - reserved_ip_collection_virtual_network_interface_context_next_model2 = ReservedIPCollectionVirtualNetworkInterfaceContextNext(**reserved_ip_collection_virtual_network_interface_context_next_model_dict) - - # Verify the model instances are equivalent - assert reserved_ip_collection_virtual_network_interface_context_next_model == reserved_ip_collection_virtual_network_interface_context_next_model2 - - # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_virtual_network_interface_context_next_model_json2 = reserved_ip_collection_virtual_network_interface_context_next_model.to_dict() - assert reserved_ip_collection_virtual_network_interface_context_next_model_json2 == reserved_ip_collection_virtual_network_interface_context_next_model_json - - class TestModel_ReservedIPPatch: """ Test Class for ReservedIPPatch @@ -68834,11 +71537,8 @@ def test_route_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_collection_first_model = {} # RouteCollectionFirst - route_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' - - route_collection_next_model = {} # RouteCollectionNext - route_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' route_next_hop_model = {} # RouteNextHopIP route_next_hop_model['address'] = '192.168.3.4' @@ -68863,9 +71563,9 @@ def test_route_collection_serialization(self): # Construct a json representation of a RouteCollection model route_collection_model_json = {} - route_collection_model_json['first'] = route_collection_first_model + route_collection_model_json['first'] = page_link_model route_collection_model_json['limit'] = 20 - route_collection_model_json['next'] = route_collection_next_model + route_collection_model_json['next'] = page_link_model route_collection_model_json['routes'] = [route_model] route_collection_model_json['total_count'] = 132 @@ -68885,66 +71585,6 @@ def test_route_collection_serialization(self): assert route_collection_model_json2 == route_collection_model_json -class TestModel_RouteCollectionFirst: - """ - Test Class for RouteCollectionFirst - """ - - def test_route_collection_first_serialization(self): - """ - Test serialization/deserialization for RouteCollectionFirst - """ - - # Construct a json representation of a RouteCollectionFirst model - route_collection_first_model_json = {} - route_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' - - # Construct a model instance of RouteCollectionFirst by calling from_dict on the json representation - route_collection_first_model = RouteCollectionFirst.from_dict(route_collection_first_model_json) - assert route_collection_first_model != False - - # Construct a model instance of RouteCollectionFirst by calling from_dict on the json representation - route_collection_first_model_dict = RouteCollectionFirst.from_dict(route_collection_first_model_json).__dict__ - route_collection_first_model2 = RouteCollectionFirst(**route_collection_first_model_dict) - - # Verify the model instances are equivalent - assert route_collection_first_model == route_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - route_collection_first_model_json2 = route_collection_first_model.to_dict() - assert route_collection_first_model_json2 == route_collection_first_model_json - - -class TestModel_RouteCollectionNext: - """ - Test Class for RouteCollectionNext - """ - - def test_route_collection_next_serialization(self): - """ - Test serialization/deserialization for RouteCollectionNext - """ - - # Construct a json representation of a RouteCollectionNext model - route_collection_next_model_json = {} - route_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' - - # Construct a model instance of RouteCollectionNext by calling from_dict on the json representation - route_collection_next_model = RouteCollectionNext.from_dict(route_collection_next_model_json) - assert route_collection_next_model != False - - # Construct a model instance of RouteCollectionNext by calling from_dict on the json representation - route_collection_next_model_dict = RouteCollectionNext.from_dict(route_collection_next_model_json).__dict__ - route_collection_next_model2 = RouteCollectionNext(**route_collection_next_model_dict) - - # Verify the model instances are equivalent - assert route_collection_next_model == route_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - route_collection_next_model_json2 = route_collection_next_model.to_dict() - assert route_collection_next_model_json2 == route_collection_next_model_json - - class TestModel_RouteCollectionVPCContext: """ Test Class for RouteCollectionVPCContext @@ -68957,11 +71597,8 @@ def test_route_collection_vpc_context_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - route_collection_vpc_context_first_model = {} # RouteCollectionVPCContextFirst - route_collection_vpc_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' - - route_collection_vpc_context_next_model = {} # RouteCollectionVPCContextNext - route_collection_vpc_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' route_next_hop_model = {} # RouteNextHopIP route_next_hop_model['address'] = '192.168.3.4' @@ -68970,26 +71607,26 @@ def test_route_collection_vpc_context_serialization(self): zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_reference_model['name'] = 'us-south-1' - route_collection_vpc_context_routes_item_model = {} # RouteCollectionVPCContextRoutesItem - route_collection_vpc_context_routes_item_model['action'] = 'delegate' - route_collection_vpc_context_routes_item_model['advertise'] = True - route_collection_vpc_context_routes_item_model['created_at'] = '2019-01-01T12:00:00Z' - route_collection_vpc_context_routes_item_model['destination'] = '192.168.3.0/24' - route_collection_vpc_context_routes_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' - route_collection_vpc_context_routes_item_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - route_collection_vpc_context_routes_item_model['lifecycle_state'] = 'stable' - route_collection_vpc_context_routes_item_model['name'] = 'my-route-1' - route_collection_vpc_context_routes_item_model['next_hop'] = route_next_hop_model - route_collection_vpc_context_routes_item_model['origin'] = 'service' - route_collection_vpc_context_routes_item_model['priority'] = 1 - route_collection_vpc_context_routes_item_model['zone'] = zone_reference_model + route_model = {} # Route + route_model['action'] = 'delegate' + route_model['advertise'] = True + route_model['created_at'] = '2019-01-01T12:00:00Z' + route_model['destination'] = '192.168.3.0/24' + route_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' + route_model['lifecycle_state'] = 'stable' + route_model['name'] = 'my-route-1' + route_model['next_hop'] = route_next_hop_model + route_model['origin'] = 'service' + route_model['priority'] = 1 + route_model['zone'] = zone_reference_model # Construct a json representation of a RouteCollectionVPCContext model route_collection_vpc_context_model_json = {} - route_collection_vpc_context_model_json['first'] = route_collection_vpc_context_first_model + route_collection_vpc_context_model_json['first'] = page_link_model route_collection_vpc_context_model_json['limit'] = 20 - route_collection_vpc_context_model_json['next'] = route_collection_vpc_context_next_model - route_collection_vpc_context_model_json['routes'] = [route_collection_vpc_context_routes_item_model] + route_collection_vpc_context_model_json['next'] = page_link_model + route_collection_vpc_context_model_json['routes'] = [route_model] route_collection_vpc_context_model_json['total_count'] = 132 # Construct a model instance of RouteCollectionVPCContext by calling from_dict on the json representation @@ -69008,116 +71645,6 @@ def test_route_collection_vpc_context_serialization(self): assert route_collection_vpc_context_model_json2 == route_collection_vpc_context_model_json -class TestModel_RouteCollectionVPCContextFirst: - """ - Test Class for RouteCollectionVPCContextFirst - """ - - def test_route_collection_vpc_context_first_serialization(self): - """ - Test serialization/deserialization for RouteCollectionVPCContextFirst - """ - - # Construct a json representation of a RouteCollectionVPCContextFirst model - route_collection_vpc_context_first_model_json = {} - route_collection_vpc_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20' - - # Construct a model instance of RouteCollectionVPCContextFirst by calling from_dict on the json representation - route_collection_vpc_context_first_model = RouteCollectionVPCContextFirst.from_dict(route_collection_vpc_context_first_model_json) - assert route_collection_vpc_context_first_model != False - - # Construct a model instance of RouteCollectionVPCContextFirst by calling from_dict on the json representation - route_collection_vpc_context_first_model_dict = RouteCollectionVPCContextFirst.from_dict(route_collection_vpc_context_first_model_json).__dict__ - route_collection_vpc_context_first_model2 = RouteCollectionVPCContextFirst(**route_collection_vpc_context_first_model_dict) - - # Verify the model instances are equivalent - assert route_collection_vpc_context_first_model == route_collection_vpc_context_first_model2 - - # Convert model instance back to dict and verify no loss of data - route_collection_vpc_context_first_model_json2 = route_collection_vpc_context_first_model.to_dict() - assert route_collection_vpc_context_first_model_json2 == route_collection_vpc_context_first_model_json - - -class TestModel_RouteCollectionVPCContextNext: - """ - Test Class for RouteCollectionVPCContextNext - """ - - def test_route_collection_vpc_context_next_serialization(self): - """ - Test serialization/deserialization for RouteCollectionVPCContextNext - """ - - # Construct a json representation of a RouteCollectionVPCContextNext model - route_collection_vpc_context_next_model_json = {} - route_collection_vpc_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' - - # Construct a model instance of RouteCollectionVPCContextNext by calling from_dict on the json representation - route_collection_vpc_context_next_model = RouteCollectionVPCContextNext.from_dict(route_collection_vpc_context_next_model_json) - assert route_collection_vpc_context_next_model != False - - # Construct a model instance of RouteCollectionVPCContextNext by calling from_dict on the json representation - route_collection_vpc_context_next_model_dict = RouteCollectionVPCContextNext.from_dict(route_collection_vpc_context_next_model_json).__dict__ - route_collection_vpc_context_next_model2 = RouteCollectionVPCContextNext(**route_collection_vpc_context_next_model_dict) - - # Verify the model instances are equivalent - assert route_collection_vpc_context_next_model == route_collection_vpc_context_next_model2 - - # Convert model instance back to dict and verify no loss of data - route_collection_vpc_context_next_model_json2 = route_collection_vpc_context_next_model.to_dict() - assert route_collection_vpc_context_next_model_json2 == route_collection_vpc_context_next_model_json - - -class TestModel_RouteCollectionVPCContextRoutesItem: - """ - Test Class for RouteCollectionVPCContextRoutesItem - """ - - def test_route_collection_vpc_context_routes_item_serialization(self): - """ - Test serialization/deserialization for RouteCollectionVPCContextRoutesItem - """ - - # Construct dict forms of any model objects needed in order to build this model. - - route_next_hop_model = {} # RouteNextHopIP - route_next_hop_model['address'] = '192.168.3.4' - - zone_reference_model = {} # ZoneReference - zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' - zone_reference_model['name'] = 'us-south-1' - - # Construct a json representation of a RouteCollectionVPCContextRoutesItem model - route_collection_vpc_context_routes_item_model_json = {} - route_collection_vpc_context_routes_item_model_json['action'] = 'delegate' - route_collection_vpc_context_routes_item_model_json['advertise'] = True - route_collection_vpc_context_routes_item_model_json['created_at'] = '2019-01-01T12:00:00Z' - route_collection_vpc_context_routes_item_model_json['destination'] = '192.168.3.0/24' - route_collection_vpc_context_routes_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' - route_collection_vpc_context_routes_item_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' - route_collection_vpc_context_routes_item_model_json['lifecycle_state'] = 'stable' - route_collection_vpc_context_routes_item_model_json['name'] = 'my-route-1' - route_collection_vpc_context_routes_item_model_json['next_hop'] = route_next_hop_model - route_collection_vpc_context_routes_item_model_json['origin'] = 'service' - route_collection_vpc_context_routes_item_model_json['priority'] = 1 - route_collection_vpc_context_routes_item_model_json['zone'] = zone_reference_model - - # Construct a model instance of RouteCollectionVPCContextRoutesItem by calling from_dict on the json representation - route_collection_vpc_context_routes_item_model = RouteCollectionVPCContextRoutesItem.from_dict(route_collection_vpc_context_routes_item_model_json) - assert route_collection_vpc_context_routes_item_model != False - - # Construct a model instance of RouteCollectionVPCContextRoutesItem by calling from_dict on the json representation - route_collection_vpc_context_routes_item_model_dict = RouteCollectionVPCContextRoutesItem.from_dict(route_collection_vpc_context_routes_item_model_json).__dict__ - route_collection_vpc_context_routes_item_model2 = RouteCollectionVPCContextRoutesItem(**route_collection_vpc_context_routes_item_model_dict) - - # Verify the model instances are equivalent - assert route_collection_vpc_context_routes_item_model == route_collection_vpc_context_routes_item_model2 - - # Convert model instance back to dict and verify no loss of data - route_collection_vpc_context_routes_item_model_json2 = route_collection_vpc_context_routes_item_model.to_dict() - assert route_collection_vpc_context_routes_item_model_json2 == route_collection_vpc_context_routes_item_model_json - - class TestModel_RoutePatch: """ Test Class for RoutePatch @@ -69323,11 +71850,8 @@ def test_routing_table_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - routing_table_collection_first_model = {} # RoutingTableCollectionFirst - routing_table_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?limit=50' - - routing_table_collection_next_model = {} # RoutingTableCollectionNext - routing_table_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?limit=50' resource_filter_model = {} # ResourceFilter resource_filter_model['resource_type'] = 'vpn_gateway' @@ -69375,9 +71899,9 @@ def test_routing_table_collection_serialization(self): # Construct a json representation of a RoutingTableCollection model routing_table_collection_model_json = {} - routing_table_collection_model_json['first'] = routing_table_collection_first_model + routing_table_collection_model_json['first'] = page_link_model routing_table_collection_model_json['limit'] = 20 - routing_table_collection_model_json['next'] = routing_table_collection_next_model + routing_table_collection_model_json['next'] = page_link_model routing_table_collection_model_json['routing_tables'] = [routing_table_model] routing_table_collection_model_json['total_count'] = 132 @@ -69397,66 +71921,6 @@ def test_routing_table_collection_serialization(self): assert routing_table_collection_model_json2 == routing_table_collection_model_json -class TestModel_RoutingTableCollectionFirst: - """ - Test Class for RoutingTableCollectionFirst - """ - - def test_routing_table_collection_first_serialization(self): - """ - Test serialization/deserialization for RoutingTableCollectionFirst - """ - - # Construct a json representation of a RoutingTableCollectionFirst model - routing_table_collection_first_model_json = {} - routing_table_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?limit=20' - - # Construct a model instance of RoutingTableCollectionFirst by calling from_dict on the json representation - routing_table_collection_first_model = RoutingTableCollectionFirst.from_dict(routing_table_collection_first_model_json) - assert routing_table_collection_first_model != False - - # Construct a model instance of RoutingTableCollectionFirst by calling from_dict on the json representation - routing_table_collection_first_model_dict = RoutingTableCollectionFirst.from_dict(routing_table_collection_first_model_json).__dict__ - routing_table_collection_first_model2 = RoutingTableCollectionFirst(**routing_table_collection_first_model_dict) - - # Verify the model instances are equivalent - assert routing_table_collection_first_model == routing_table_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - routing_table_collection_first_model_json2 = routing_table_collection_first_model.to_dict() - assert routing_table_collection_first_model_json2 == routing_table_collection_first_model_json - - -class TestModel_RoutingTableCollectionNext: - """ - Test Class for RoutingTableCollectionNext - """ - - def test_routing_table_collection_next_serialization(self): - """ - Test serialization/deserialization for RoutingTableCollectionNext - """ - - # Construct a json representation of a RoutingTableCollectionNext model - routing_table_collection_next_model_json = {} - routing_table_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of RoutingTableCollectionNext by calling from_dict on the json representation - routing_table_collection_next_model = RoutingTableCollectionNext.from_dict(routing_table_collection_next_model_json) - assert routing_table_collection_next_model != False - - # Construct a model instance of RoutingTableCollectionNext by calling from_dict on the json representation - routing_table_collection_next_model_dict = RoutingTableCollectionNext.from_dict(routing_table_collection_next_model_json).__dict__ - routing_table_collection_next_model2 = RoutingTableCollectionNext(**routing_table_collection_next_model_dict) - - # Verify the model instances are equivalent - assert routing_table_collection_next_model == routing_table_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - routing_table_collection_next_model_json2 = routing_table_collection_next_model.to_dict() - assert routing_table_collection_next_model_json2 == routing_table_collection_next_model_json - - class TestModel_RoutingTablePatch: """ Test Class for RoutingTablePatch @@ -69553,30 +72017,32 @@ def test_security_group_serialization(self): resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' security_group_rule_local_model = {} # SecurityGroupRuleLocalIP - security_group_rule_local_model['address'] = '192.168.3.4' + security_group_rule_local_model['address'] = '10.0.1.5' - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP - security_group_rule_remote_model['address'] = '192.168.3.4' + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteCIDR + security_group_rule_remote_model['cidr_block'] = '192.168.0.0/24' - security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll + security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP security_group_rule_model['direction'] = 'inbound' - security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-b597cff2-38e8-4e6e-999d-000002172691' + security_group_rule_model['id'] = 'r006-b597cff2-38e8-4e6e-999d-000002172691' security_group_rule_model['ip_version'] = 'ipv4' security_group_rule_model['local'] = security_group_rule_local_model security_group_rule_model['remote'] = security_group_rule_remote_model - security_group_rule_model['protocol'] = 'all' + security_group_rule_model['port_max'] = 22 + security_group_rule_model['port_min'] = 22 + security_group_rule_model['protocol'] = 'udp' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext security_group_target_reference_model['deleted'] = deleted_model - security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + security_group_target_reference_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' security_group_target_reference_model['name'] = 'my-instance-network-interface' security_group_target_reference_model['resource_type'] = 'network_interface' @@ -69628,39 +72094,38 @@ def test_security_group_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_group_collection_first_model = {} # SecurityGroupCollectionFirst - security_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20' - - security_group_collection_next_model = {} # SecurityGroupCollectionNext - security_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - resource_group_reference_model['name'] = 'my-resource-group' + resource_group_reference_model['name'] = 'Default' security_group_rule_local_model = {} # SecurityGroupRuleLocalIP - security_group_rule_local_model['address'] = '192.168.3.4' + security_group_rule_local_model['address'] = '10.0.1.5' - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP - security_group_rule_remote_model['address'] = '192.168.3.4' + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteCIDR + security_group_rule_remote_model['cidr_block'] = '192.168.0.0/24' - security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll + security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP security_group_rule_model['direction'] = 'inbound' - security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-b597cff2-38e8-4e6e-999d-000002172691' + security_group_rule_model['id'] = 'r006-b597cff2-38e8-4e6e-999d-000002172691' security_group_rule_model['ip_version'] = 'ipv4' security_group_rule_model['local'] = security_group_rule_local_model security_group_rule_model['remote'] = security_group_rule_remote_model - security_group_rule_model['protocol'] = 'all' + security_group_rule_model['port_max'] = 22 + security_group_rule_model['port_min'] = 22 + security_group_rule_model['protocol'] = 'udp' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext security_group_target_reference_model['deleted'] = deleted_model - security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + security_group_target_reference_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' security_group_target_reference_model['name'] = 'my-instance-network-interface' security_group_target_reference_model['resource_type'] = 'network_interface' @@ -69673,7 +72138,7 @@ def test_security_group_collection_serialization(self): vpc_reference_model['resource_type'] = 'vpc' security_group_model = {} # SecurityGroup - security_group_model['created_at'] = '2019-01-01T12:00:00Z' + security_group_model['created_at'] = '2024-11-04T17:52:13Z' security_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -69685,9 +72150,9 @@ def test_security_group_collection_serialization(self): # Construct a json representation of a SecurityGroupCollection model security_group_collection_model_json = {} - security_group_collection_model_json['first'] = security_group_collection_first_model + security_group_collection_model_json['first'] = page_link_model security_group_collection_model_json['limit'] = 20 - security_group_collection_model_json['next'] = security_group_collection_next_model + security_group_collection_model_json['next'] = page_link_model security_group_collection_model_json['security_groups'] = [security_group_model] security_group_collection_model_json['total_count'] = 132 @@ -69707,66 +72172,6 @@ def test_security_group_collection_serialization(self): assert security_group_collection_model_json2 == security_group_collection_model_json -class TestModel_SecurityGroupCollectionFirst: - """ - Test Class for SecurityGroupCollectionFirst - """ - - def test_security_group_collection_first_serialization(self): - """ - Test serialization/deserialization for SecurityGroupCollectionFirst - """ - - # Construct a json representation of a SecurityGroupCollectionFirst model - security_group_collection_first_model_json = {} - security_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20' - - # Construct a model instance of SecurityGroupCollectionFirst by calling from_dict on the json representation - security_group_collection_first_model = SecurityGroupCollectionFirst.from_dict(security_group_collection_first_model_json) - assert security_group_collection_first_model != False - - # Construct a model instance of SecurityGroupCollectionFirst by calling from_dict on the json representation - security_group_collection_first_model_dict = SecurityGroupCollectionFirst.from_dict(security_group_collection_first_model_json).__dict__ - security_group_collection_first_model2 = SecurityGroupCollectionFirst(**security_group_collection_first_model_dict) - - # Verify the model instances are equivalent - assert security_group_collection_first_model == security_group_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - security_group_collection_first_model_json2 = security_group_collection_first_model.to_dict() - assert security_group_collection_first_model_json2 == security_group_collection_first_model_json - - -class TestModel_SecurityGroupCollectionNext: - """ - Test Class for SecurityGroupCollectionNext - """ - - def test_security_group_collection_next_serialization(self): - """ - Test serialization/deserialization for SecurityGroupCollectionNext - """ - - # Construct a json representation of a SecurityGroupCollectionNext model - security_group_collection_next_model_json = {} - security_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of SecurityGroupCollectionNext by calling from_dict on the json representation - security_group_collection_next_model = SecurityGroupCollectionNext.from_dict(security_group_collection_next_model_json) - assert security_group_collection_next_model != False - - # Construct a model instance of SecurityGroupCollectionNext by calling from_dict on the json representation - security_group_collection_next_model_dict = SecurityGroupCollectionNext.from_dict(security_group_collection_next_model_json).__dict__ - security_group_collection_next_model2 = SecurityGroupCollectionNext(**security_group_collection_next_model_dict) - - # Verify the model instances are equivalent - assert security_group_collection_next_model == security_group_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - security_group_collection_next_model_json2 = security_group_collection_next_model.to_dict() - assert security_group_collection_next_model_json2 == security_group_collection_next_model_json - - class TestModel_SecurityGroupPatch: """ Test Class for SecurityGroupPatch @@ -69849,19 +72254,21 @@ def test_security_group_rule_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. security_group_rule_local_model = {} # SecurityGroupRuleLocalIP - security_group_rule_local_model['address'] = '192.168.3.4' + security_group_rule_local_model['address'] = '10.0.1.5' - security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP - security_group_rule_remote_model['address'] = '192.168.3.4' + security_group_rule_remote_model = {} # SecurityGroupRuleRemoteCIDR + security_group_rule_remote_model['cidr_block'] = '192.168.0.0/24' - security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll + security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP security_group_rule_model['direction'] = 'inbound' - security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-b597cff2-38e8-4e6e-999d-000002172691' + security_group_rule_model['id'] = 'r006-b597cff2-38e8-4e6e-999d-000002172691' security_group_rule_model['ip_version'] = 'ipv4' security_group_rule_model['local'] = security_group_rule_local_model security_group_rule_model['remote'] = security_group_rule_remote_model - security_group_rule_model['protocol'] = 'all' + security_group_rule_model['port_max'] = 22 + security_group_rule_model['port_min'] = 22 + security_group_rule_model['protocol'] = 'udp' # Construct a json representation of a SecurityGroupRuleCollection model security_group_rule_collection_model_json = {} @@ -69940,27 +72347,24 @@ def test_security_group_target_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_group_target_collection_first_model = {} # SecurityGroupTargetCollectionFirst - security_group_target_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20' - - security_group_target_collection_next_model = {} # SecurityGroupTargetCollectionNext - security_group_target_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext security_group_target_reference_model['deleted'] = deleted_model - security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + security_group_target_reference_model['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' security_group_target_reference_model['name'] = 'my-instance-network-interface' security_group_target_reference_model['resource_type'] = 'network_interface' # Construct a json representation of a SecurityGroupTargetCollection model security_group_target_collection_model_json = {} - security_group_target_collection_model_json['first'] = security_group_target_collection_first_model + security_group_target_collection_model_json['first'] = page_link_model security_group_target_collection_model_json['limit'] = 20 - security_group_target_collection_model_json['next'] = security_group_target_collection_next_model + security_group_target_collection_model_json['next'] = page_link_model security_group_target_collection_model_json['targets'] = [security_group_target_reference_model] security_group_target_collection_model_json['total_count'] = 132 @@ -69980,66 +72384,6 @@ def test_security_group_target_collection_serialization(self): assert security_group_target_collection_model_json2 == security_group_target_collection_model_json -class TestModel_SecurityGroupTargetCollectionFirst: - """ - Test Class for SecurityGroupTargetCollectionFirst - """ - - def test_security_group_target_collection_first_serialization(self): - """ - Test serialization/deserialization for SecurityGroupTargetCollectionFirst - """ - - # Construct a json representation of a SecurityGroupTargetCollectionFirst model - security_group_target_collection_first_model_json = {} - security_group_target_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20' - - # Construct a model instance of SecurityGroupTargetCollectionFirst by calling from_dict on the json representation - security_group_target_collection_first_model = SecurityGroupTargetCollectionFirst.from_dict(security_group_target_collection_first_model_json) - assert security_group_target_collection_first_model != False - - # Construct a model instance of SecurityGroupTargetCollectionFirst by calling from_dict on the json representation - security_group_target_collection_first_model_dict = SecurityGroupTargetCollectionFirst.from_dict(security_group_target_collection_first_model_json).__dict__ - security_group_target_collection_first_model2 = SecurityGroupTargetCollectionFirst(**security_group_target_collection_first_model_dict) - - # Verify the model instances are equivalent - assert security_group_target_collection_first_model == security_group_target_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - security_group_target_collection_first_model_json2 = security_group_target_collection_first_model.to_dict() - assert security_group_target_collection_first_model_json2 == security_group_target_collection_first_model_json - - -class TestModel_SecurityGroupTargetCollectionNext: - """ - Test Class for SecurityGroupTargetCollectionNext - """ - - def test_security_group_target_collection_next_serialization(self): - """ - Test serialization/deserialization for SecurityGroupTargetCollectionNext - """ - - # Construct a json representation of a SecurityGroupTargetCollectionNext model - security_group_target_collection_next_model_json = {} - security_group_target_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of SecurityGroupTargetCollectionNext by calling from_dict on the json representation - security_group_target_collection_next_model = SecurityGroupTargetCollectionNext.from_dict(security_group_target_collection_next_model_json) - assert security_group_target_collection_next_model != False - - # Construct a model instance of SecurityGroupTargetCollectionNext by calling from_dict on the json representation - security_group_target_collection_next_model_dict = SecurityGroupTargetCollectionNext.from_dict(security_group_target_collection_next_model_json).__dict__ - security_group_target_collection_next_model2 = SecurityGroupTargetCollectionNext(**security_group_target_collection_next_model_dict) - - # Verify the model instances are equivalent - assert security_group_target_collection_next_model == security_group_target_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - security_group_target_collection_next_model_json2 = security_group_target_collection_next_model.to_dict() - assert security_group_target_collection_next_model_json2 == security_group_target_collection_next_model_json - - class TestModel_Share: """ Test Class for Share @@ -70053,7 +72397,7 @@ def test_share_serialization(self): # Construct dict forms of any model objects needed in order to build this model. share_accessor_binding_reference_model = {} # ShareAccessorBindingReference - share_accessor_binding_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' + share_accessor_binding_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' share_accessor_binding_reference_model['id'] = 'r134-ce9dac18-dea0-4392-841c-142d3300674f' share_accessor_binding_reference_model['resource_type'] = 'share_accessor_binding' @@ -70085,7 +72429,7 @@ def test_share_serialization(self): share_mount_target_reference_model = {} # ShareMountTargetReference share_mount_target_reference_model['deleted'] = deleted_model - share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_reference_model['name'] = 'my-share-mount-target' share_mount_target_reference_model['resource_type'] = 'share_mount_target' @@ -70103,9 +72447,9 @@ def test_share_serialization(self): share_remote_model['region'] = region_reference_model share_reference_model = {} # ShareReference - share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model['deleted'] = deleted_model - share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model['name'] = 'my-share' share_reference_model['remote'] = share_remote_model @@ -70137,10 +72481,10 @@ def test_share_serialization(self): share_model_json['accessor_bindings'] = [share_accessor_binding_reference_model] share_model_json['allowed_transit_encryption_modes'] = ['none'] share_model_json['created_at'] = '2019-01-01T12:00:00Z' - share_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_model_json['encryption'] = 'provider_managed' share_model_json['encryption_key'] = encryption_key_reference_model - share_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_model_json['iops'] = 100 share_model_json['latest_job'] = share_job_model @@ -70209,7 +72553,7 @@ def test_share_accessor_binding_serialization(self): share_accessor_binding_accessor_model = {} # ShareAccessorBindingAccessorShareReference share_accessor_binding_accessor_model['crn'] = 'crn:v1:bluemix:public:pm-20:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:6500f05d-a5b5-4ecf-91ba-0d12b9dee607::' share_accessor_binding_accessor_model['deleted'] = deleted_model - share_accessor_binding_accessor_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_accessor_binding_accessor_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_accessor_binding_accessor_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_accessor_binding_accessor_model['name'] = 'my-share' share_accessor_binding_accessor_model['remote'] = share_remote_model @@ -70219,7 +72563,7 @@ def test_share_accessor_binding_serialization(self): share_accessor_binding_model_json = {} share_accessor_binding_model_json['accessor'] = share_accessor_binding_accessor_model share_accessor_binding_model_json['created_at'] = '2019-01-01T12:00:00Z' - share_accessor_binding_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' + share_accessor_binding_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' share_accessor_binding_model_json['id'] = 'r134-ce9dac18-dea0-4392-841c-142d3300674f' share_accessor_binding_model_json['lifecycle_state'] = 'stable' share_accessor_binding_model_json['resource_type'] = 'share_accessor_binding' @@ -70268,9 +72612,9 @@ def test_share_accessor_binding_collection_serialization(self): share_remote_model['region'] = region_reference_model share_accessor_binding_accessor_model = {} # ShareAccessorBindingAccessorShareReference - share_accessor_binding_accessor_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_accessor_binding_accessor_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_accessor_binding_accessor_model['deleted'] = deleted_model - share_accessor_binding_accessor_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_accessor_binding_accessor_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_accessor_binding_accessor_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_accessor_binding_accessor_model['name'] = 'my-share' share_accessor_binding_accessor_model['remote'] = share_remote_model @@ -70279,23 +72623,20 @@ def test_share_accessor_binding_collection_serialization(self): share_accessor_binding_model = {} # ShareAccessorBinding share_accessor_binding_model['accessor'] = share_accessor_binding_accessor_model share_accessor_binding_model['created_at'] = '2019-01-01T12:00:00Z' - share_accessor_binding_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' + share_accessor_binding_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' share_accessor_binding_model['id'] = 'r134-ce9dac18-dea0-4392-841c-142d3300674f' share_accessor_binding_model['lifecycle_state'] = 'stable' share_accessor_binding_model['resource_type'] = 'share_accessor_binding' - share_accessor_binding_collection_first_model = {} # ShareAccessorBindingCollectionFirst - share_accessor_binding_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?limit=20' - - share_accessor_binding_collection_next_model = {} # ShareAccessorBindingCollectionNext - share_accessor_binding_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?limit=20' # Construct a json representation of a ShareAccessorBindingCollection model share_accessor_binding_collection_model_json = {} share_accessor_binding_collection_model_json['accessor_bindings'] = [share_accessor_binding_model] - share_accessor_binding_collection_model_json['first'] = share_accessor_binding_collection_first_model + share_accessor_binding_collection_model_json['first'] = page_link_model share_accessor_binding_collection_model_json['limit'] = 20 - share_accessor_binding_collection_model_json['next'] = share_accessor_binding_collection_next_model + share_accessor_binding_collection_model_json['next'] = page_link_model share_accessor_binding_collection_model_json['total_count'] = 132 # Construct a model instance of ShareAccessorBindingCollection by calling from_dict on the json representation @@ -70314,66 +72655,6 @@ def test_share_accessor_binding_collection_serialization(self): assert share_accessor_binding_collection_model_json2 == share_accessor_binding_collection_model_json -class TestModel_ShareAccessorBindingCollectionFirst: - """ - Test Class for ShareAccessorBindingCollectionFirst - """ - - def test_share_accessor_binding_collection_first_serialization(self): - """ - Test serialization/deserialization for ShareAccessorBindingCollectionFirst - """ - - # Construct a json representation of a ShareAccessorBindingCollectionFirst model - share_accessor_binding_collection_first_model_json = {} - share_accessor_binding_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?limit=20' - - # Construct a model instance of ShareAccessorBindingCollectionFirst by calling from_dict on the json representation - share_accessor_binding_collection_first_model = ShareAccessorBindingCollectionFirst.from_dict(share_accessor_binding_collection_first_model_json) - assert share_accessor_binding_collection_first_model != False - - # Construct a model instance of ShareAccessorBindingCollectionFirst by calling from_dict on the json representation - share_accessor_binding_collection_first_model_dict = ShareAccessorBindingCollectionFirst.from_dict(share_accessor_binding_collection_first_model_json).__dict__ - share_accessor_binding_collection_first_model2 = ShareAccessorBindingCollectionFirst(**share_accessor_binding_collection_first_model_dict) - - # Verify the model instances are equivalent - assert share_accessor_binding_collection_first_model == share_accessor_binding_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - share_accessor_binding_collection_first_model_json2 = share_accessor_binding_collection_first_model.to_dict() - assert share_accessor_binding_collection_first_model_json2 == share_accessor_binding_collection_first_model_json - - -class TestModel_ShareAccessorBindingCollectionNext: - """ - Test Class for ShareAccessorBindingCollectionNext - """ - - def test_share_accessor_binding_collection_next_serialization(self): - """ - Test serialization/deserialization for ShareAccessorBindingCollectionNext - """ - - # Construct a json representation of a ShareAccessorBindingCollectionNext model - share_accessor_binding_collection_next_model_json = {} - share_accessor_binding_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - - # Construct a model instance of ShareAccessorBindingCollectionNext by calling from_dict on the json representation - share_accessor_binding_collection_next_model = ShareAccessorBindingCollectionNext.from_dict(share_accessor_binding_collection_next_model_json) - assert share_accessor_binding_collection_next_model != False - - # Construct a model instance of ShareAccessorBindingCollectionNext by calling from_dict on the json representation - share_accessor_binding_collection_next_model_dict = ShareAccessorBindingCollectionNext.from_dict(share_accessor_binding_collection_next_model_json).__dict__ - share_accessor_binding_collection_next_model2 = ShareAccessorBindingCollectionNext(**share_accessor_binding_collection_next_model_dict) - - # Verify the model instances are equivalent - assert share_accessor_binding_collection_next_model == share_accessor_binding_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - share_accessor_binding_collection_next_model_json2 = share_accessor_binding_collection_next_model.to_dict() - assert share_accessor_binding_collection_next_model_json2 == share_accessor_binding_collection_next_model_json - - class TestModel_ShareAccessorBindingReference: """ Test Class for ShareAccessorBindingReference @@ -70386,7 +72667,7 @@ def test_share_accessor_binding_reference_serialization(self): # Construct a json representation of a ShareAccessorBindingReference model share_accessor_binding_reference_model_json = {} - share_accessor_binding_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' + share_accessor_binding_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' share_accessor_binding_reference_model_json['id'] = 'r134-ce9dac18-dea0-4392-841c-142d3300674f' share_accessor_binding_reference_model_json['resource_type'] = 'share_accessor_binding' @@ -70418,14 +72699,11 @@ def test_share_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - share_collection_first_model = {} # ShareCollectionFirst - share_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20' - - share_collection_next_model = {} # ShareCollectionNext - share_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20' share_accessor_binding_reference_model = {} # ShareAccessorBindingReference - share_accessor_binding_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' + share_accessor_binding_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r134-ae9bdc18-aed0-4392-841c-142d3300674f' share_accessor_binding_reference_model['id'] = 'r134-ce9dac18-dea0-4392-841c-142d3300674f' share_accessor_binding_reference_model['resource_type'] = 'share_accessor_binding' @@ -70457,7 +72735,7 @@ def test_share_collection_serialization(self): share_mount_target_reference_model = {} # ShareMountTargetReference share_mount_target_reference_model['deleted'] = deleted_model - share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_reference_model['name'] = 'my-share-mount-target' share_mount_target_reference_model['resource_type'] = 'share_mount_target' @@ -70475,9 +72753,9 @@ def test_share_collection_serialization(self): share_remote_model['region'] = region_reference_model share_reference_model = {} # ShareReference - share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model['deleted'] = deleted_model - share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model['name'] = 'my-share' share_reference_model['remote'] = share_remote_model @@ -70508,10 +72786,10 @@ def test_share_collection_serialization(self): share_model['accessor_bindings'] = [share_accessor_binding_reference_model] share_model['allowed_transit_encryption_modes'] = ['none'] share_model['created_at'] = '2019-01-01T12:00:00Z' - share_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_model['encryption'] = 'provider_managed' share_model['encryption_key'] = encryption_key_reference_model - share_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_model['iops'] = 100 share_model['latest_job'] = share_job_model @@ -70536,9 +72814,9 @@ def test_share_collection_serialization(self): # Construct a json representation of a ShareCollection model share_collection_model_json = {} - share_collection_model_json['first'] = share_collection_first_model + share_collection_model_json['first'] = page_link_model share_collection_model_json['limit'] = 20 - share_collection_model_json['next'] = share_collection_next_model + share_collection_model_json['next'] = page_link_model share_collection_model_json['shares'] = [share_model] share_collection_model_json['total_count'] = 132 @@ -70558,66 +72836,6 @@ def test_share_collection_serialization(self): assert share_collection_model_json2 == share_collection_model_json -class TestModel_ShareCollectionFirst: - """ - Test Class for ShareCollectionFirst - """ - - def test_share_collection_first_serialization(self): - """ - Test serialization/deserialization for ShareCollectionFirst - """ - - # Construct a json representation of a ShareCollectionFirst model - share_collection_first_model_json = {} - share_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20' - - # Construct a model instance of ShareCollectionFirst by calling from_dict on the json representation - share_collection_first_model = ShareCollectionFirst.from_dict(share_collection_first_model_json) - assert share_collection_first_model != False - - # Construct a model instance of ShareCollectionFirst by calling from_dict on the json representation - share_collection_first_model_dict = ShareCollectionFirst.from_dict(share_collection_first_model_json).__dict__ - share_collection_first_model2 = ShareCollectionFirst(**share_collection_first_model_dict) - - # Verify the model instances are equivalent - assert share_collection_first_model == share_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - share_collection_first_model_json2 = share_collection_first_model.to_dict() - assert share_collection_first_model_json2 == share_collection_first_model_json - - -class TestModel_ShareCollectionNext: - """ - Test Class for ShareCollectionNext - """ - - def test_share_collection_next_serialization(self): - """ - Test serialization/deserialization for ShareCollectionNext - """ - - # Construct a json representation of a ShareCollectionNext model - share_collection_next_model_json = {} - share_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of ShareCollectionNext by calling from_dict on the json representation - share_collection_next_model = ShareCollectionNext.from_dict(share_collection_next_model_json) - assert share_collection_next_model != False - - # Construct a model instance of ShareCollectionNext by calling from_dict on the json representation - share_collection_next_model_dict = ShareCollectionNext.from_dict(share_collection_next_model_json).__dict__ - share_collection_next_model2 = ShareCollectionNext(**share_collection_next_model_dict) - - # Verify the model instances are equivalent - assert share_collection_next_model == share_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - share_collection_next_model_json2 = share_collection_next_model.to_dict() - assert share_collection_next_model_json2 == share_collection_next_model_json - - class TestModel_ShareInitialOwner: """ Test Class for ShareInitialOwner @@ -70816,9 +73034,9 @@ def test_share_mount_target_serialization(self): subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' @@ -70834,7 +73052,7 @@ def test_share_mount_target_serialization(self): share_mount_target_model_json = {} share_mount_target_model_json['access_control_mode'] = 'security_group' share_mount_target_model_json['created_at'] = '2019-01-01T12:00:00Z' - share_mount_target_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_model_json['lifecycle_state'] = 'stable' share_mount_target_model_json['mount_path'] = '10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e' @@ -70874,8 +73092,8 @@ def test_share_mount_target_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - share_mount_target_collection_first_model = {} # ShareMountTargetCollectionFirst - share_mount_target_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -70897,9 +73115,9 @@ def test_share_mount_target_collection_serialization(self): subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' @@ -70914,7 +73132,7 @@ def test_share_mount_target_collection_serialization(self): share_mount_target_model = {} # ShareMountTarget share_mount_target_model['access_control_mode'] = 'security_group' share_mount_target_model['created_at'] = '2019-01-01T12:00:00Z' - share_mount_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_model['lifecycle_state'] = 'stable' share_mount_target_model['mount_path'] = '10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e' @@ -70926,15 +73144,12 @@ def test_share_mount_target_collection_serialization(self): share_mount_target_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model share_mount_target_model['vpc'] = vpc_reference_model - share_mount_target_collection_next_model = {} # ShareMountTargetCollectionNext - share_mount_target_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - # Construct a json representation of a ShareMountTargetCollection model share_mount_target_collection_model_json = {} - share_mount_target_collection_model_json['first'] = share_mount_target_collection_first_model + share_mount_target_collection_model_json['first'] = page_link_model share_mount_target_collection_model_json['limit'] = 20 share_mount_target_collection_model_json['mount_targets'] = [share_mount_target_model] - share_mount_target_collection_model_json['next'] = share_mount_target_collection_next_model + share_mount_target_collection_model_json['next'] = page_link_model share_mount_target_collection_model_json['total_count'] = 132 # Construct a model instance of ShareMountTargetCollection by calling from_dict on the json representation @@ -70953,66 +73168,6 @@ def test_share_mount_target_collection_serialization(self): assert share_mount_target_collection_model_json2 == share_mount_target_collection_model_json -class TestModel_ShareMountTargetCollectionFirst: - """ - Test Class for ShareMountTargetCollectionFirst - """ - - def test_share_mount_target_collection_first_serialization(self): - """ - Test serialization/deserialization for ShareMountTargetCollectionFirst - """ - - # Construct a json representation of a ShareMountTargetCollectionFirst model - share_mount_target_collection_first_model_json = {} - share_mount_target_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20' - - # Construct a model instance of ShareMountTargetCollectionFirst by calling from_dict on the json representation - share_mount_target_collection_first_model = ShareMountTargetCollectionFirst.from_dict(share_mount_target_collection_first_model_json) - assert share_mount_target_collection_first_model != False - - # Construct a model instance of ShareMountTargetCollectionFirst by calling from_dict on the json representation - share_mount_target_collection_first_model_dict = ShareMountTargetCollectionFirst.from_dict(share_mount_target_collection_first_model_json).__dict__ - share_mount_target_collection_first_model2 = ShareMountTargetCollectionFirst(**share_mount_target_collection_first_model_dict) - - # Verify the model instances are equivalent - assert share_mount_target_collection_first_model == share_mount_target_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - share_mount_target_collection_first_model_json2 = share_mount_target_collection_first_model.to_dict() - assert share_mount_target_collection_first_model_json2 == share_mount_target_collection_first_model_json - - -class TestModel_ShareMountTargetCollectionNext: - """ - Test Class for ShareMountTargetCollectionNext - """ - - def test_share_mount_target_collection_next_serialization(self): - """ - Test serialization/deserialization for ShareMountTargetCollectionNext - """ - - # Construct a json representation of a ShareMountTargetCollectionNext model - share_mount_target_collection_next_model_json = {} - share_mount_target_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of ShareMountTargetCollectionNext by calling from_dict on the json representation - share_mount_target_collection_next_model = ShareMountTargetCollectionNext.from_dict(share_mount_target_collection_next_model_json) - assert share_mount_target_collection_next_model != False - - # Construct a model instance of ShareMountTargetCollectionNext by calling from_dict on the json representation - share_mount_target_collection_next_model_dict = ShareMountTargetCollectionNext.from_dict(share_mount_target_collection_next_model_json).__dict__ - share_mount_target_collection_next_model2 = ShareMountTargetCollectionNext(**share_mount_target_collection_next_model_dict) - - # Verify the model instances are equivalent - assert share_mount_target_collection_next_model == share_mount_target_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - share_mount_target_collection_next_model_json2 = share_mount_target_collection_next_model.to_dict() - assert share_mount_target_collection_next_model_json2 == share_mount_target_collection_next_model_json - - class TestModel_ShareMountTargetPatch: """ Test Class for ShareMountTargetPatch @@ -71061,7 +73216,7 @@ def test_share_mount_target_reference_serialization(self): # Construct a json representation of a ShareMountTargetReference model share_mount_target_reference_model_json = {} share_mount_target_reference_model_json['deleted'] = deleted_model - share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_reference_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' share_mount_target_reference_model_json['name'] = 'my-share-mount-target' share_mount_target_reference_model_json['resource_type'] = 'share_mount_target' @@ -71181,11 +73336,8 @@ def test_share_profile_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - share_profile_collection_first_model = {} # ShareProfileCollectionFirst - share_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20' - - share_profile_collection_next_model = {} # ShareProfileCollectionNext - share_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20' share_profile_capacity_model = {} # ShareProfileCapacityFixed share_profile_capacity_model['type'] = 'fixed' @@ -71205,9 +73357,9 @@ def test_share_profile_collection_serialization(self): # Construct a json representation of a ShareProfileCollection model share_profile_collection_model_json = {} - share_profile_collection_model_json['first'] = share_profile_collection_first_model + share_profile_collection_model_json['first'] = page_link_model share_profile_collection_model_json['limit'] = 20 - share_profile_collection_model_json['next'] = share_profile_collection_next_model + share_profile_collection_model_json['next'] = page_link_model share_profile_collection_model_json['profiles'] = [share_profile_model] share_profile_collection_model_json['total_count'] = 132 @@ -71227,66 +73379,6 @@ def test_share_profile_collection_serialization(self): assert share_profile_collection_model_json2 == share_profile_collection_model_json -class TestModel_ShareProfileCollectionFirst: - """ - Test Class for ShareProfileCollectionFirst - """ - - def test_share_profile_collection_first_serialization(self): - """ - Test serialization/deserialization for ShareProfileCollectionFirst - """ - - # Construct a json representation of a ShareProfileCollectionFirst model - share_profile_collection_first_model_json = {} - share_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20' - - # Construct a model instance of ShareProfileCollectionFirst by calling from_dict on the json representation - share_profile_collection_first_model = ShareProfileCollectionFirst.from_dict(share_profile_collection_first_model_json) - assert share_profile_collection_first_model != False - - # Construct a model instance of ShareProfileCollectionFirst by calling from_dict on the json representation - share_profile_collection_first_model_dict = ShareProfileCollectionFirst.from_dict(share_profile_collection_first_model_json).__dict__ - share_profile_collection_first_model2 = ShareProfileCollectionFirst(**share_profile_collection_first_model_dict) - - # Verify the model instances are equivalent - assert share_profile_collection_first_model == share_profile_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - share_profile_collection_first_model_json2 = share_profile_collection_first_model.to_dict() - assert share_profile_collection_first_model_json2 == share_profile_collection_first_model_json - - -class TestModel_ShareProfileCollectionNext: - """ - Test Class for ShareProfileCollectionNext - """ - - def test_share_profile_collection_next_serialization(self): - """ - Test serialization/deserialization for ShareProfileCollectionNext - """ - - # Construct a json representation of a ShareProfileCollectionNext model - share_profile_collection_next_model_json = {} - share_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of ShareProfileCollectionNext by calling from_dict on the json representation - share_profile_collection_next_model = ShareProfileCollectionNext.from_dict(share_profile_collection_next_model_json) - assert share_profile_collection_next_model != False - - # Construct a model instance of ShareProfileCollectionNext by calling from_dict on the json representation - share_profile_collection_next_model_dict = ShareProfileCollectionNext.from_dict(share_profile_collection_next_model_json).__dict__ - share_profile_collection_next_model2 = ShareProfileCollectionNext(**share_profile_collection_next_model_dict) - - # Verify the model instances are equivalent - assert share_profile_collection_next_model == share_profile_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - share_profile_collection_next_model_json2 = share_profile_collection_next_model.to_dict() - assert share_profile_collection_next_model_json2 == share_profile_collection_next_model_json - - class TestModel_ShareProfileReference: """ Test Class for ShareProfileReference @@ -71345,7 +73437,7 @@ def test_share_prototype_share_context_serialization(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -71430,9 +73522,9 @@ def test_share_reference_serialization(self): # Construct a json representation of a ShareReference model share_reference_model_json = {} - share_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model_json['deleted'] = deleted_model - share_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_reference_model_json['name'] = 'my-share' share_reference_model_json['remote'] = share_remote_model @@ -71675,6 +73767,7 @@ def test_snapshot_serialization(self): snapshot_model_json['minimum_capacity'] = 1 snapshot_model_json['name'] = 'my-snapshot' snapshot_model_json['operating_system'] = operating_system_model + snapshot_model_json['progress'] = 55 snapshot_model_json['resource_group'] = resource_group_reference_model snapshot_model_json['resource_type'] = 'snapshot' snapshot_model_json['service_tags'] = ['testString'] @@ -71870,11 +73963,8 @@ def test_snapshot_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - snapshot_collection_first_model = {} # SnapshotCollectionFirst - snapshot_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20' - - snapshot_collection_next_model = {} # SnapshotCollectionNext - snapshot_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -72011,6 +74101,7 @@ def test_snapshot_collection_serialization(self): snapshot_model['minimum_capacity'] = 1 snapshot_model['name'] = 'my-snapshot' snapshot_model['operating_system'] = operating_system_model + snapshot_model['progress'] = 55 snapshot_model['resource_group'] = resource_group_reference_model snapshot_model['resource_type'] = 'snapshot' snapshot_model['service_tags'] = ['testString'] @@ -72023,9 +74114,9 @@ def test_snapshot_collection_serialization(self): # Construct a json representation of a SnapshotCollection model snapshot_collection_model_json = {} - snapshot_collection_model_json['first'] = snapshot_collection_first_model + snapshot_collection_model_json['first'] = page_link_model snapshot_collection_model_json['limit'] = 20 - snapshot_collection_model_json['next'] = snapshot_collection_next_model + snapshot_collection_model_json['next'] = page_link_model snapshot_collection_model_json['snapshots'] = [snapshot_model] snapshot_collection_model_json['total_count'] = 132 @@ -72045,66 +74136,6 @@ def test_snapshot_collection_serialization(self): assert snapshot_collection_model_json2 == snapshot_collection_model_json -class TestModel_SnapshotCollectionFirst: - """ - Test Class for SnapshotCollectionFirst - """ - - def test_snapshot_collection_first_serialization(self): - """ - Test serialization/deserialization for SnapshotCollectionFirst - """ - - # Construct a json representation of a SnapshotCollectionFirst model - snapshot_collection_first_model_json = {} - snapshot_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20' - - # Construct a model instance of SnapshotCollectionFirst by calling from_dict on the json representation - snapshot_collection_first_model = SnapshotCollectionFirst.from_dict(snapshot_collection_first_model_json) - assert snapshot_collection_first_model != False - - # Construct a model instance of SnapshotCollectionFirst by calling from_dict on the json representation - snapshot_collection_first_model_dict = SnapshotCollectionFirst.from_dict(snapshot_collection_first_model_json).__dict__ - snapshot_collection_first_model2 = SnapshotCollectionFirst(**snapshot_collection_first_model_dict) - - # Verify the model instances are equivalent - assert snapshot_collection_first_model == snapshot_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - snapshot_collection_first_model_json2 = snapshot_collection_first_model.to_dict() - assert snapshot_collection_first_model_json2 == snapshot_collection_first_model_json - - -class TestModel_SnapshotCollectionNext: - """ - Test Class for SnapshotCollectionNext - """ - - def test_snapshot_collection_next_serialization(self): - """ - Test serialization/deserialization for SnapshotCollectionNext - """ - - # Construct a json representation of a SnapshotCollectionNext model - snapshot_collection_next_model_json = {} - snapshot_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of SnapshotCollectionNext by calling from_dict on the json representation - snapshot_collection_next_model = SnapshotCollectionNext.from_dict(snapshot_collection_next_model_json) - assert snapshot_collection_next_model != False - - # Construct a model instance of SnapshotCollectionNext by calling from_dict on the json representation - snapshot_collection_next_model_dict = SnapshotCollectionNext.from_dict(snapshot_collection_next_model_json).__dict__ - snapshot_collection_next_model2 = SnapshotCollectionNext(**snapshot_collection_next_model_dict) - - # Verify the model instances are equivalent - assert snapshot_collection_next_model == snapshot_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - snapshot_collection_next_model_json2 = snapshot_collection_next_model.to_dict() - assert snapshot_collection_next_model_json2 == snapshot_collection_next_model_json - - class TestModel_SnapshotConsistencyGroup: """ Test Class for SnapshotConsistencyGroup @@ -72200,11 +74231,8 @@ def test_snapshot_consistency_group_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - snapshot_consistency_group_collection_first_model = {} # SnapshotConsistencyGroupCollectionFirst - snapshot_consistency_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20' - - snapshot_consistency_group_collection_next_model = {} # SnapshotConsistencyGroupCollectionNext - snapshot_consistency_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -72262,9 +74290,9 @@ def test_snapshot_consistency_group_collection_serialization(self): # Construct a json representation of a SnapshotConsistencyGroupCollection model snapshot_consistency_group_collection_model_json = {} - snapshot_consistency_group_collection_model_json['first'] = snapshot_consistency_group_collection_first_model + snapshot_consistency_group_collection_model_json['first'] = page_link_model snapshot_consistency_group_collection_model_json['limit'] = 20 - snapshot_consistency_group_collection_model_json['next'] = snapshot_consistency_group_collection_next_model + snapshot_consistency_group_collection_model_json['next'] = page_link_model snapshot_consistency_group_collection_model_json['snapshot_consistency_groups'] = [snapshot_consistency_group_model] snapshot_consistency_group_collection_model_json['total_count'] = 132 @@ -72284,66 +74312,6 @@ def test_snapshot_consistency_group_collection_serialization(self): assert snapshot_consistency_group_collection_model_json2 == snapshot_consistency_group_collection_model_json -class TestModel_SnapshotConsistencyGroupCollectionFirst: - """ - Test Class for SnapshotConsistencyGroupCollectionFirst - """ - - def test_snapshot_consistency_group_collection_first_serialization(self): - """ - Test serialization/deserialization for SnapshotConsistencyGroupCollectionFirst - """ - - # Construct a json representation of a SnapshotConsistencyGroupCollectionFirst model - snapshot_consistency_group_collection_first_model_json = {} - snapshot_consistency_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20' - - # Construct a model instance of SnapshotConsistencyGroupCollectionFirst by calling from_dict on the json representation - snapshot_consistency_group_collection_first_model = SnapshotConsistencyGroupCollectionFirst.from_dict(snapshot_consistency_group_collection_first_model_json) - assert snapshot_consistency_group_collection_first_model != False - - # Construct a model instance of SnapshotConsistencyGroupCollectionFirst by calling from_dict on the json representation - snapshot_consistency_group_collection_first_model_dict = SnapshotConsistencyGroupCollectionFirst.from_dict(snapshot_consistency_group_collection_first_model_json).__dict__ - snapshot_consistency_group_collection_first_model2 = SnapshotConsistencyGroupCollectionFirst(**snapshot_consistency_group_collection_first_model_dict) - - # Verify the model instances are equivalent - assert snapshot_consistency_group_collection_first_model == snapshot_consistency_group_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - snapshot_consistency_group_collection_first_model_json2 = snapshot_consistency_group_collection_first_model.to_dict() - assert snapshot_consistency_group_collection_first_model_json2 == snapshot_consistency_group_collection_first_model_json - - -class TestModel_SnapshotConsistencyGroupCollectionNext: - """ - Test Class for SnapshotConsistencyGroupCollectionNext - """ - - def test_snapshot_consistency_group_collection_next_serialization(self): - """ - Test serialization/deserialization for SnapshotConsistencyGroupCollectionNext - """ - - # Construct a json representation of a SnapshotConsistencyGroupCollectionNext model - snapshot_consistency_group_collection_next_model_json = {} - snapshot_consistency_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of SnapshotConsistencyGroupCollectionNext by calling from_dict on the json representation - snapshot_consistency_group_collection_next_model = SnapshotConsistencyGroupCollectionNext.from_dict(snapshot_consistency_group_collection_next_model_json) - assert snapshot_consistency_group_collection_next_model != False - - # Construct a model instance of SnapshotConsistencyGroupCollectionNext by calling from_dict on the json representation - snapshot_consistency_group_collection_next_model_dict = SnapshotConsistencyGroupCollectionNext.from_dict(snapshot_consistency_group_collection_next_model_json).__dict__ - snapshot_consistency_group_collection_next_model2 = SnapshotConsistencyGroupCollectionNext(**snapshot_consistency_group_collection_next_model_dict) - - # Verify the model instances are equivalent - assert snapshot_consistency_group_collection_next_model == snapshot_consistency_group_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - snapshot_consistency_group_collection_next_model_json2 = snapshot_consistency_group_collection_next_model.to_dict() - assert snapshot_consistency_group_collection_next_model_json2 == snapshot_consistency_group_collection_next_model_json - - class TestModel_SnapshotConsistencyGroupPatch: """ Test Class for SnapshotConsistencyGroupPatch @@ -72786,11 +74754,8 @@ def test_subnet_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - subnet_collection_first_model = {} # SubnetCollectionFirst - subnet_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20' - - subnet_collection_next_model = {} # SubnetCollectionNext - subnet_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -72849,16 +74814,16 @@ def test_subnet_collection_serialization(self): subnet_model['resource_group'] = resource_group_reference_model subnet_model['resource_type'] = 'subnet' subnet_model['routing_table'] = routing_table_reference_model - subnet_model['status'] = 'pending' + subnet_model['status'] = 'available' subnet_model['total_ipv4_address_count'] = 256 subnet_model['vpc'] = vpc_reference_model subnet_model['zone'] = zone_reference_model # Construct a json representation of a SubnetCollection model subnet_collection_model_json = {} - subnet_collection_model_json['first'] = subnet_collection_first_model + subnet_collection_model_json['first'] = page_link_model subnet_collection_model_json['limit'] = 20 - subnet_collection_model_json['next'] = subnet_collection_next_model + subnet_collection_model_json['next'] = page_link_model subnet_collection_model_json['subnets'] = [subnet_model] subnet_collection_model_json['total_count'] = 132 @@ -72878,66 +74843,6 @@ def test_subnet_collection_serialization(self): assert subnet_collection_model_json2 == subnet_collection_model_json -class TestModel_SubnetCollectionFirst: - """ - Test Class for SubnetCollectionFirst - """ - - def test_subnet_collection_first_serialization(self): - """ - Test serialization/deserialization for SubnetCollectionFirst - """ - - # Construct a json representation of a SubnetCollectionFirst model - subnet_collection_first_model_json = {} - subnet_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20' - - # Construct a model instance of SubnetCollectionFirst by calling from_dict on the json representation - subnet_collection_first_model = SubnetCollectionFirst.from_dict(subnet_collection_first_model_json) - assert subnet_collection_first_model != False - - # Construct a model instance of SubnetCollectionFirst by calling from_dict on the json representation - subnet_collection_first_model_dict = SubnetCollectionFirst.from_dict(subnet_collection_first_model_json).__dict__ - subnet_collection_first_model2 = SubnetCollectionFirst(**subnet_collection_first_model_dict) - - # Verify the model instances are equivalent - assert subnet_collection_first_model == subnet_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - subnet_collection_first_model_json2 = subnet_collection_first_model.to_dict() - assert subnet_collection_first_model_json2 == subnet_collection_first_model_json - - -class TestModel_SubnetCollectionNext: - """ - Test Class for SubnetCollectionNext - """ - - def test_subnet_collection_next_serialization(self): - """ - Test serialization/deserialization for SubnetCollectionNext - """ - - # Construct a json representation of a SubnetCollectionNext model - subnet_collection_next_model_json = {} - subnet_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of SubnetCollectionNext by calling from_dict on the json representation - subnet_collection_next_model = SubnetCollectionNext.from_dict(subnet_collection_next_model_json) - assert subnet_collection_next_model != False - - # Construct a model instance of SubnetCollectionNext by calling from_dict on the json representation - subnet_collection_next_model_dict = SubnetCollectionNext.from_dict(subnet_collection_next_model_json).__dict__ - subnet_collection_next_model2 = SubnetCollectionNext(**subnet_collection_next_model_dict) - - # Verify the model instances are equivalent - assert subnet_collection_next_model == subnet_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - subnet_collection_next_model_json2 = subnet_collection_next_model.to_dict() - assert subnet_collection_next_model_json2 == subnet_collection_next_model_json - - class TestModel_SubnetPatch: """ Test Class for SubnetPatch @@ -73245,11 +75150,8 @@ def test_vpc_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpc_collection_first_model = {} # VPCCollectionFirst - vpc_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20' - - vpc_collection_next_model = {} # VPCCollectionNext - vpc_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20' ip_model = {} # IP ip_model['address'] = '192.168.3.4' @@ -73331,9 +75233,9 @@ def test_vpc_collection_serialization(self): # Construct a json representation of a VPCCollection model vpc_collection_model_json = {} - vpc_collection_model_json['first'] = vpc_collection_first_model + vpc_collection_model_json['first'] = page_link_model vpc_collection_model_json['limit'] = 20 - vpc_collection_model_json['next'] = vpc_collection_next_model + vpc_collection_model_json['next'] = page_link_model vpc_collection_model_json['total_count'] = 132 vpc_collection_model_json['vpcs'] = [vpc_model] @@ -73353,66 +75255,6 @@ def test_vpc_collection_serialization(self): assert vpc_collection_model_json2 == vpc_collection_model_json -class TestModel_VPCCollectionFirst: - """ - Test Class for VPCCollectionFirst - """ - - def test_vpc_collection_first_serialization(self): - """ - Test serialization/deserialization for VPCCollectionFirst - """ - - # Construct a json representation of a VPCCollectionFirst model - vpc_collection_first_model_json = {} - vpc_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20' - - # Construct a model instance of VPCCollectionFirst by calling from_dict on the json representation - vpc_collection_first_model = VPCCollectionFirst.from_dict(vpc_collection_first_model_json) - assert vpc_collection_first_model != False - - # Construct a model instance of VPCCollectionFirst by calling from_dict on the json representation - vpc_collection_first_model_dict = VPCCollectionFirst.from_dict(vpc_collection_first_model_json).__dict__ - vpc_collection_first_model2 = VPCCollectionFirst(**vpc_collection_first_model_dict) - - # Verify the model instances are equivalent - assert vpc_collection_first_model == vpc_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - vpc_collection_first_model_json2 = vpc_collection_first_model.to_dict() - assert vpc_collection_first_model_json2 == vpc_collection_first_model_json - - -class TestModel_VPCCollectionNext: - """ - Test Class for VPCCollectionNext - """ - - def test_vpc_collection_next_serialization(self): - """ - Test serialization/deserialization for VPCCollectionNext - """ - - # Construct a json representation of a VPCCollectionNext model - vpc_collection_next_model_json = {} - vpc_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of VPCCollectionNext by calling from_dict on the json representation - vpc_collection_next_model = VPCCollectionNext.from_dict(vpc_collection_next_model_json) - assert vpc_collection_next_model != False - - # Construct a model instance of VPCCollectionNext by calling from_dict on the json representation - vpc_collection_next_model_dict = VPCCollectionNext.from_dict(vpc_collection_next_model_json).__dict__ - vpc_collection_next_model2 = VPCCollectionNext(**vpc_collection_next_model_dict) - - # Verify the model instances are equivalent - assert vpc_collection_next_model == vpc_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - vpc_collection_next_model_json2 = vpc_collection_next_model.to_dict() - assert vpc_collection_next_model_json2 == vpc_collection_next_model_json - - class TestModel_VPCDNS: """ Test Class for VPCDNS @@ -73715,18 +75557,15 @@ def test_vpcdns_resolution_binding_collection_serialization(self): vpcdns_resolution_binding_model['resource_type'] = 'vpc_dns_resolution_binding' vpcdns_resolution_binding_model['vpc'] = vpc_reference_remote_model - vpcdns_resolution_binding_collection_first_model = {} # VPCDNSResolutionBindingCollectionFirst - vpcdns_resolution_binding_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?limit=20' - - vpcdns_resolution_binding_collection_next_model = {} # VPCDNSResolutionBindingCollectionNext - vpcdns_resolution_binding_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?limit=20' # Construct a json representation of a VPCDNSResolutionBindingCollection model vpcdns_resolution_binding_collection_model_json = {} vpcdns_resolution_binding_collection_model_json['dns_resolution_bindings'] = [vpcdns_resolution_binding_model] - vpcdns_resolution_binding_collection_model_json['first'] = vpcdns_resolution_binding_collection_first_model + vpcdns_resolution_binding_collection_model_json['first'] = page_link_model vpcdns_resolution_binding_collection_model_json['limit'] = 20 - vpcdns_resolution_binding_collection_model_json['next'] = vpcdns_resolution_binding_collection_next_model + vpcdns_resolution_binding_collection_model_json['next'] = page_link_model vpcdns_resolution_binding_collection_model_json['total_count'] = 132 # Construct a model instance of VPCDNSResolutionBindingCollection by calling from_dict on the json representation @@ -73745,66 +75584,6 @@ def test_vpcdns_resolution_binding_collection_serialization(self): assert vpcdns_resolution_binding_collection_model_json2 == vpcdns_resolution_binding_collection_model_json -class TestModel_VPCDNSResolutionBindingCollectionFirst: - """ - Test Class for VPCDNSResolutionBindingCollectionFirst - """ - - def test_vpcdns_resolution_binding_collection_first_serialization(self): - """ - Test serialization/deserialization for VPCDNSResolutionBindingCollectionFirst - """ - - # Construct a json representation of a VPCDNSResolutionBindingCollectionFirst model - vpcdns_resolution_binding_collection_first_model_json = {} - vpcdns_resolution_binding_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?limit=20' - - # Construct a model instance of VPCDNSResolutionBindingCollectionFirst by calling from_dict on the json representation - vpcdns_resolution_binding_collection_first_model = VPCDNSResolutionBindingCollectionFirst.from_dict(vpcdns_resolution_binding_collection_first_model_json) - assert vpcdns_resolution_binding_collection_first_model != False - - # Construct a model instance of VPCDNSResolutionBindingCollectionFirst by calling from_dict on the json representation - vpcdns_resolution_binding_collection_first_model_dict = VPCDNSResolutionBindingCollectionFirst.from_dict(vpcdns_resolution_binding_collection_first_model_json).__dict__ - vpcdns_resolution_binding_collection_first_model2 = VPCDNSResolutionBindingCollectionFirst(**vpcdns_resolution_binding_collection_first_model_dict) - - # Verify the model instances are equivalent - assert vpcdns_resolution_binding_collection_first_model == vpcdns_resolution_binding_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - vpcdns_resolution_binding_collection_first_model_json2 = vpcdns_resolution_binding_collection_first_model.to_dict() - assert vpcdns_resolution_binding_collection_first_model_json2 == vpcdns_resolution_binding_collection_first_model_json - - -class TestModel_VPCDNSResolutionBindingCollectionNext: - """ - Test Class for VPCDNSResolutionBindingCollectionNext - """ - - def test_vpcdns_resolution_binding_collection_next_serialization(self): - """ - Test serialization/deserialization for VPCDNSResolutionBindingCollectionNext - """ - - # Construct a json representation of a VPCDNSResolutionBindingCollectionNext model - vpcdns_resolution_binding_collection_next_model_json = {} - vpcdns_resolution_binding_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of VPCDNSResolutionBindingCollectionNext by calling from_dict on the json representation - vpcdns_resolution_binding_collection_next_model = VPCDNSResolutionBindingCollectionNext.from_dict(vpcdns_resolution_binding_collection_next_model_json) - assert vpcdns_resolution_binding_collection_next_model != False - - # Construct a model instance of VPCDNSResolutionBindingCollectionNext by calling from_dict on the json representation - vpcdns_resolution_binding_collection_next_model_dict = VPCDNSResolutionBindingCollectionNext.from_dict(vpcdns_resolution_binding_collection_next_model_json).__dict__ - vpcdns_resolution_binding_collection_next_model2 = VPCDNSResolutionBindingCollectionNext(**vpcdns_resolution_binding_collection_next_model_dict) - - # Verify the model instances are equivalent - assert vpcdns_resolution_binding_collection_next_model == vpcdns_resolution_binding_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - vpcdns_resolution_binding_collection_next_model_json2 = vpcdns_resolution_binding_collection_next_model.to_dict() - assert vpcdns_resolution_binding_collection_next_model_json2 == vpcdns_resolution_binding_collection_next_model_json - - class TestModel_VPCDNSResolutionBindingHealthReason: """ Test Class for VPCDNSResolutionBindingHealthReason @@ -74190,11 +75969,8 @@ def test_vpn_gateway_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_gateway_collection_first_model = {} # VPNGatewayCollectionFirst - vpn_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20' - - vpn_gateway_collection_next_model = {} # VPNGatewayCollectionNext - vpn_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -74287,9 +76063,9 @@ def test_vpn_gateway_collection_serialization(self): # Construct a json representation of a VPNGatewayCollection model vpn_gateway_collection_model_json = {} - vpn_gateway_collection_model_json['first'] = vpn_gateway_collection_first_model + vpn_gateway_collection_model_json['first'] = page_link_model vpn_gateway_collection_model_json['limit'] = 20 - vpn_gateway_collection_model_json['next'] = vpn_gateway_collection_next_model + vpn_gateway_collection_model_json['next'] = page_link_model vpn_gateway_collection_model_json['total_count'] = 132 vpn_gateway_collection_model_json['vpn_gateways'] = [vpn_gateway_model] @@ -74309,66 +76085,6 @@ def test_vpn_gateway_collection_serialization(self): assert vpn_gateway_collection_model_json2 == vpn_gateway_collection_model_json -class TestModel_VPNGatewayCollectionFirst: - """ - Test Class for VPNGatewayCollectionFirst - """ - - def test_vpn_gateway_collection_first_serialization(self): - """ - Test serialization/deserialization for VPNGatewayCollectionFirst - """ - - # Construct a json representation of a VPNGatewayCollectionFirst model - vpn_gateway_collection_first_model_json = {} - vpn_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20' - - # Construct a model instance of VPNGatewayCollectionFirst by calling from_dict on the json representation - vpn_gateway_collection_first_model = VPNGatewayCollectionFirst.from_dict(vpn_gateway_collection_first_model_json) - assert vpn_gateway_collection_first_model != False - - # Construct a model instance of VPNGatewayCollectionFirst by calling from_dict on the json representation - vpn_gateway_collection_first_model_dict = VPNGatewayCollectionFirst.from_dict(vpn_gateway_collection_first_model_json).__dict__ - vpn_gateway_collection_first_model2 = VPNGatewayCollectionFirst(**vpn_gateway_collection_first_model_dict) - - # Verify the model instances are equivalent - assert vpn_gateway_collection_first_model == vpn_gateway_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_gateway_collection_first_model_json2 = vpn_gateway_collection_first_model.to_dict() - assert vpn_gateway_collection_first_model_json2 == vpn_gateway_collection_first_model_json - - -class TestModel_VPNGatewayCollectionNext: - """ - Test Class for VPNGatewayCollectionNext - """ - - def test_vpn_gateway_collection_next_serialization(self): - """ - Test serialization/deserialization for VPNGatewayCollectionNext - """ - - # Construct a json representation of a VPNGatewayCollectionNext model - vpn_gateway_collection_next_model_json = {} - vpn_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20' - - # Construct a model instance of VPNGatewayCollectionNext by calling from_dict on the json representation - vpn_gateway_collection_next_model = VPNGatewayCollectionNext.from_dict(vpn_gateway_collection_next_model_json) - assert vpn_gateway_collection_next_model != False - - # Construct a model instance of VPNGatewayCollectionNext by calling from_dict on the json representation - vpn_gateway_collection_next_model_dict = VPNGatewayCollectionNext.from_dict(vpn_gateway_collection_next_model_json).__dict__ - vpn_gateway_collection_next_model2 = VPNGatewayCollectionNext(**vpn_gateway_collection_next_model_dict) - - # Verify the model instances are equivalent - assert vpn_gateway_collection_next_model == vpn_gateway_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_gateway_collection_next_model_json2 = vpn_gateway_collection_next_model.to_dict() - assert vpn_gateway_collection_next_model_json2 == vpn_gateway_collection_next_model_json - - class TestModel_VPNGatewayConnectionCIDRs: """ Test Class for VPNGatewayConnectionCIDRs @@ -74471,18 +76187,15 @@ def test_vpn_gateway_connection_collection_serialization(self): vpn_gateway_connection_model['local'] = vpn_gateway_connection_policy_mode_local_model vpn_gateway_connection_model['peer'] = vpn_gateway_connection_policy_mode_peer_model - vpn_gateway_connection_collection_first_model = {} # VPNGatewayConnectionCollectionFirst - vpn_gateway_connection_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?limit=20' - - vpn_gateway_connection_collection_next_model = {} # VPNGatewayConnectionCollectionNext - vpn_gateway_connection_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?start=b67efb2c-bd17-457d-be8e-7b46404062dc&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?limit=20' # Construct a json representation of a VPNGatewayConnectionCollection model vpn_gateway_connection_collection_model_json = {} vpn_gateway_connection_collection_model_json['connections'] = [vpn_gateway_connection_model] - vpn_gateway_connection_collection_model_json['first'] = vpn_gateway_connection_collection_first_model + vpn_gateway_connection_collection_model_json['first'] = page_link_model vpn_gateway_connection_collection_model_json['limit'] = 20 - vpn_gateway_connection_collection_model_json['next'] = vpn_gateway_connection_collection_next_model + vpn_gateway_connection_collection_model_json['next'] = page_link_model vpn_gateway_connection_collection_model_json['total_count'] = 132 # Construct a model instance of VPNGatewayConnectionCollection by calling from_dict on the json representation @@ -74501,66 +76214,6 @@ def test_vpn_gateway_connection_collection_serialization(self): assert vpn_gateway_connection_collection_model_json2 == vpn_gateway_connection_collection_model_json -class TestModel_VPNGatewayConnectionCollectionFirst: - """ - Test Class for VPNGatewayConnectionCollectionFirst - """ - - def test_vpn_gateway_connection_collection_first_serialization(self): - """ - Test serialization/deserialization for VPNGatewayConnectionCollectionFirst - """ - - # Construct a json representation of a VPNGatewayConnectionCollectionFirst model - vpn_gateway_connection_collection_first_model_json = {} - vpn_gateway_connection_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?limit=20' - - # Construct a model instance of VPNGatewayConnectionCollectionFirst by calling from_dict on the json representation - vpn_gateway_connection_collection_first_model = VPNGatewayConnectionCollectionFirst.from_dict(vpn_gateway_connection_collection_first_model_json) - assert vpn_gateway_connection_collection_first_model != False - - # Construct a model instance of VPNGatewayConnectionCollectionFirst by calling from_dict on the json representation - vpn_gateway_connection_collection_first_model_dict = VPNGatewayConnectionCollectionFirst.from_dict(vpn_gateway_connection_collection_first_model_json).__dict__ - vpn_gateway_connection_collection_first_model2 = VPNGatewayConnectionCollectionFirst(**vpn_gateway_connection_collection_first_model_dict) - - # Verify the model instances are equivalent - assert vpn_gateway_connection_collection_first_model == vpn_gateway_connection_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_collection_first_model_json2 = vpn_gateway_connection_collection_first_model.to_dict() - assert vpn_gateway_connection_collection_first_model_json2 == vpn_gateway_connection_collection_first_model_json - - -class TestModel_VPNGatewayConnectionCollectionNext: - """ - Test Class for VPNGatewayConnectionCollectionNext - """ - - def test_vpn_gateway_connection_collection_next_serialization(self): - """ - Test serialization/deserialization for VPNGatewayConnectionCollectionNext - """ - - # Construct a json representation of a VPNGatewayConnectionCollectionNext model - vpn_gateway_connection_collection_next_model_json = {} - vpn_gateway_connection_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?start=b67efb2c-bd17-457d-be8e-7b46404062dc&limit=20' - - # Construct a model instance of VPNGatewayConnectionCollectionNext by calling from_dict on the json representation - vpn_gateway_connection_collection_next_model = VPNGatewayConnectionCollectionNext.from_dict(vpn_gateway_connection_collection_next_model_json) - assert vpn_gateway_connection_collection_next_model != False - - # Construct a model instance of VPNGatewayConnectionCollectionNext by calling from_dict on the json representation - vpn_gateway_connection_collection_next_model_dict = VPNGatewayConnectionCollectionNext.from_dict(vpn_gateway_connection_collection_next_model_json).__dict__ - vpn_gateway_connection_collection_next_model2 = VPNGatewayConnectionCollectionNext(**vpn_gateway_connection_collection_next_model_dict) - - # Verify the model instances are equivalent - assert vpn_gateway_connection_collection_next_model == vpn_gateway_connection_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_gateway_connection_collection_next_model_json2 = vpn_gateway_connection_collection_next_model.to_dict() - assert vpn_gateway_connection_collection_next_model_json2 == vpn_gateway_connection_collection_next_model_json - - class TestModel_VPNGatewayConnectionDPD: """ Test Class for VPNGatewayConnectionDPD @@ -75414,18 +77067,15 @@ def test_vpn_server_client_collection_serialization(self): vpn_server_client_model['status'] = 'connected' vpn_server_client_model['username'] = 'testString' - vpn_server_client_collection_first_model = {} # VPNServerClientCollectionFirst - vpn_server_client_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20' - - vpn_server_client_collection_next_model = {} # VPNServerClientCollectionNext - vpn_server_client_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20' # Construct a json representation of a VPNServerClientCollection model vpn_server_client_collection_model_json = {} vpn_server_client_collection_model_json['clients'] = [vpn_server_client_model] - vpn_server_client_collection_model_json['first'] = vpn_server_client_collection_first_model + vpn_server_client_collection_model_json['first'] = page_link_model vpn_server_client_collection_model_json['limit'] = 20 - vpn_server_client_collection_model_json['next'] = vpn_server_client_collection_next_model + vpn_server_client_collection_model_json['next'] = page_link_model vpn_server_client_collection_model_json['total_count'] = 132 # Construct a model instance of VPNServerClientCollection by calling from_dict on the json representation @@ -75444,66 +77094,6 @@ def test_vpn_server_client_collection_serialization(self): assert vpn_server_client_collection_model_json2 == vpn_server_client_collection_model_json -class TestModel_VPNServerClientCollectionFirst: - """ - Test Class for VPNServerClientCollectionFirst - """ - - def test_vpn_server_client_collection_first_serialization(self): - """ - Test serialization/deserialization for VPNServerClientCollectionFirst - """ - - # Construct a json representation of a VPNServerClientCollectionFirst model - vpn_server_client_collection_first_model_json = {} - vpn_server_client_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20' - - # Construct a model instance of VPNServerClientCollectionFirst by calling from_dict on the json representation - vpn_server_client_collection_first_model = VPNServerClientCollectionFirst.from_dict(vpn_server_client_collection_first_model_json) - assert vpn_server_client_collection_first_model != False - - # Construct a model instance of VPNServerClientCollectionFirst by calling from_dict on the json representation - vpn_server_client_collection_first_model_dict = VPNServerClientCollectionFirst.from_dict(vpn_server_client_collection_first_model_json).__dict__ - vpn_server_client_collection_first_model2 = VPNServerClientCollectionFirst(**vpn_server_client_collection_first_model_dict) - - # Verify the model instances are equivalent - assert vpn_server_client_collection_first_model == vpn_server_client_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_server_client_collection_first_model_json2 = vpn_server_client_collection_first_model.to_dict() - assert vpn_server_client_collection_first_model_json2 == vpn_server_client_collection_first_model_json - - -class TestModel_VPNServerClientCollectionNext: - """ - Test Class for VPNServerClientCollectionNext - """ - - def test_vpn_server_client_collection_next_serialization(self): - """ - Test serialization/deserialization for VPNServerClientCollectionNext - """ - - # Construct a json representation of a VPNServerClientCollectionNext model - vpn_server_client_collection_next_model_json = {} - vpn_server_client_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' - - # Construct a model instance of VPNServerClientCollectionNext by calling from_dict on the json representation - vpn_server_client_collection_next_model = VPNServerClientCollectionNext.from_dict(vpn_server_client_collection_next_model_json) - assert vpn_server_client_collection_next_model != False - - # Construct a model instance of VPNServerClientCollectionNext by calling from_dict on the json representation - vpn_server_client_collection_next_model_dict = VPNServerClientCollectionNext.from_dict(vpn_server_client_collection_next_model_json).__dict__ - vpn_server_client_collection_next_model2 = VPNServerClientCollectionNext(**vpn_server_client_collection_next_model_dict) - - # Verify the model instances are equivalent - assert vpn_server_client_collection_next_model == vpn_server_client_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_server_client_collection_next_model_json2 = vpn_server_client_collection_next_model.to_dict() - assert vpn_server_client_collection_next_model_json2 == vpn_server_client_collection_next_model_json - - class TestModel_VPNServerCollection: """ Test Class for VPNServerCollection @@ -75516,11 +77106,8 @@ def test_vpn_server_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_server_collection_first_model = {} # VPNServerCollectionFirst - vpn_server_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20' - - vpn_server_collection_next_model = {} # VPNServerCollectionNext - vpn_server_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20' certificate_instance_reference_model = {} # CertificateInstanceReference certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' @@ -75614,9 +77201,9 @@ def test_vpn_server_collection_serialization(self): # Construct a json representation of a VPNServerCollection model vpn_server_collection_model_json = {} - vpn_server_collection_model_json['first'] = vpn_server_collection_first_model + vpn_server_collection_model_json['first'] = page_link_model vpn_server_collection_model_json['limit'] = 20 - vpn_server_collection_model_json['next'] = vpn_server_collection_next_model + vpn_server_collection_model_json['next'] = page_link_model vpn_server_collection_model_json['total_count'] = 132 vpn_server_collection_model_json['vpn_servers'] = [vpn_server_model] @@ -75636,66 +77223,6 @@ def test_vpn_server_collection_serialization(self): assert vpn_server_collection_model_json2 == vpn_server_collection_model_json -class TestModel_VPNServerCollectionFirst: - """ - Test Class for VPNServerCollectionFirst - """ - - def test_vpn_server_collection_first_serialization(self): - """ - Test serialization/deserialization for VPNServerCollectionFirst - """ - - # Construct a json representation of a VPNServerCollectionFirst model - vpn_server_collection_first_model_json = {} - vpn_server_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20' - - # Construct a model instance of VPNServerCollectionFirst by calling from_dict on the json representation - vpn_server_collection_first_model = VPNServerCollectionFirst.from_dict(vpn_server_collection_first_model_json) - assert vpn_server_collection_first_model != False - - # Construct a model instance of VPNServerCollectionFirst by calling from_dict on the json representation - vpn_server_collection_first_model_dict = VPNServerCollectionFirst.from_dict(vpn_server_collection_first_model_json).__dict__ - vpn_server_collection_first_model2 = VPNServerCollectionFirst(**vpn_server_collection_first_model_dict) - - # Verify the model instances are equivalent - assert vpn_server_collection_first_model == vpn_server_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_server_collection_first_model_json2 = vpn_server_collection_first_model.to_dict() - assert vpn_server_collection_first_model_json2 == vpn_server_collection_first_model_json - - -class TestModel_VPNServerCollectionNext: - """ - Test Class for VPNServerCollectionNext - """ - - def test_vpn_server_collection_next_serialization(self): - """ - Test serialization/deserialization for VPNServerCollectionNext - """ - - # Construct a json representation of a VPNServerCollectionNext model - vpn_server_collection_next_model_json = {} - vpn_server_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20' - - # Construct a model instance of VPNServerCollectionNext by calling from_dict on the json representation - vpn_server_collection_next_model = VPNServerCollectionNext.from_dict(vpn_server_collection_next_model_json) - assert vpn_server_collection_next_model != False - - # Construct a model instance of VPNServerCollectionNext by calling from_dict on the json representation - vpn_server_collection_next_model_dict = VPNServerCollectionNext.from_dict(vpn_server_collection_next_model_json).__dict__ - vpn_server_collection_next_model2 = VPNServerCollectionNext(**vpn_server_collection_next_model_dict) - - # Verify the model instances are equivalent - assert vpn_server_collection_next_model == vpn_server_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_server_collection_next_model_json2 = vpn_server_collection_next_model.to_dict() - assert vpn_server_collection_next_model_json2 == vpn_server_collection_next_model_json - - class TestModel_VPNServerHealthReason: """ Test Class for VPNServerHealthReason @@ -75881,11 +77408,8 @@ def test_vpn_server_route_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - vpn_server_route_collection_first_model = {} # VPNServerRouteCollectionFirst - vpn_server_route_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20' - - vpn_server_route_collection_next_model = {} # VPNServerRouteCollectionNext - vpn_server_route_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20' vpn_server_route_health_reason_model = {} # VPNServerRouteHealthReason vpn_server_route_health_reason_model['code'] = 'internal_error' @@ -75912,9 +77436,9 @@ def test_vpn_server_route_collection_serialization(self): # Construct a json representation of a VPNServerRouteCollection model vpn_server_route_collection_model_json = {} - vpn_server_route_collection_model_json['first'] = vpn_server_route_collection_first_model + vpn_server_route_collection_model_json['first'] = page_link_model vpn_server_route_collection_model_json['limit'] = 20 - vpn_server_route_collection_model_json['next'] = vpn_server_route_collection_next_model + vpn_server_route_collection_model_json['next'] = page_link_model vpn_server_route_collection_model_json['routes'] = [vpn_server_route_model] vpn_server_route_collection_model_json['total_count'] = 132 @@ -75934,66 +77458,6 @@ def test_vpn_server_route_collection_serialization(self): assert vpn_server_route_collection_model_json2 == vpn_server_route_collection_model_json -class TestModel_VPNServerRouteCollectionFirst: - """ - Test Class for VPNServerRouteCollectionFirst - """ - - def test_vpn_server_route_collection_first_serialization(self): - """ - Test serialization/deserialization for VPNServerRouteCollectionFirst - """ - - # Construct a json representation of a VPNServerRouteCollectionFirst model - vpn_server_route_collection_first_model_json = {} - vpn_server_route_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20' - - # Construct a model instance of VPNServerRouteCollectionFirst by calling from_dict on the json representation - vpn_server_route_collection_first_model = VPNServerRouteCollectionFirst.from_dict(vpn_server_route_collection_first_model_json) - assert vpn_server_route_collection_first_model != False - - # Construct a model instance of VPNServerRouteCollectionFirst by calling from_dict on the json representation - vpn_server_route_collection_first_model_dict = VPNServerRouteCollectionFirst.from_dict(vpn_server_route_collection_first_model_json).__dict__ - vpn_server_route_collection_first_model2 = VPNServerRouteCollectionFirst(**vpn_server_route_collection_first_model_dict) - - # Verify the model instances are equivalent - assert vpn_server_route_collection_first_model == vpn_server_route_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_server_route_collection_first_model_json2 = vpn_server_route_collection_first_model.to_dict() - assert vpn_server_route_collection_first_model_json2 == vpn_server_route_collection_first_model_json - - -class TestModel_VPNServerRouteCollectionNext: - """ - Test Class for VPNServerRouteCollectionNext - """ - - def test_vpn_server_route_collection_next_serialization(self): - """ - Test serialization/deserialization for VPNServerRouteCollectionNext - """ - - # Construct a json representation of a VPNServerRouteCollectionNext model - vpn_server_route_collection_next_model_json = {} - vpn_server_route_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' - - # Construct a model instance of VPNServerRouteCollectionNext by calling from_dict on the json representation - vpn_server_route_collection_next_model = VPNServerRouteCollectionNext.from_dict(vpn_server_route_collection_next_model_json) - assert vpn_server_route_collection_next_model != False - - # Construct a model instance of VPNServerRouteCollectionNext by calling from_dict on the json representation - vpn_server_route_collection_next_model_dict = VPNServerRouteCollectionNext.from_dict(vpn_server_route_collection_next_model_json).__dict__ - vpn_server_route_collection_next_model2 = VPNServerRouteCollectionNext(**vpn_server_route_collection_next_model_dict) - - # Verify the model instances are equivalent - assert vpn_server_route_collection_next_model == vpn_server_route_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - vpn_server_route_collection_next_model_json2 = vpn_server_route_collection_next_model.to_dict() - assert vpn_server_route_collection_next_model_json2 == vpn_server_route_collection_next_model_json - - class TestModel_VPNServerRouteHealthReason: """ Test Class for VPNServerRouteHealthReason @@ -76104,45 +77568,45 @@ def test_virtual_network_interface_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.0.0.32' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' - reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' - reserved_ip_reference_model['name'] = 'my-reserved-ip-1' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' - resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'Default' security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model['crn'] = 'crn:[...]' + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['deleted'] = deleted_model - security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589' - security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589' + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:[...]' + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c' - subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_target_model = {} # VirtualNetworkInterfaceTargetShareMountTargetReference virtual_network_interface_target_model['deleted'] = deleted_model - virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' virtual_network_interface_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' virtual_network_interface_target_model['name'] = 'my-share-mount-target' virtual_network_interface_target_model['resource_type'] = 'share_mount_target' vpc_reference_model = {} # VPCReference - vpc_reference_model['crn'] = 'crn:[...]' + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = deleted_model - vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a0819609-0997-4f92-9409-86c95ddf59d3' - vpc_reference_model['id'] = 'a0819609-0997-4f92-9409-86c95ddf59d3' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' vpc_reference_model['resource_type'] = 'vpc' @@ -76155,10 +77619,10 @@ def test_virtual_network_interface_serialization(self): virtual_network_interface_model_json['allow_ip_spoofing'] = True virtual_network_interface_model_json['auto_delete'] = False virtual_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z' - virtual_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_model_json['enable_infrastructure_nat'] = True - virtual_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_model_json['ips'] = [reserved_ip_reference_model] virtual_network_interface_model_json['lifecycle_state'] = 'stable' virtual_network_interface_model_json['mac_address'] = '02:00:4D:45:45:4D' @@ -76201,55 +77665,52 @@ def test_virtual_network_interface_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - virtual_network_interface_collection_first_model = {} # VirtualNetworkInterfaceCollectionFirst - virtual_network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20' - - virtual_network_interface_collection_next_model = {} # VirtualNetworkInterfaceCollectionNext - virtual_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.0.0.32' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' - reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' - reserved_ip_reference_model['name'] = 'my-reserved-ip-1' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' resource_group_reference_model = {} # ResourceGroupReference - resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' - resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'Default' security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model['crn'] = 'crn:[...]' + security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['deleted'] = deleted_model - security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589' - security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589' + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_reference_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_reference_model['name'] = 'my-security-group' subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:[...]' + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['deleted'] = deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c' - subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c' + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e' subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_target_model = {} # VirtualNetworkInterfaceTargetShareMountTargetReference virtual_network_interface_target_model['deleted'] = deleted_model - virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' virtual_network_interface_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' virtual_network_interface_target_model['name'] = 'my-share-mount-target' virtual_network_interface_target_model['resource_type'] = 'share_mount_target' vpc_reference_model = {} # VPCReference - vpc_reference_model['crn'] = 'crn:[...]' + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['deleted'] = deleted_model - vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a0819609-0997-4f92-9409-86c95ddf59d3' - vpc_reference_model['id'] = 'a0819609-0997-4f92-9409-86c95ddf59d3' + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = 'r006-4727d842-f94f-4a2d-824a-9bc9b02c523b' vpc_reference_model['name'] = 'my-vpc' vpc_reference_model['resource_type'] = 'vpc' @@ -76260,11 +77721,11 @@ def test_virtual_network_interface_collection_serialization(self): virtual_network_interface_model = {} # VirtualNetworkInterface virtual_network_interface_model['allow_ip_spoofing'] = False virtual_network_interface_model['auto_delete'] = True - virtual_network_interface_model['created_at'] = '2019-01-31T03:42:32.993000Z' - virtual_network_interface_model['crn'] = 'crn:[...]' + virtual_network_interface_model['created_at'] = '2024-10-15T03:24:32.993000Z' + virtual_network_interface_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_model['enable_infrastructure_nat'] = False - virtual_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-54eb57ee-86f2-4796-90bb-d7874e0831ef' - virtual_network_interface_model['id'] = '0767-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_model['ips'] = [reserved_ip_reference_model] virtual_network_interface_model['lifecycle_state'] = 'stable' virtual_network_interface_model['mac_address'] = '02:00:04:00:C4:6A' @@ -76281,9 +77742,9 @@ def test_virtual_network_interface_collection_serialization(self): # Construct a json representation of a VirtualNetworkInterfaceCollection model virtual_network_interface_collection_model_json = {} - virtual_network_interface_collection_model_json['first'] = virtual_network_interface_collection_first_model + virtual_network_interface_collection_model_json['first'] = page_link_model virtual_network_interface_collection_model_json['limit'] = 20 - virtual_network_interface_collection_model_json['next'] = virtual_network_interface_collection_next_model + virtual_network_interface_collection_model_json['next'] = page_link_model virtual_network_interface_collection_model_json['total_count'] = 132 virtual_network_interface_collection_model_json['virtual_network_interfaces'] = [virtual_network_interface_model] @@ -76303,66 +77764,6 @@ def test_virtual_network_interface_collection_serialization(self): assert virtual_network_interface_collection_model_json2 == virtual_network_interface_collection_model_json -class TestModel_VirtualNetworkInterfaceCollectionFirst: - """ - Test Class for VirtualNetworkInterfaceCollectionFirst - """ - - def test_virtual_network_interface_collection_first_serialization(self): - """ - Test serialization/deserialization for VirtualNetworkInterfaceCollectionFirst - """ - - # Construct a json representation of a VirtualNetworkInterfaceCollectionFirst model - virtual_network_interface_collection_first_model_json = {} - virtual_network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20' - - # Construct a model instance of VirtualNetworkInterfaceCollectionFirst by calling from_dict on the json representation - virtual_network_interface_collection_first_model = VirtualNetworkInterfaceCollectionFirst.from_dict(virtual_network_interface_collection_first_model_json) - assert virtual_network_interface_collection_first_model != False - - # Construct a model instance of VirtualNetworkInterfaceCollectionFirst by calling from_dict on the json representation - virtual_network_interface_collection_first_model_dict = VirtualNetworkInterfaceCollectionFirst.from_dict(virtual_network_interface_collection_first_model_json).__dict__ - virtual_network_interface_collection_first_model2 = VirtualNetworkInterfaceCollectionFirst(**virtual_network_interface_collection_first_model_dict) - - # Verify the model instances are equivalent - assert virtual_network_interface_collection_first_model == virtual_network_interface_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - virtual_network_interface_collection_first_model_json2 = virtual_network_interface_collection_first_model.to_dict() - assert virtual_network_interface_collection_first_model_json2 == virtual_network_interface_collection_first_model_json - - -class TestModel_VirtualNetworkInterfaceCollectionNext: - """ - Test Class for VirtualNetworkInterfaceCollectionNext - """ - - def test_virtual_network_interface_collection_next_serialization(self): - """ - Test serialization/deserialization for VirtualNetworkInterfaceCollectionNext - """ - - # Construct a json representation of a VirtualNetworkInterfaceCollectionNext model - virtual_network_interface_collection_next_model_json = {} - virtual_network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' - - # Construct a model instance of VirtualNetworkInterfaceCollectionNext by calling from_dict on the json representation - virtual_network_interface_collection_next_model = VirtualNetworkInterfaceCollectionNext.from_dict(virtual_network_interface_collection_next_model_json) - assert virtual_network_interface_collection_next_model != False - - # Construct a model instance of VirtualNetworkInterfaceCollectionNext by calling from_dict on the json representation - virtual_network_interface_collection_next_model_dict = VirtualNetworkInterfaceCollectionNext.from_dict(virtual_network_interface_collection_next_model_json).__dict__ - virtual_network_interface_collection_next_model2 = VirtualNetworkInterfaceCollectionNext(**virtual_network_interface_collection_next_model_dict) - - # Verify the model instances are equivalent - assert virtual_network_interface_collection_next_model == virtual_network_interface_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - virtual_network_interface_collection_next_model_json2 = virtual_network_interface_collection_next_model.to_dict() - assert virtual_network_interface_collection_next_model_json2 == virtual_network_interface_collection_next_model_json - - class TestModel_VirtualNetworkInterfacePatch: """ Test Class for VirtualNetworkInterfacePatch @@ -76409,9 +77810,9 @@ def test_virtual_network_interface_reference_attachment_context_serialization(se # Construct a json representation of a VirtualNetworkInterfaceReferenceAttachmentContext model virtual_network_interface_reference_attachment_context_model_json = {} - virtual_network_interface_reference_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model_json['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model_json['resource_type'] = 'virtual_network_interface' @@ -76526,7 +77927,7 @@ def test_volume_serialization(self): volume_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model['id'] = 'testString' instance_reference_model = {} # InstanceReference instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' @@ -76539,7 +77940,7 @@ def test_volume_serialization(self): volume_attachment_reference_volume_context_model['delete_volume_on_instance_delete'] = False volume_attachment_reference_volume_context_model['deleted'] = deleted_model volume_attachment_reference_volume_context_model['device'] = volume_attachment_device_model - volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_volume_context_model['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_volume_context_model['instance'] = instance_reference_model volume_attachment_reference_volume_context_model['name'] = 'my-volume-attachment' @@ -76610,17 +78011,17 @@ def test_volume_attachment_serialization(self): # Construct dict forms of any model objects needed in order to build this model. volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model['id'] = 'testString' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext - volume_reference_volume_attachment_context_model['crn'] = 'crn:[...]' + volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_reference_volume_attachment_context_model['deleted'] = deleted_model - volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ca4b6df3-f5a8-4667-b5f2-f3b9b4160781' - volume_reference_volume_attachment_context_model['id'] = 'ca4b6df3-f5a8-4667-b5f2-f3b9b4160781' - volume_reference_volume_attachment_context_model['name'] = 'my-data-volume' + volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_volume_attachment_context_model['id'] = 'r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + volume_reference_volume_attachment_context_model['name'] = 'my-volume' volume_reference_volume_attachment_context_model['resource_type'] = 'volume' # Construct a json representation of a VolumeAttachment model @@ -76629,7 +78030,7 @@ def test_volume_attachment_serialization(self): volume_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z' volume_attachment_model_json['delete_volume_on_instance_delete'] = True volume_attachment_model_json['device'] = volume_attachment_device_model - volume_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_model_json['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_model_json['name'] = 'my-volume-attachment' volume_attachment_model_json['status'] = 'attached' @@ -76665,26 +78066,26 @@ def test_volume_attachment_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a-w8mw8' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext - volume_reference_volume_attachment_context_model['crn'] = 'crn:[...]' + volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-89b05e9a-e635-9464-9747-7ae3f9b03303' volume_reference_volume_attachment_context_model['deleted'] = deleted_model - volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6' - volume_reference_volume_attachment_context_model['id'] = 'ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6' + volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-89b05e9a-e635-9464-9747-7ae3f9b03303' + volume_reference_volume_attachment_context_model['id'] = 'r006-89b05e9a-e635-9464-9747-7ae3f9b03303' volume_reference_volume_attachment_context_model['name'] = 'my-boot-volume' volume_reference_volume_attachment_context_model['resource_type'] = 'volume' volume_attachment_model = {} # VolumeAttachment volume_attachment_model['bandwidth'] = 250 - volume_attachment_model['created_at'] = '2019-02-28T16:32:05Z' - volume_attachment_model['delete_volume_on_instance_delete'] = False + volume_attachment_model['created_at'] = '2024-10-24T16:32:05Z' + volume_attachment_model['delete_volume_on_instance_delete'] = True volume_attachment_model['device'] = volume_attachment_device_model - volume_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/8f06378c-ed0e-481e-b98c-9a6dfbee1ed5/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88' - volume_attachment_model['id'] = 'fdb3642d-c849-4c29-97a9-03b868616f88' + volume_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-fdb3642d-c849-4c29-97a9-03b868616f88' + volume_attachment_model['id'] = '0717-fdb3642d-c849-4c29-97a9-03b868616f88' volume_attachment_model['name'] = 'my-boot-volume-attachment' volume_attachment_model['status'] = 'attached' volume_attachment_model['type'] = 'boot' @@ -76722,7 +78123,7 @@ def test_volume_attachment_device_serialization(self): # Construct a json representation of a VolumeAttachmentDevice model volume_attachment_device_model_json = {} - volume_attachment_device_model_json['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model_json['id'] = 'testString' # Construct a model instance of VolumeAttachmentDevice by calling from_dict on the json representation volume_attachment_device_model = VolumeAttachmentDevice.from_dict(volume_attachment_device_model_json) @@ -76882,7 +78283,7 @@ def test_volume_attachment_prototype_instance_by_source_snapshot_context_seriali resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 @@ -76969,7 +78370,7 @@ def test_volume_attachment_reference_instance_context_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a-w8mw8' + volume_attachment_device_model['id'] = '0717-80b3e36e-41f4-40e9-bd56-beae81792a68-679qb' volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5' @@ -76983,7 +78384,7 @@ def test_volume_attachment_reference_instance_context_serialization(self): volume_attachment_reference_instance_context_model_json = {} volume_attachment_reference_instance_context_model_json['deleted'] = deleted_model volume_attachment_reference_instance_context_model_json['device'] = volume_attachment_device_model - volume_attachment_reference_instance_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_instance_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_instance_context_model_json['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_instance_context_model_json['name'] = 'my-volume-attachment' volume_attachment_reference_instance_context_model_json['volume'] = volume_reference_volume_attachment_context_model @@ -77020,7 +78421,7 @@ def test_volume_attachment_reference_volume_context_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model['id'] = 'testString' instance_reference_model = {} # InstanceReference instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' @@ -77034,7 +78435,7 @@ def test_volume_attachment_reference_volume_context_serialization(self): volume_attachment_reference_volume_context_model_json['delete_volume_on_instance_delete'] = True volume_attachment_reference_volume_context_model_json['deleted'] = deleted_model volume_attachment_reference_volume_context_model_json['device'] = volume_attachment_device_model - volume_attachment_reference_volume_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_volume_context_model_json['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_volume_context_model_json['instance'] = instance_reference_model volume_attachment_reference_volume_context_model_json['name'] = 'my-volume-attachment' @@ -77111,11 +78512,8 @@ def test_volume_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_collection_first_model = {} # VolumeCollectionFirst - volume_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=50' - - volume_collection_next_model = {} # VolumeCollectionNext - volume_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=50' deleted_model = {} # Deleted deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -77200,7 +78598,7 @@ def test_volume_collection_serialization(self): volume_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' volume_attachment_device_model = {} # VolumeAttachmentDevice - volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68' + volume_attachment_device_model['id'] = 'testString' instance_reference_model = {} # InstanceReference instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' @@ -77213,7 +78611,7 @@ def test_volume_collection_serialization(self): volume_attachment_reference_volume_context_model['delete_volume_on_instance_delete'] = False volume_attachment_reference_volume_context_model['deleted'] = deleted_model volume_attachment_reference_volume_context_model['device'] = volume_attachment_device_model - volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46f2-b1f1-bc152b2e391a/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' + volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_volume_context_model['id'] = '0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a' volume_attachment_reference_volume_context_model['instance'] = instance_reference_model volume_attachment_reference_volume_context_model['name'] = 'my-volume-attachment' @@ -77256,9 +78654,9 @@ def test_volume_collection_serialization(self): # Construct a json representation of a VolumeCollection model volume_collection_model_json = {} - volume_collection_model_json['first'] = volume_collection_first_model + volume_collection_model_json['first'] = page_link_model volume_collection_model_json['limit'] = 20 - volume_collection_model_json['next'] = volume_collection_next_model + volume_collection_model_json['next'] = page_link_model volume_collection_model_json['total_count'] = 132 volume_collection_model_json['volumes'] = [volume_model] @@ -77278,66 +78676,6 @@ def test_volume_collection_serialization(self): assert volume_collection_model_json2 == volume_collection_model_json -class TestModel_VolumeCollectionFirst: - """ - Test Class for VolumeCollectionFirst - """ - - def test_volume_collection_first_serialization(self): - """ - Test serialization/deserialization for VolumeCollectionFirst - """ - - # Construct a json representation of a VolumeCollectionFirst model - volume_collection_first_model_json = {} - volume_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20' - - # Construct a model instance of VolumeCollectionFirst by calling from_dict on the json representation - volume_collection_first_model = VolumeCollectionFirst.from_dict(volume_collection_first_model_json) - assert volume_collection_first_model != False - - # Construct a model instance of VolumeCollectionFirst by calling from_dict on the json representation - volume_collection_first_model_dict = VolumeCollectionFirst.from_dict(volume_collection_first_model_json).__dict__ - volume_collection_first_model2 = VolumeCollectionFirst(**volume_collection_first_model_dict) - - # Verify the model instances are equivalent - assert volume_collection_first_model == volume_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - volume_collection_first_model_json2 = volume_collection_first_model.to_dict() - assert volume_collection_first_model_json2 == volume_collection_first_model_json - - -class TestModel_VolumeCollectionNext: - """ - Test Class for VolumeCollectionNext - """ - - def test_volume_collection_next_serialization(self): - """ - Test serialization/deserialization for VolumeCollectionNext - """ - - # Construct a json representation of a VolumeCollectionNext model - volume_collection_next_model_json = {} - volume_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of VolumeCollectionNext by calling from_dict on the json representation - volume_collection_next_model = VolumeCollectionNext.from_dict(volume_collection_next_model_json) - assert volume_collection_next_model != False - - # Construct a model instance of VolumeCollectionNext by calling from_dict on the json representation - volume_collection_next_model_dict = VolumeCollectionNext.from_dict(volume_collection_next_model_json).__dict__ - volume_collection_next_model2 = VolumeCollectionNext(**volume_collection_next_model_dict) - - # Verify the model instances are equivalent - assert volume_collection_next_model == volume_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - volume_collection_next_model_json2 = volume_collection_next_model.to_dict() - assert volume_collection_next_model_json2 == volume_collection_next_model_json - - class TestModel_VolumeHealthReason: """ Test Class for VolumeHealthReason @@ -77551,11 +78889,8 @@ def test_volume_profile_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - volume_profile_collection_first_model = {} # VolumeProfileCollectionFirst - volume_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=50' - - volume_profile_collection_next_model = {} # VolumeProfileCollectionNext - volume_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + page_link_model = {} # PageLink + page_link_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=50' volume_profile_adjustable_capacity_states_model = {} # VolumeProfileAdjustableCapacityStates volume_profile_adjustable_capacity_states_model['type'] = 'enum' @@ -77598,9 +78933,9 @@ def test_volume_profile_collection_serialization(self): # Construct a json representation of a VolumeProfileCollection model volume_profile_collection_model_json = {} - volume_profile_collection_model_json['first'] = volume_profile_collection_first_model + volume_profile_collection_model_json['first'] = page_link_model volume_profile_collection_model_json['limit'] = 20 - volume_profile_collection_model_json['next'] = volume_profile_collection_next_model + volume_profile_collection_model_json['next'] = page_link_model volume_profile_collection_model_json['profiles'] = [volume_profile_model] volume_profile_collection_model_json['total_count'] = 132 @@ -77620,66 +78955,6 @@ def test_volume_profile_collection_serialization(self): assert volume_profile_collection_model_json2 == volume_profile_collection_model_json -class TestModel_VolumeProfileCollectionFirst: - """ - Test Class for VolumeProfileCollectionFirst - """ - - def test_volume_profile_collection_first_serialization(self): - """ - Test serialization/deserialization for VolumeProfileCollectionFirst - """ - - # Construct a json representation of a VolumeProfileCollectionFirst model - volume_profile_collection_first_model_json = {} - volume_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20' - - # Construct a model instance of VolumeProfileCollectionFirst by calling from_dict on the json representation - volume_profile_collection_first_model = VolumeProfileCollectionFirst.from_dict(volume_profile_collection_first_model_json) - assert volume_profile_collection_first_model != False - - # Construct a model instance of VolumeProfileCollectionFirst by calling from_dict on the json representation - volume_profile_collection_first_model_dict = VolumeProfileCollectionFirst.from_dict(volume_profile_collection_first_model_json).__dict__ - volume_profile_collection_first_model2 = VolumeProfileCollectionFirst(**volume_profile_collection_first_model_dict) - - # Verify the model instances are equivalent - assert volume_profile_collection_first_model == volume_profile_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - volume_profile_collection_first_model_json2 = volume_profile_collection_first_model.to_dict() - assert volume_profile_collection_first_model_json2 == volume_profile_collection_first_model_json - - -class TestModel_VolumeProfileCollectionNext: - """ - Test Class for VolumeProfileCollectionNext - """ - - def test_volume_profile_collection_next_serialization(self): - """ - Test serialization/deserialization for VolumeProfileCollectionNext - """ - - # Construct a json representation of a VolumeProfileCollectionNext model - volume_profile_collection_next_model_json = {} - volume_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' - - # Construct a model instance of VolumeProfileCollectionNext by calling from_dict on the json representation - volume_profile_collection_next_model = VolumeProfileCollectionNext.from_dict(volume_profile_collection_next_model_json) - assert volume_profile_collection_next_model != False - - # Construct a model instance of VolumeProfileCollectionNext by calling from_dict on the json representation - volume_profile_collection_next_model_dict = VolumeProfileCollectionNext.from_dict(volume_profile_collection_next_model_json).__dict__ - volume_profile_collection_next_model2 = VolumeProfileCollectionNext(**volume_profile_collection_next_model_dict) - - # Verify the model instances are equivalent - assert volume_profile_collection_next_model == volume_profile_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - volume_profile_collection_next_model_json2 = volume_profile_collection_next_model.to_dict() - assert volume_profile_collection_next_model_json2 == volume_profile_collection_next_model_json - - class TestModel_VolumeProfileReference: """ Test Class for VolumeProfileReference @@ -77780,7 +79055,7 @@ def test_volume_prototype_instance_by_source_snapshot_context_serialization(self resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' # Construct a json representation of a VolumePrototypeInstanceBySourceSnapshotContext model volume_prototype_instance_by_source_snapshot_context_model_json = {} @@ -78023,12 +79298,12 @@ def test_zone_collection_serialization(self): region_reference_model['name'] = 'us-south' zone_model = {} # Zone - zone_model['data_center'] = 'DAL13' + zone_model['data_center'] = 'DAL10' zone_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' zone_model['name'] = 'us-south-1' zone_model['region'] = region_reference_model zone_model['status'] = 'available' - zone_model['universal_name'] = 'us-south-dal13-a' + zone_model['universal_name'] = 'us-south-dal10-a' # Construct a json representation of a ZoneCollection model zone_collection_model_json = {} @@ -78128,10 +79403,10 @@ def test_backup_policy_job_source_instance_reference_serialization(self): # Construct a json representation of a BackupPolicyJobSourceInstanceReference model backup_policy_job_source_instance_reference_model_json = {} - backup_policy_job_source_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + backup_policy_job_source_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' backup_policy_job_source_instance_reference_model_json['deleted'] = deleted_model - backup_policy_job_source_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - backup_policy_job_source_instance_reference_model_json['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + backup_policy_job_source_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + backup_policy_job_source_instance_reference_model_json['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' backup_policy_job_source_instance_reference_model_json['name'] = 'my-instance' # Construct a model instance of BackupPolicyJobSourceInstanceReference by calling from_dict on the json representation @@ -78240,7 +79515,7 @@ def test_backup_policy_match_resource_type_instance_serialization(self): backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce' - backup_policy_scope_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + backup_policy_scope_model['id'] = 'ebc2b430240943458b9e91e1432cfcce' backup_policy_scope_model['resource_type'] = 'enterprise' # Construct a json representation of a BackupPolicyMatchResourceTypeInstance model @@ -78320,7 +79595,7 @@ def test_backup_policy_match_resource_type_volume_serialization(self): backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce' - backup_policy_scope_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + backup_policy_scope_model['id'] = 'ebc2b430240943458b9e91e1432cfcce' backup_policy_scope_model['resource_type'] = 'enterprise' # Construct a json representation of a BackupPolicyMatchResourceTypeVolume model @@ -78552,7 +79827,7 @@ def test_backup_policy_scope_enterprise_reference_serialization(self): # Construct a json representation of a BackupPolicyScopeEnterpriseReference model backup_policy_scope_enterprise_reference_model_json = {} backup_policy_scope_enterprise_reference_model_json['crn'] = 'crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce' - backup_policy_scope_enterprise_reference_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + backup_policy_scope_enterprise_reference_model_json['id'] = 'ebc2b430240943458b9e91e1432cfcce' backup_policy_scope_enterprise_reference_model_json['resource_type'] = 'enterprise' # Construct a model instance of BackupPolicyScopeEnterpriseReference by calling from_dict on the json representation @@ -78589,7 +79864,7 @@ def test_bare_metal_server_boot_target_bare_metal_server_disk_reference_serializ # Construct a json representation of a BareMetalServerBootTargetBareMetalServerDiskReference model bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json = {} bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['deleted'] = deleted_model - bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96' bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['name'] = 'my-bare-metal-server-disk' bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['resource_type'] = 'bare_metal_server_disk' @@ -78626,11 +79901,11 @@ def test_bare_metal_server_initialization_user_account_bare_metal_server_initial deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' key_reference_model = {} # KeyReference - key_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_reference_model['deleted'] = deleted_model key_reference_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY' - key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' - key_reference_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45' + key_reference_model['id'] = 'r006-82679077-ac3b-4c10-be16-63e9c21f0f45' key_reference_model['name'] = 'my-key-1' # Construct a json representation of a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount model @@ -78688,17 +79963,17 @@ def test_bare_metal_server_network_attachment_by_pci_serialization(self): subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' # Construct a json representation of a BareMetalServerNetworkAttachmentByPCI model bare_metal_server_network_attachment_by_pci_model_json = {} bare_metal_server_network_attachment_by_pci_model_json['created_at'] = '2019-01-01T12:00:00Z' - bare_metal_server_network_attachment_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_by_pci_model_json['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_by_pci_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' bare_metal_server_network_attachment_by_pci_model_json['lifecycle_state'] = 'stable' bare_metal_server_network_attachment_by_pci_model_json['name'] = 'my-bare-metal-server-network-attachment' bare_metal_server_network_attachment_by_pci_model_json['port_speed'] = 1000 @@ -78758,17 +80033,17 @@ def test_bare_metal_server_network_attachment_by_vlan_serialization(self): subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' # Construct a json representation of a BareMetalServerNetworkAttachmentByVLAN model bare_metal_server_network_attachment_by_vlan_model_json = {} bare_metal_server_network_attachment_by_vlan_model_json['created_at'] = '2019-01-01T12:00:00Z' - bare_metal_server_network_attachment_by_vlan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - bare_metal_server_network_attachment_by_vlan_model_json['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_by_vlan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_attachment_by_vlan_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' bare_metal_server_network_attachment_by_vlan_model_json['lifecycle_state'] = 'stable' bare_metal_server_network_attachment_by_vlan_model_json['name'] = 'my-bare-metal-server-network-attachment' bare_metal_server_network_attachment_by_vlan_model_json['port_speed'] = 1000 @@ -78823,7 +80098,7 @@ def test_bare_metal_server_network_attachment_prototype_virtual_network_interfac resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' @@ -78883,7 +80158,7 @@ def test_bare_metal_server_network_attachment_prototype_bare_metal_server_networ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -78949,7 +80224,7 @@ def test_bare_metal_server_network_attachment_prototype_bare_metal_server_networ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -79007,10 +80282,10 @@ def test_bare_metal_server_network_interface_by_hiper_socket_serialization(self) floating_ip_reference_model = {} # FloatingIPReference floating_ip_reference_model['address'] = '203.0.113.1' - floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['deleted'] = deleted_model - floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['name'] = 'my-floating-ip' reserved_ip_reference_model = {} # ReservedIPReference @@ -79042,8 +80317,8 @@ def test_bare_metal_server_network_interface_by_hiper_socket_serialization(self) bare_metal_server_network_interface_by_hiper_socket_model_json['created_at'] = '2019-01-01T12:00:00Z' bare_metal_server_network_interface_by_hiper_socket_model_json['enable_infrastructure_nat'] = True bare_metal_server_network_interface_by_hiper_socket_model_json['floating_ips'] = [floating_ip_reference_model] - bare_metal_server_network_interface_by_hiper_socket_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_by_hiper_socket_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_network_interface_by_hiper_socket_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_interface_by_hiper_socket_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' bare_metal_server_network_interface_by_hiper_socket_model_json['mac_address'] = '02:00:04:00:C4:6A' bare_metal_server_network_interface_by_hiper_socket_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_by_hiper_socket_model_json['port_speed'] = 1000 @@ -79088,10 +80363,10 @@ def test_bare_metal_server_network_interface_by_pci_serialization(self): floating_ip_reference_model = {} # FloatingIPReference floating_ip_reference_model['address'] = '203.0.113.1' - floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['deleted'] = deleted_model - floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['name'] = 'my-floating-ip' reserved_ip_reference_model = {} # ReservedIPReference @@ -79123,8 +80398,8 @@ def test_bare_metal_server_network_interface_by_pci_serialization(self): bare_metal_server_network_interface_by_pci_model_json['created_at'] = '2019-01-01T12:00:00Z' bare_metal_server_network_interface_by_pci_model_json['enable_infrastructure_nat'] = True bare_metal_server_network_interface_by_pci_model_json['floating_ips'] = [floating_ip_reference_model] - bare_metal_server_network_interface_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_by_pci_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_network_interface_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_interface_by_pci_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' bare_metal_server_network_interface_by_pci_model_json['mac_address'] = '02:00:04:00:C4:6A' bare_metal_server_network_interface_by_pci_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_by_pci_model_json['port_speed'] = 1000 @@ -79170,10 +80445,10 @@ def test_bare_metal_server_network_interface_by_vlan_serialization(self): floating_ip_reference_model = {} # FloatingIPReference floating_ip_reference_model['address'] = '203.0.113.1' - floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['deleted'] = deleted_model - floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' + floating_ip_reference_model['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' floating_ip_reference_model['name'] = 'my-floating-ip' reserved_ip_reference_model = {} # ReservedIPReference @@ -79205,8 +80480,8 @@ def test_bare_metal_server_network_interface_by_vlan_serialization(self): bare_metal_server_network_interface_by_vlan_model_json['created_at'] = '2019-01-01T12:00:00Z' bare_metal_server_network_interface_by_vlan_model_json['enable_infrastructure_nat'] = True bare_metal_server_network_interface_by_vlan_model_json['floating_ips'] = [floating_ip_reference_model] - bare_metal_server_network_interface_by_vlan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_by_vlan_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_network_interface_by_vlan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + bare_metal_server_network_interface_by_vlan_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' bare_metal_server_network_interface_by_vlan_model_json['mac_address'] = '02:00:04:00:C4:6A' bare_metal_server_network_interface_by_vlan_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_by_vlan_model_json['port_speed'] = 1000 @@ -79254,7 +80529,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -79303,7 +80578,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -79353,7 +80628,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -79412,7 +80687,7 @@ def test_bare_metal_server_primary_network_attachment_prototype_bare_metal_serve resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -80447,7 +81722,7 @@ def test_bare_metal_server_prototype_bare_metal_server_by_network_attachment_ser virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -80550,7 +81825,7 @@ def test_bare_metal_server_prototype_bare_metal_server_by_network_interface_seri network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -80784,6 +82059,294 @@ def test_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identi assert cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 == cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json +class TestModel_ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext: + """ + Test Class for ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + """ + + def test_cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + """ + + # Construct a json representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json = {} + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json['address'] = '192.168.3.4' + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json['name'] = 'my-cluster-network-subnet-reserved-ip' + + # Construct a model instance of ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext by calling from_dict on the json representation + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.from_dict(cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json) + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model != False + + # Construct a model instance of ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext by calling from_dict on the json representation + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_dict = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.from_dict(cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json).__dict__ + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model2 = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext(**cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model == cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json2 = cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model.to_dict() + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json2 == cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_prototype_cluster_network_interface_primary_ip_context_model_json + + +class TestModel_ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext: + """ + Test Class for ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext + """ + + def test_cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext + """ + + # Construct a json representation of a ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext model + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json = {} + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json['name'] = 'my-instance-network-attachment' + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json['resource_type'] = 'instance_cluster_network_attachment' + + # Construct a model instance of ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext by calling from_dict on the json representation + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model = ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext.from_dict(cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json) + assert cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model != False + + # Construct a model instance of ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext by calling from_dict on the json representation + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_dict = ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext.from_dict(cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json).__dict__ + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model2 = ClusterNetworkInterfaceTargetInstanceClusterNetworkAttachmentReferenceClusterNetworkInterfaceContext(**cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model == cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json2 = cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model.to_dict() + assert cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json2 == cluster_network_interface_target_instance_cluster_network_attachment_reference_cluster_network_interface_context_model_json + + +class TestModel_ClusterNetworkProfileIdentityByHref: + """ + Test Class for ClusterNetworkProfileIdentityByHref + """ + + def test_cluster_network_profile_identity_by_href_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkProfileIdentityByHref + """ + + # Construct a json representation of a ClusterNetworkProfileIdentityByHref model + cluster_network_profile_identity_by_href_model_json = {} + cluster_network_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100' + + # Construct a model instance of ClusterNetworkProfileIdentityByHref by calling from_dict on the json representation + cluster_network_profile_identity_by_href_model = ClusterNetworkProfileIdentityByHref.from_dict(cluster_network_profile_identity_by_href_model_json) + assert cluster_network_profile_identity_by_href_model != False + + # Construct a model instance of ClusterNetworkProfileIdentityByHref by calling from_dict on the json representation + cluster_network_profile_identity_by_href_model_dict = ClusterNetworkProfileIdentityByHref.from_dict(cluster_network_profile_identity_by_href_model_json).__dict__ + cluster_network_profile_identity_by_href_model2 = ClusterNetworkProfileIdentityByHref(**cluster_network_profile_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_profile_identity_by_href_model == cluster_network_profile_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_profile_identity_by_href_model_json2 = cluster_network_profile_identity_by_href_model.to_dict() + assert cluster_network_profile_identity_by_href_model_json2 == cluster_network_profile_identity_by_href_model_json + + +class TestModel_ClusterNetworkProfileIdentityByName: + """ + Test Class for ClusterNetworkProfileIdentityByName + """ + + def test_cluster_network_profile_identity_by_name_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkProfileIdentityByName + """ + + # Construct a json representation of a ClusterNetworkProfileIdentityByName model + cluster_network_profile_identity_by_name_model_json = {} + cluster_network_profile_identity_by_name_model_json['name'] = 'h100' + + # Construct a model instance of ClusterNetworkProfileIdentityByName by calling from_dict on the json representation + cluster_network_profile_identity_by_name_model = ClusterNetworkProfileIdentityByName.from_dict(cluster_network_profile_identity_by_name_model_json) + assert cluster_network_profile_identity_by_name_model != False + + # Construct a model instance of ClusterNetworkProfileIdentityByName by calling from_dict on the json representation + cluster_network_profile_identity_by_name_model_dict = ClusterNetworkProfileIdentityByName.from_dict(cluster_network_profile_identity_by_name_model_json).__dict__ + cluster_network_profile_identity_by_name_model2 = ClusterNetworkProfileIdentityByName(**cluster_network_profile_identity_by_name_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_profile_identity_by_name_model == cluster_network_profile_identity_by_name_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_profile_identity_by_name_model_json2 = cluster_network_profile_identity_by_name_model.to_dict() + assert cluster_network_profile_identity_by_name_model_json2 == cluster_network_profile_identity_by_name_model_json + + +class TestModel_ClusterNetworkSubnetIdentityByHref: + """ + Test Class for ClusterNetworkSubnetIdentityByHref + """ + + def test_cluster_network_subnet_identity_by_href_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkSubnetIdentityByHref + """ + + # Construct a json representation of a ClusterNetworkSubnetIdentityByHref model + cluster_network_subnet_identity_by_href_model_json = {} + cluster_network_subnet_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a model instance of ClusterNetworkSubnetIdentityByHref by calling from_dict on the json representation + cluster_network_subnet_identity_by_href_model = ClusterNetworkSubnetIdentityByHref.from_dict(cluster_network_subnet_identity_by_href_model_json) + assert cluster_network_subnet_identity_by_href_model != False + + # Construct a model instance of ClusterNetworkSubnetIdentityByHref by calling from_dict on the json representation + cluster_network_subnet_identity_by_href_model_dict = ClusterNetworkSubnetIdentityByHref.from_dict(cluster_network_subnet_identity_by_href_model_json).__dict__ + cluster_network_subnet_identity_by_href_model2 = ClusterNetworkSubnetIdentityByHref(**cluster_network_subnet_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_subnet_identity_by_href_model == cluster_network_subnet_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_subnet_identity_by_href_model_json2 = cluster_network_subnet_identity_by_href_model.to_dict() + assert cluster_network_subnet_identity_by_href_model_json2 == cluster_network_subnet_identity_by_href_model_json + + +class TestModel_ClusterNetworkSubnetIdentityById: + """ + Test Class for ClusterNetworkSubnetIdentityById + """ + + def test_cluster_network_subnet_identity_by_id_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkSubnetIdentityById + """ + + # Construct a json representation of a ClusterNetworkSubnetIdentityById model + cluster_network_subnet_identity_by_id_model_json = {} + cluster_network_subnet_identity_by_id_model_json['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a model instance of ClusterNetworkSubnetIdentityById by calling from_dict on the json representation + cluster_network_subnet_identity_by_id_model = ClusterNetworkSubnetIdentityById.from_dict(cluster_network_subnet_identity_by_id_model_json) + assert cluster_network_subnet_identity_by_id_model != False + + # Construct a model instance of ClusterNetworkSubnetIdentityById by calling from_dict on the json representation + cluster_network_subnet_identity_by_id_model_dict = ClusterNetworkSubnetIdentityById.from_dict(cluster_network_subnet_identity_by_id_model_json).__dict__ + cluster_network_subnet_identity_by_id_model2 = ClusterNetworkSubnetIdentityById(**cluster_network_subnet_identity_by_id_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_subnet_identity_by_id_model == cluster_network_subnet_identity_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_subnet_identity_by_id_model_json2 = cluster_network_subnet_identity_by_id_model.to_dict() + assert cluster_network_subnet_identity_by_id_model_json2 == cluster_network_subnet_identity_by_id_model_json + + +class TestModel_ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype: + """ + Test Class for ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype + """ + + def test_cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype + """ + + # Construct a json representation of a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype model + cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json = {} + cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json['ip_version'] = 'ipv4' + cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json['ipv4_cidr_block'] = '10.0.0.0/24' + + # Construct a model instance of ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype by calling from_dict on the json representation + cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model = ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype.from_dict(cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json) + assert cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model != False + + # Construct a model instance of ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype by calling from_dict on the json representation + cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_dict = ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype.from_dict(cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json).__dict__ + cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model2 = ClusterNetworkSubnetPrototypeClusterNetworkSubnetByIPv4CIDRBlockPrototype(**cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model == cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json2 = cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model.to_dict() + assert cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json2 == cluster_network_subnet_prototype_cluster_network_subnet_by_i_pv4_cidr_block_prototype_model_json + + +class TestModel_ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype: + """ + Test Class for ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype + """ + + def test_cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype + """ + + # Construct a json representation of a ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model + cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json = {} + cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json['ip_version'] = 'ipv4' + cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json['name'] = 'my-cluster-network-subnet' + cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json['total_ipv4_address_count'] = 256 + + # Construct a model instance of ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype by calling from_dict on the json representation + cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model = ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype.from_dict(cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json) + assert cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model != False + + # Construct a model instance of ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype by calling from_dict on the json representation + cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_dict = ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype.from_dict(cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json).__dict__ + cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model2 = ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype(**cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model == cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json2 = cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model.to_dict() + assert cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json2 == cluster_network_subnet_prototype_cluster_network_subnet_by_total_count_prototype_model_json + + +class TestModel_ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext: + """ + Test Class for ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext + """ + + def test_cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + deleted_model = {} # Deleted + deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext model + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json = {} + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json['deleted'] = deleted_model + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json['name'] = 'my-cluster-network-interface' + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json['resource_type'] = 'cluster_network_interface' + + # Construct a model instance of ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model = ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext.from_dict(cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json) + assert cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model != False + + # Construct a model instance of ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext by calling from_dict on the json representation + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_dict = ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext.from_dict(cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json).__dict__ + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model2 = ClusterNetworkSubnetReservedIPTargetClusterNetworkInterfaceReferenceClusterNetworkSubnetReservedIPTargetContext(**cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model == cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json2 = cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model.to_dict() + assert cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json2 == cluster_network_subnet_reserved_ip_target_cluster_network_interface_reference_cluster_network_subnet_reserved_ip_target_context_model_json + + class TestModel_DNSInstanceIdentityByCRN: """ Test Class for DNSInstanceIdentityByCRN @@ -80856,7 +82419,7 @@ def test_dedicated_host_group_identity_by_crn_serialization(self): # Construct a json representation of a DedicatedHostGroupIdentityByCRN model dedicated_host_group_identity_by_crn_model_json = {} - dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of DedicatedHostGroupIdentityByCRN by calling from_dict on the json representation dedicated_host_group_identity_by_crn_model = DedicatedHostGroupIdentityByCRN.from_dict(dedicated_host_group_identity_by_crn_model_json) @@ -80886,7 +82449,7 @@ def test_dedicated_host_group_identity_by_href_serialization(self): # Construct a json representation of a DedicatedHostGroupIdentityByHref model dedicated_host_group_identity_by_href_model_json = {} - dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of DedicatedHostGroupIdentityByHref by calling from_dict on the json representation dedicated_host_group_identity_by_href_model = DedicatedHostGroupIdentityByHref.from_dict(dedicated_host_group_identity_by_href_model_json) @@ -80916,7 +82479,7 @@ def test_dedicated_host_group_identity_by_id_serialization(self): # Construct a json representation of a DedicatedHostGroupIdentityById model dedicated_host_group_identity_by_id_model_json = {} - dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_identity_by_id_model_json['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of DedicatedHostGroupIdentityById by calling from_dict on the json representation dedicated_host_group_identity_by_id_model = DedicatedHostGroupIdentityById.from_dict(dedicated_host_group_identity_by_id_model_json) @@ -81394,7 +82957,7 @@ def test_dedicated_host_prototype_dedicated_host_by_group_serialization(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' dedicated_host_group_identity_model = {} # DedicatedHostGroupIdentityById - dedicated_host_group_identity_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + dedicated_host_group_identity_model['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a json representation of a DedicatedHostPrototypeDedicatedHostByGroup model dedicated_host_prototype_dedicated_host_by_group_model_json = {} @@ -81439,7 +83002,7 @@ def test_dedicated_host_prototype_dedicated_host_by_zone_serialization(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' dedicated_host_group_prototype_dedicated_host_by_zone_context_model = {} # DedicatedHostGroupPrototypeDedicatedHostByZoneContext - dedicated_host_group_prototype_dedicated_host_by_zone_context_model['name'] = 'my-host-group' + dedicated_host_group_prototype_dedicated_host_by_zone_context_model['name'] = 'my-dedicated-host-group' dedicated_host_group_prototype_dedicated_host_by_zone_context_model['resource_group'] = resource_group_identity_model zone_identity_model = {} # ZoneIdentityByName @@ -81762,7 +83325,7 @@ def test_floating_ip_prototype_floating_ip_by_target_serialization(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' floating_ip_target_prototype_model = {} # FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById - floating_ip_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_prototype_model['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' # Construct a json representation of a FloatingIPPrototypeFloatingIPByTarget model floating_ip_prototype_floating_ip_by_target_model_json = {} @@ -81842,9 +83405,9 @@ def test_floating_ip_target_bare_metal_server_network_interface_reference_serial deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -81852,8 +83415,8 @@ def test_floating_ip_target_bare_metal_server_network_interface_reference_serial # Construct a json representation of a FloatingIPTargetBareMetalServerNetworkInterfaceReference model floating_ip_target_bare_metal_server_network_interface_reference_model_json = {} floating_ip_target_bare_metal_server_network_interface_reference_model_json['deleted'] = deleted_model - floating_ip_target_bare_metal_server_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_bare_metal_server_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_bare_metal_server_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + floating_ip_target_bare_metal_server_network_interface_reference_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' floating_ip_target_bare_metal_server_network_interface_reference_model_json['name'] = 'my-bare-metal-server-network-interface' floating_ip_target_bare_metal_server_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model floating_ip_target_bare_metal_server_network_interface_reference_model_json['resource_type'] = 'network_interface' @@ -81890,9 +83453,9 @@ def test_floating_ip_target_network_interface_reference_serialization(self): deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -81900,8 +83463,8 @@ def test_floating_ip_target_network_interface_reference_serialization(self): # Construct a json representation of a FloatingIPTargetNetworkInterfaceReference model floating_ip_target_network_interface_reference_model_json = {} floating_ip_target_network_interface_reference_model_json['deleted'] = deleted_model - floating_ip_target_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_network_interface_reference_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + floating_ip_target_network_interface_reference_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' floating_ip_target_network_interface_reference_model_json['name'] = 'my-instance-network-interface' floating_ip_target_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model floating_ip_target_network_interface_reference_model_json['resource_type'] = 'network_interface' @@ -81978,9 +83541,9 @@ def test_floating_ip_target_virtual_network_interface_reference_serialization(se deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -81995,10 +83558,10 @@ def test_floating_ip_target_virtual_network_interface_reference_serialization(se # Construct a json representation of a FloatingIPTargetVirtualNetworkInterfaceReference model floating_ip_target_virtual_network_interface_reference_model_json = {} - floating_ip_target_virtual_network_interface_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + floating_ip_target_virtual_network_interface_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' floating_ip_target_virtual_network_interface_reference_model_json['deleted'] = deleted_model - floating_ip_target_virtual_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - floating_ip_target_virtual_network_interface_reference_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + floating_ip_target_virtual_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + floating_ip_target_virtual_network_interface_reference_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' floating_ip_target_virtual_network_interface_reference_model_json['name'] = 'my-virtual-network-interface' floating_ip_target_virtual_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model floating_ip_target_virtual_network_interface_reference_model_json['resource_type'] = 'virtual_network_interface' @@ -82036,9 +83599,9 @@ def test_flow_log_collector_target_instance_network_attachment_reference_seriali deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '10.240.0.5' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -82052,16 +83615,16 @@ def test_flow_log_collector_target_instance_network_attachment_reference_seriali subnet_reference_model['resource_type'] = 'subnet' virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext - virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_reference_attachment_context_model['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' # Construct a json representation of a FlowLogCollectorTargetInstanceNetworkAttachmentReference model flow_log_collector_target_instance_network_attachment_reference_model_json = {} flow_log_collector_target_instance_network_attachment_reference_model_json['deleted'] = deleted_model - flow_log_collector_target_instance_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + flow_log_collector_target_instance_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' flow_log_collector_target_instance_network_attachment_reference_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' flow_log_collector_target_instance_network_attachment_reference_model_json['name'] = 'my-instance-network-attachment' flow_log_collector_target_instance_network_attachment_reference_model_json['primary_ip'] = reserved_ip_reference_model @@ -82102,10 +83665,10 @@ def test_flow_log_collector_target_instance_reference_serialization(self): # Construct a json representation of a FlowLogCollectorTargetInstanceReference model flow_log_collector_target_instance_reference_model_json = {} - flow_log_collector_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + flow_log_collector_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' flow_log_collector_target_instance_reference_model_json['deleted'] = deleted_model - flow_log_collector_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - flow_log_collector_target_instance_reference_model_json['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + flow_log_collector_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + flow_log_collector_target_instance_reference_model_json['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' flow_log_collector_target_instance_reference_model_json['name'] = 'my-instance' # Construct a model instance of FlowLogCollectorTargetInstanceReference by calling from_dict on the json representation @@ -82142,8 +83705,8 @@ def test_flow_log_collector_target_network_interface_reference_target_context_se # Construct a json representation of a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext model flow_log_collector_target_network_interface_reference_target_context_model_json = {} flow_log_collector_target_network_interface_reference_target_context_model_json['deleted'] = deleted_model - flow_log_collector_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_network_interface_reference_target_context_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + flow_log_collector_target_network_interface_reference_target_context_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' flow_log_collector_target_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface' flow_log_collector_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' @@ -82255,9 +83818,9 @@ def test_flow_log_collector_target_virtual_network_interface_reference_attachmen # Construct a json representation of a FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext model flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json = {} - flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['name'] = 'my-virtual-network-interface' flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['resource_type'] = 'virtual_network_interface' @@ -82542,6 +84105,109 @@ def test_instance_catalog_offering_prototype_catalog_offering_by_version_seriali assert instance_catalog_offering_prototype_catalog_offering_by_version_model_json2 == instance_catalog_offering_prototype_catalog_offering_by_version_model_json +class TestModel_InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref: + """ + Test Class for InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref + """ + + def test_instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref + """ + + # Construct a json representation of a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref model + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_json = {} + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213' + + # Construct a model instance of InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref by calling from_dict on the json representation + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model = InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref.from_dict(instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_json) + assert instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref by calling from_dict on the json representation + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_dict = InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref.from_dict(instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_json).__dict__ + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model2 = InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityByHref(**instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model == instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_json2 = instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model.to_dict() + assert instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_json2 == instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_href_model_json + + +class TestModel_InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById: + """ + Test Class for InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById + """ + + def test_instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById + """ + + # Construct a json representation of a InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById model + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_json = {} + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_json['id'] = '0717-fb880975-db45-4459-8548-64e3995ac213' + + # Construct a model instance of InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById by calling from_dict on the json representation + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model = InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById.from_dict(instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_json) + assert instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById by calling from_dict on the json representation + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_dict = InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById.from_dict(instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_json).__dict__ + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model2 = InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById(**instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model == instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_json2 = instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model.to_dict() + assert instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_json2 == instance_cluster_network_attachment_before_prototype_instance_cluster_network_attachment_identity_by_id_model_json + + +class TestModel_InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment: + """ + Test Class for InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + """ + + def test_instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + """ + + # Construct dict forms of any model objects needed in order to build this model. + + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + # Construct a json representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json['subnet'] = cluster_network_subnet_identity_model + + # Construct a model instance of InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment by calling from_dict on the json representation + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.from_dict(instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json) + assert instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment by calling from_dict on the json representation + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_dict = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.from_dict(instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json).__dict__ + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model2 = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment(**instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model == instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json2 = instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model.to_dict() + assert instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json2 == instance_cluster_network_attachment_prototype_cluster_network_interface_instance_cluster_network_interface_prototype_instance_cluster_network_attachment_model_json + + class TestModel_InstanceGroupManagerAutoScale: """ Test Class for InstanceGroupManagerAutoScale @@ -82847,7 +84513,7 @@ def test_instance_network_attachment_prototype_virtual_network_interface_virtual resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' @@ -82958,11 +84624,11 @@ def test_instance_placement_target_dedicated_host_group_reference_serialization( # Construct a json representation of a InstancePlacementTargetDedicatedHostGroupReference model instance_placement_target_dedicated_host_group_reference_model_json = {} - instance_placement_target_dedicated_host_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_dedicated_host_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' instance_placement_target_dedicated_host_group_reference_model_json['deleted'] = deleted_model - instance_placement_target_dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - instance_placement_target_dedicated_host_group_reference_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' - instance_placement_target_dedicated_host_group_reference_model_json['name'] = 'my-host-group' + instance_placement_target_dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_dedicated_host_group_reference_model_json['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_dedicated_host_group_reference_model_json['name'] = 'my-dedicated-host-group' instance_placement_target_dedicated_host_group_reference_model_json['resource_type'] = 'dedicated_host_group' # Construct a model instance of InstancePlacementTargetDedicatedHostGroupReference by calling from_dict on the json representation @@ -83038,10 +84704,10 @@ def test_instance_placement_target_placement_group_reference_serialization(self) # Construct a json representation of a InstancePlacementTargetPlacementGroupReference model instance_placement_target_placement_group_reference_model_json = {} - instance_placement_target_placement_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + instance_placement_target_placement_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871' instance_placement_target_placement_group_reference_model_json['deleted'] = deleted_model - instance_placement_target_placement_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871' - instance_placement_target_placement_group_reference_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + instance_placement_target_placement_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871' + instance_placement_target_placement_group_reference_model_json['id'] = 'r006-418fe842-a3e9-47b9-a938-1aa5bd632871' instance_placement_target_placement_group_reference_model_json['name'] = 'my-placement-group' instance_placement_target_placement_group_reference_model_json['resource_type'] = 'placement_group' @@ -83188,6 +84854,101 @@ def test_instance_profile_bandwidth_range_serialization(self): assert instance_profile_bandwidth_range_model_json2 == instance_profile_bandwidth_range_model_json +class TestModel_InstanceProfileClusterNetworkAttachmentCountDependent: + """ + Test Class for InstanceProfileClusterNetworkAttachmentCountDependent + """ + + def test_instance_profile_cluster_network_attachment_count_dependent_serialization(self): + """ + Test serialization/deserialization for InstanceProfileClusterNetworkAttachmentCountDependent + """ + + # Construct a json representation of a InstanceProfileClusterNetworkAttachmentCountDependent model + instance_profile_cluster_network_attachment_count_dependent_model_json = {} + instance_profile_cluster_network_attachment_count_dependent_model_json['type'] = 'dependent' + + # Construct a model instance of InstanceProfileClusterNetworkAttachmentCountDependent by calling from_dict on the json representation + instance_profile_cluster_network_attachment_count_dependent_model = InstanceProfileClusterNetworkAttachmentCountDependent.from_dict(instance_profile_cluster_network_attachment_count_dependent_model_json) + assert instance_profile_cluster_network_attachment_count_dependent_model != False + + # Construct a model instance of InstanceProfileClusterNetworkAttachmentCountDependent by calling from_dict on the json representation + instance_profile_cluster_network_attachment_count_dependent_model_dict = InstanceProfileClusterNetworkAttachmentCountDependent.from_dict(instance_profile_cluster_network_attachment_count_dependent_model_json).__dict__ + instance_profile_cluster_network_attachment_count_dependent_model2 = InstanceProfileClusterNetworkAttachmentCountDependent(**instance_profile_cluster_network_attachment_count_dependent_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_cluster_network_attachment_count_dependent_model == instance_profile_cluster_network_attachment_count_dependent_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_cluster_network_attachment_count_dependent_model_json2 = instance_profile_cluster_network_attachment_count_dependent_model.to_dict() + assert instance_profile_cluster_network_attachment_count_dependent_model_json2 == instance_profile_cluster_network_attachment_count_dependent_model_json + + +class TestModel_InstanceProfileClusterNetworkAttachmentCountEnum: + """ + Test Class for InstanceProfileClusterNetworkAttachmentCountEnum + """ + + def test_instance_profile_cluster_network_attachment_count_enum_serialization(self): + """ + Test serialization/deserialization for InstanceProfileClusterNetworkAttachmentCountEnum + """ + + # Construct a json representation of a InstanceProfileClusterNetworkAttachmentCountEnum model + instance_profile_cluster_network_attachment_count_enum_model_json = {} + instance_profile_cluster_network_attachment_count_enum_model_json['default'] = 38 + instance_profile_cluster_network_attachment_count_enum_model_json['type'] = 'enum' + instance_profile_cluster_network_attachment_count_enum_model_json['values'] = [0, 8, 16, 32] + + # Construct a model instance of InstanceProfileClusterNetworkAttachmentCountEnum by calling from_dict on the json representation + instance_profile_cluster_network_attachment_count_enum_model = InstanceProfileClusterNetworkAttachmentCountEnum.from_dict(instance_profile_cluster_network_attachment_count_enum_model_json) + assert instance_profile_cluster_network_attachment_count_enum_model != False + + # Construct a model instance of InstanceProfileClusterNetworkAttachmentCountEnum by calling from_dict on the json representation + instance_profile_cluster_network_attachment_count_enum_model_dict = InstanceProfileClusterNetworkAttachmentCountEnum.from_dict(instance_profile_cluster_network_attachment_count_enum_model_json).__dict__ + instance_profile_cluster_network_attachment_count_enum_model2 = InstanceProfileClusterNetworkAttachmentCountEnum(**instance_profile_cluster_network_attachment_count_enum_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_cluster_network_attachment_count_enum_model == instance_profile_cluster_network_attachment_count_enum_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_cluster_network_attachment_count_enum_model_json2 = instance_profile_cluster_network_attachment_count_enum_model.to_dict() + assert instance_profile_cluster_network_attachment_count_enum_model_json2 == instance_profile_cluster_network_attachment_count_enum_model_json + + +class TestModel_InstanceProfileClusterNetworkAttachmentCountRange: + """ + Test Class for InstanceProfileClusterNetworkAttachmentCountRange + """ + + def test_instance_profile_cluster_network_attachment_count_range_serialization(self): + """ + Test serialization/deserialization for InstanceProfileClusterNetworkAttachmentCountRange + """ + + # Construct a json representation of a InstanceProfileClusterNetworkAttachmentCountRange model + instance_profile_cluster_network_attachment_count_range_model_json = {} + instance_profile_cluster_network_attachment_count_range_model_json['max'] = 32 + instance_profile_cluster_network_attachment_count_range_model_json['min'] = 8 + instance_profile_cluster_network_attachment_count_range_model_json['step'] = 8 + instance_profile_cluster_network_attachment_count_range_model_json['type'] = 'range' + + # Construct a model instance of InstanceProfileClusterNetworkAttachmentCountRange by calling from_dict on the json representation + instance_profile_cluster_network_attachment_count_range_model = InstanceProfileClusterNetworkAttachmentCountRange.from_dict(instance_profile_cluster_network_attachment_count_range_model_json) + assert instance_profile_cluster_network_attachment_count_range_model != False + + # Construct a model instance of InstanceProfileClusterNetworkAttachmentCountRange by calling from_dict on the json representation + instance_profile_cluster_network_attachment_count_range_model_dict = InstanceProfileClusterNetworkAttachmentCountRange.from_dict(instance_profile_cluster_network_attachment_count_range_model_json).__dict__ + instance_profile_cluster_network_attachment_count_range_model2 = InstanceProfileClusterNetworkAttachmentCountRange(**instance_profile_cluster_network_attachment_count_range_model_dict) + + # Verify the model instances are equivalent + assert instance_profile_cluster_network_attachment_count_range_model == instance_profile_cluster_network_attachment_count_range_model2 + + # Convert model instance back to dict and verify no loss of data + instance_profile_cluster_network_attachment_count_range_model_json2 = instance_profile_cluster_network_attachment_count_range_model.to_dict() + assert instance_profile_cluster_network_attachment_count_range_model_json2 == instance_profile_cluster_network_attachment_count_range_model_json + + class TestModel_InstanceProfileDiskQuantityDependent: """ Test Class for InstanceProfileDiskQuantityDependent @@ -84398,7 +86159,25 @@ def test_instance_prototype_instance_by_source_template_serialization(self): instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -84420,7 +86199,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -84484,7 +86263,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -84526,6 +86305,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): # Construct a json representation of a InstancePrototypeInstanceBySourceTemplate model instance_prototype_instance_by_source_template_model_json = {} instance_prototype_instance_by_source_template_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_source_template_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_source_template_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_source_template_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_source_template_model_json['enable_secure_boot'] = True @@ -84671,7 +86451,25 @@ def test_instance_template_prototype_instance_template_by_source_template_serial instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -84693,7 +86491,7 @@ def test_instance_template_prototype_instance_template_by_source_template_serial instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -84757,7 +86555,7 @@ def test_instance_template_prototype_instance_template_by_source_template_serial virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -84799,6 +86597,7 @@ def test_instance_template_prototype_instance_template_by_source_template_serial # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate model instance_template_prototype_instance_template_by_source_template_model_json = {} instance_template_prototype_instance_template_by_source_template_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_instance_template_by_source_template_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_instance_template_by_source_template_model_json['confidential_compute_mode'] = 'disabled' instance_template_prototype_instance_template_by_source_template_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_template_by_source_template_model_json['enable_secure_boot'] = True @@ -84851,7 +86650,7 @@ def test_key_identity_by_crn_serialization(self): # Construct a json representation of a KeyIdentityByCRN model key_identity_by_crn_model_json = {} - key_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:82679077-ac3b-4c10-be16-63e9c21f0f45' + key_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45' # Construct a model instance of KeyIdentityByCRN by calling from_dict on the json representation key_identity_by_crn_model = KeyIdentityByCRN.from_dict(key_identity_by_crn_model_json) @@ -84911,7 +86710,7 @@ def test_key_identity_by_href_serialization(self): # Construct a json representation of a KeyIdentityByHref model key_identity_by_href_model_json = {} - key_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45' + key_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45' # Construct a model instance of KeyIdentityByHref by calling from_dict on the json representation key_identity_by_href_model = KeyIdentityByHref.from_dict(key_identity_by_href_model_json) @@ -84941,7 +86740,7 @@ def test_key_identity_by_id_serialization(self): # Construct a json representation of a KeyIdentityById model key_identity_by_id_model_json = {} - key_identity_by_id_model_json['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45' + key_identity_by_id_model_json['id'] = 'r006-82679077-ac3b-4c10-be16-63e9c21f0f45' # Construct a model instance of KeyIdentityById by calling from_dict on the json representation key_identity_by_id_model = KeyIdentityById.from_dict(key_identity_by_id_model_json) @@ -85583,10 +87382,10 @@ def test_load_balancer_pool_member_target_instance_reference_serialization(self) # Construct a json representation of a LoadBalancerPoolMemberTargetInstanceReference model load_balancer_pool_member_target_instance_reference_model_json = {} - load_balancer_pool_member_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' load_balancer_pool_member_target_instance_reference_model_json['deleted'] = deleted_model - load_balancer_pool_member_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' - load_balancer_pool_member_target_instance_reference_model_json['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' + load_balancer_pool_member_target_instance_reference_model_json['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' load_balancer_pool_member_target_instance_reference_model_json['name'] = 'my-instance' # Construct a model instance of LoadBalancerPoolMemberTargetInstanceReference by calling from_dict on the json representation @@ -87193,7 +88992,7 @@ def test_reservation_identity_by_crn_serialization(self): # Construct a json representation of a ReservationIdentityByCRN model reservation_identity_by_crn_model_json = {} - reservation_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a model instance of ReservationIdentityByCRN by calling from_dict on the json representation reservation_identity_by_crn_model = ReservationIdentityByCRN.from_dict(reservation_identity_by_crn_model_json) @@ -87223,7 +89022,7 @@ def test_reservation_identity_by_href_serialization(self): # Construct a json representation of a ReservationIdentityByHref model reservation_identity_by_href_model_json = {} - reservation_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a model instance of ReservationIdentityByHref by calling from_dict on the json representation reservation_identity_by_href_model = ReservationIdentityByHref.from_dict(reservation_identity_by_href_model_json) @@ -87253,7 +89052,7 @@ def test_reservation_identity_by_id_serialization(self): # Construct a json representation of a ReservationIdentityById model reservation_identity_by_id_model_json = {} - reservation_identity_by_id_model_json['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_by_id_model_json['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' # Construct a model instance of ReservationIdentityById by calling from_dict on the json representation reservation_identity_by_id_model = ReservationIdentityById.from_dict(reservation_identity_by_id_model_json) @@ -87289,8 +89088,8 @@ def test_reserved_ip_target_bare_metal_server_network_interface_reference_target # Construct a json representation of a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext model reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json = {} reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['deleted'] = deleted_model - reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['name'] = 'my-bare-metal-server-network-interface' reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' @@ -87445,8 +89244,8 @@ def test_reserved_ip_target_network_interface_reference_target_context_serializa # Construct a json representation of a ReservedIPTargetNetworkInterfaceReferenceTargetContext model reserved_ip_target_network_interface_reference_target_context_model_json = {} reserved_ip_target_network_interface_reference_target_context_model_json['deleted'] = deleted_model - reserved_ip_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - reserved_ip_target_network_interface_reference_target_context_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + reserved_ip_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + reserved_ip_target_network_interface_reference_target_context_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' reserved_ip_target_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface' reserved_ip_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' @@ -87558,9 +89357,9 @@ def test_reserved_ip_target_virtual_network_interface_reference_reserved_ip_targ # Construct a json representation of a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext model reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json = {} - reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['name'] = 'my-virtual-network-interface' reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['resource_type'] = 'virtual_network_interface' @@ -88230,7 +90029,7 @@ def test_security_group_rule_prototype_security_group_rule_protocol_tcpudp_seria security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['local'] = security_group_rule_local_prototype_model security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['port_max'] = 22 security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['port_min'] = 22 - security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['protocol'] = 'udp' + security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['protocol'] = 'tcp' security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['remote'] = security_group_rule_remote_prototype_model # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation @@ -88489,8 +90288,8 @@ def test_security_group_rule_security_group_rule_protocol_all_serialization(self # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolAll model security_group_rule_security_group_rule_protocol_all_model_json = {} security_group_rule_security_group_rule_protocol_all_model_json['direction'] = 'inbound' - security_group_rule_security_group_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_all_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_all_model_json['id'] = 'r006-6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_security_group_rule_protocol_all_model_json['ip_version'] = 'ipv4' security_group_rule_security_group_rule_protocol_all_model_json['local'] = security_group_rule_local_model security_group_rule_security_group_rule_protocol_all_model_json['remote'] = security_group_rule_remote_model @@ -88533,8 +90332,8 @@ def test_security_group_rule_security_group_rule_protocol_icmp_serialization(sel # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolICMP model security_group_rule_security_group_rule_protocol_icmp_model_json = {} security_group_rule_security_group_rule_protocol_icmp_model_json['direction'] = 'inbound' - security_group_rule_security_group_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_icmp_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_icmp_model_json['id'] = 'r006-6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_security_group_rule_protocol_icmp_model_json['ip_version'] = 'ipv4' security_group_rule_security_group_rule_protocol_icmp_model_json['local'] = security_group_rule_local_model security_group_rule_security_group_rule_protocol_icmp_model_json['remote'] = security_group_rule_remote_model @@ -88579,8 +90378,8 @@ def test_security_group_rule_security_group_rule_protocol_tcpudp_serialization(s # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP model security_group_rule_security_group_rule_protocol_tcpudp_model_json = {} security_group_rule_security_group_rule_protocol_tcpudp_model_json['direction'] = 'inbound' - security_group_rule_security_group_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a' - security_group_rule_security_group_rule_protocol_tcpudp_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a' + security_group_rule_security_group_rule_protocol_tcpudp_model_json['id'] = 'r006-6f2a6efe-21e2-401c-b237-620aa26ba16a' security_group_rule_security_group_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4' security_group_rule_security_group_rule_protocol_tcpudp_model_json['local'] = security_group_rule_local_model security_group_rule_security_group_rule_protocol_tcpudp_model_json['remote'] = security_group_rule_remote_model @@ -88622,8 +90421,8 @@ def test_security_group_target_reference_bare_metal_server_network_interface_ref # Construct a json representation of a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext model security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json = {} security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['deleted'] = deleted_model - security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['name'] = 'my-bare-metal-server-network-interface' security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' @@ -88741,8 +90540,8 @@ def test_security_group_target_reference_network_interface_reference_target_cont # Construct a json representation of a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext model security_group_target_reference_network_interface_reference_target_context_model_json = {} security_group_target_reference_network_interface_reference_target_context_model_json['deleted'] = deleted_model - security_group_target_reference_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_network_interface_reference_target_context_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + security_group_target_reference_network_interface_reference_target_context_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' security_group_target_reference_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface' security_group_target_reference_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' @@ -88818,9 +90617,9 @@ def test_security_group_target_reference_virtual_network_interface_reference_ser deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' reserved_ip_reference_model = {} # ReservedIPReference - reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['address'] = '10.0.1.5' reserved_ip_reference_model['deleted'] = deleted_model - reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['id'] = '0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_reference_model['name'] = 'my-reserved-ip' reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' @@ -88835,10 +90634,10 @@ def test_security_group_target_reference_virtual_network_interface_reference_ser # Construct a json representation of a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference model security_group_target_reference_virtual_network_interface_reference_model_json = {} - security_group_target_reference_virtual_network_interface_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + security_group_target_reference_virtual_network_interface_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' security_group_target_reference_virtual_network_interface_reference_model_json['deleted'] = deleted_model - security_group_target_reference_virtual_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' - security_group_target_reference_virtual_network_interface_reference_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + security_group_target_reference_virtual_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' + security_group_target_reference_virtual_network_interface_reference_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' security_group_target_reference_virtual_network_interface_reference_model_json['name'] = 'my-virtual-network-interface' security_group_target_reference_virtual_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model security_group_target_reference_virtual_network_interface_reference_model_json['resource_type'] = 'virtual_network_interface' @@ -88889,9 +90688,9 @@ def test_share_accessor_binding_accessor_share_reference_serialization(self): # Construct a json representation of a ShareAccessorBindingAccessorShareReference model share_accessor_binding_accessor_share_reference_model_json = {} - share_accessor_binding_accessor_share_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_accessor_binding_accessor_share_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_accessor_binding_accessor_share_reference_model_json['deleted'] = deleted_model - share_accessor_binding_accessor_share_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_accessor_binding_accessor_share_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_accessor_binding_accessor_share_reference_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' share_accessor_binding_accessor_share_reference_model_json['name'] = 'my-share' share_accessor_binding_accessor_share_reference_model_json['remote'] = share_remote_model @@ -88956,7 +90755,7 @@ def test_share_identity_by_crn_serialization(self): # Construct a json representation of a ShareIdentityByCRN model share_identity_by_crn_model_json = {} - share_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' # Construct a model instance of ShareIdentityByCRN by calling from_dict on the json representation share_identity_by_crn_model = ShareIdentityByCRN.from_dict(share_identity_by_crn_model_json) @@ -88986,7 +90785,7 @@ def test_share_identity_by_href_serialization(self): # Construct a json representation of a ShareIdentityByHref model share_identity_by_href_model_json = {} - share_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58' # Construct a model instance of ShareIdentityByHref by calling from_dict on the json representation share_identity_by_href_model = ShareIdentityByHref.from_dict(share_identity_by_href_model_json) @@ -89060,7 +90859,7 @@ def test_share_mount_target_prototype_share_mount_target_by_access_control_mode_ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' @@ -89162,7 +90961,7 @@ def test_share_mount_target_virtual_network_interface_prototype_virtual_network_ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' @@ -89241,7 +91040,6 @@ def test_share_profile_capacity_enum_serialization(self): # Construct a json representation of a ShareProfileCapacityEnum model share_profile_capacity_enum_model_json = {} - share_profile_capacity_enum_model_json['default'] = 'testString' share_profile_capacity_enum_model_json['type'] = 'enum' share_profile_capacity_enum_model_json['values'] = [4800, 9600, 16000, 32000] @@ -89304,7 +91102,7 @@ def test_share_profile_capacity_range_serialization(self): # Construct a json representation of a ShareProfileCapacityRange model share_profile_capacity_range_model_json = {} - share_profile_capacity_range_model_json['default'] = 38 + share_profile_capacity_range_model_json['default'] = 1000 share_profile_capacity_range_model_json['max'] = 9600 share_profile_capacity_range_model_json['min'] = 5 share_profile_capacity_range_model_json['step'] = 1 @@ -89542,7 +91340,7 @@ def test_share_prototype_share_by_origin_share_serialization(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -89635,7 +91433,7 @@ def test_share_prototype_share_by_size_serialization(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -89739,7 +91537,7 @@ def test_share_prototype_share_by_source_share_serialization(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -90347,64 +92145,64 @@ def test_subnet_public_gateway_patch_public_gateway_identity_by_id_serialization assert subnet_public_gateway_patch_public_gateway_identity_by_id_model_json2 == subnet_public_gateway_patch_public_gateway_identity_by_id_model_json -class TestModel_TrustedProfileIdentityTrustedProfileByCRN: +class TestModel_TrustedProfileIdentityByCRN: """ - Test Class for TrustedProfileIdentityTrustedProfileByCRN + Test Class for TrustedProfileIdentityByCRN """ - def test_trusted_profile_identity_trusted_profile_by_crn_serialization(self): + def test_trusted_profile_identity_by_crn_serialization(self): """ - Test serialization/deserialization for TrustedProfileIdentityTrustedProfileByCRN + Test serialization/deserialization for TrustedProfileIdentityByCRN """ - # Construct a json representation of a TrustedProfileIdentityTrustedProfileByCRN model - trusted_profile_identity_trusted_profile_by_crn_model_json = {} - trusted_profile_identity_trusted_profile_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + # Construct a json representation of a TrustedProfileIdentityByCRN model + trusted_profile_identity_by_crn_model_json = {} + trusted_profile_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' - # Construct a model instance of TrustedProfileIdentityTrustedProfileByCRN by calling from_dict on the json representation - trusted_profile_identity_trusted_profile_by_crn_model = TrustedProfileIdentityTrustedProfileByCRN.from_dict(trusted_profile_identity_trusted_profile_by_crn_model_json) - assert trusted_profile_identity_trusted_profile_by_crn_model != False + # Construct a model instance of TrustedProfileIdentityByCRN by calling from_dict on the json representation + trusted_profile_identity_by_crn_model = TrustedProfileIdentityByCRN.from_dict(trusted_profile_identity_by_crn_model_json) + assert trusted_profile_identity_by_crn_model != False - # Construct a model instance of TrustedProfileIdentityTrustedProfileByCRN by calling from_dict on the json representation - trusted_profile_identity_trusted_profile_by_crn_model_dict = TrustedProfileIdentityTrustedProfileByCRN.from_dict(trusted_profile_identity_trusted_profile_by_crn_model_json).__dict__ - trusted_profile_identity_trusted_profile_by_crn_model2 = TrustedProfileIdentityTrustedProfileByCRN(**trusted_profile_identity_trusted_profile_by_crn_model_dict) + # Construct a model instance of TrustedProfileIdentityByCRN by calling from_dict on the json representation + trusted_profile_identity_by_crn_model_dict = TrustedProfileIdentityByCRN.from_dict(trusted_profile_identity_by_crn_model_json).__dict__ + trusted_profile_identity_by_crn_model2 = TrustedProfileIdentityByCRN(**trusted_profile_identity_by_crn_model_dict) # Verify the model instances are equivalent - assert trusted_profile_identity_trusted_profile_by_crn_model == trusted_profile_identity_trusted_profile_by_crn_model2 + assert trusted_profile_identity_by_crn_model == trusted_profile_identity_by_crn_model2 # Convert model instance back to dict and verify no loss of data - trusted_profile_identity_trusted_profile_by_crn_model_json2 = trusted_profile_identity_trusted_profile_by_crn_model.to_dict() - assert trusted_profile_identity_trusted_profile_by_crn_model_json2 == trusted_profile_identity_trusted_profile_by_crn_model_json + trusted_profile_identity_by_crn_model_json2 = trusted_profile_identity_by_crn_model.to_dict() + assert trusted_profile_identity_by_crn_model_json2 == trusted_profile_identity_by_crn_model_json -class TestModel_TrustedProfileIdentityTrustedProfileById: +class TestModel_TrustedProfileIdentityById: """ - Test Class for TrustedProfileIdentityTrustedProfileById + Test Class for TrustedProfileIdentityById """ - def test_trusted_profile_identity_trusted_profile_by_id_serialization(self): + def test_trusted_profile_identity_by_id_serialization(self): """ - Test serialization/deserialization for TrustedProfileIdentityTrustedProfileById + Test serialization/deserialization for TrustedProfileIdentityById """ - # Construct a json representation of a TrustedProfileIdentityTrustedProfileById model - trusted_profile_identity_trusted_profile_by_id_model_json = {} - trusted_profile_identity_trusted_profile_by_id_model_json['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + # Construct a json representation of a TrustedProfileIdentityById model + trusted_profile_identity_by_id_model_json = {} + trusted_profile_identity_by_id_model_json['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' - # Construct a model instance of TrustedProfileIdentityTrustedProfileById by calling from_dict on the json representation - trusted_profile_identity_trusted_profile_by_id_model = TrustedProfileIdentityTrustedProfileById.from_dict(trusted_profile_identity_trusted_profile_by_id_model_json) - assert trusted_profile_identity_trusted_profile_by_id_model != False + # Construct a model instance of TrustedProfileIdentityById by calling from_dict on the json representation + trusted_profile_identity_by_id_model = TrustedProfileIdentityById.from_dict(trusted_profile_identity_by_id_model_json) + assert trusted_profile_identity_by_id_model != False - # Construct a model instance of TrustedProfileIdentityTrustedProfileById by calling from_dict on the json representation - trusted_profile_identity_trusted_profile_by_id_model_dict = TrustedProfileIdentityTrustedProfileById.from_dict(trusted_profile_identity_trusted_profile_by_id_model_json).__dict__ - trusted_profile_identity_trusted_profile_by_id_model2 = TrustedProfileIdentityTrustedProfileById(**trusted_profile_identity_trusted_profile_by_id_model_dict) + # Construct a model instance of TrustedProfileIdentityById by calling from_dict on the json representation + trusted_profile_identity_by_id_model_dict = TrustedProfileIdentityById.from_dict(trusted_profile_identity_by_id_model_json).__dict__ + trusted_profile_identity_by_id_model2 = TrustedProfileIdentityById(**trusted_profile_identity_by_id_model_dict) # Verify the model instances are equivalent - assert trusted_profile_identity_trusted_profile_by_id_model == trusted_profile_identity_trusted_profile_by_id_model2 + assert trusted_profile_identity_by_id_model == trusted_profile_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - trusted_profile_identity_trusted_profile_by_id_model_json2 = trusted_profile_identity_trusted_profile_by_id_model.to_dict() - assert trusted_profile_identity_trusted_profile_by_id_model_json2 == trusted_profile_identity_trusted_profile_by_id_model_json + trusted_profile_identity_by_id_model_json2 = trusted_profile_identity_by_id_model.to_dict() + assert trusted_profile_identity_by_id_model_json2 == trusted_profile_identity_by_id_model_json class TestModel_VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype: @@ -92386,8 +94184,8 @@ def test_virtual_network_interface_target_bare_metal_server_network_attachment_r # Construct a json representation of a VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext model virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json = {} - virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' - virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' + virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['name'] = 'my-bare-metal-server-network-attachment' virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['resource_type'] = 'bare_metal_server_network_attachment' @@ -92419,7 +94217,7 @@ def test_virtual_network_interface_target_instance_network_attachment_reference_ # Construct a json representation of a VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext model virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json = {} - virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['name'] = 'my-instance-network-attachment' virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['resource_type'] = 'instance_network_attachment' @@ -92458,7 +94256,7 @@ def test_virtual_network_interface_target_share_mount_target_reference_serializa # Construct a json representation of a VirtualNetworkInterfaceTargetShareMountTargetReference model virtual_network_interface_target_share_mount_target_reference_model_json = {} virtual_network_interface_target_share_mount_target_reference_model_json['deleted'] = deleted_model - virtual_network_interface_target_share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' virtual_network_interface_target_share_mount_target_reference_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' virtual_network_interface_target_share_mount_target_reference_model_json['name'] = 'my-share-mount-target' virtual_network_interface_target_share_mount_target_reference_model_json['resource_type'] = 'share_mount_target' @@ -93095,7 +94893,7 @@ def test_volume_prototype_volume_by_source_snapshot_serialization(self): encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' # Construct a json representation of a VolumePrototypeVolumeBySourceSnapshot model volume_prototype_volume_by_source_snapshot_model_json = {} @@ -93227,7 +95025,7 @@ def test_bare_metal_server_network_attachment_prototype_virtual_network_interfac # Construct a json representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {} - bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json) @@ -93257,7 +95055,7 @@ def test_bare_metal_server_network_attachment_prototype_virtual_network_interfac # Construct a json representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {} - bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json) @@ -93287,7 +95085,7 @@ def test_bare_metal_server_network_attachment_prototype_virtual_network_interfac # Construct a json representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {} - bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json) @@ -93305,6 +95103,66 @@ def test_bare_metal_server_network_attachment_prototype_virtual_network_interfac assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json +class TestModel_ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref: + """ + Test Class for ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref + """ + + def test_cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref + """ + + # Construct a json representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref model + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_json = {} + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + + # Construct a model instance of ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref by calling from_dict on the json representation + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref.from_dict(cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_json) + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model != False + + # Construct a model instance of ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref by calling from_dict on the json representation + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_dict = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref.from_dict(cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_json).__dict__ + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model2 = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextByHref(**cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model == cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_json2 = cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model.to_dict() + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_json2 == cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_href_model_json + + +class TestModel_ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById: + """ + Test Class for ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById + """ + + def test_cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_serialization(self): + """ + Test serialization/deserialization for ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById + """ + + # Construct a json representation of a ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById model + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_json = {} + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + + # Construct a model instance of ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById by calling from_dict on the json representation + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById.from_dict(cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_json) + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model != False + + # Construct a model instance of ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById by calling from_dict on the json representation + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_dict = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById.from_dict(cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_json).__dict__ + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model2 = ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPIdentityClusterNetworkInterfacePrimaryIPContextById(**cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_dict) + + # Verify the model instances are equivalent + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model == cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_json2 = cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model.to_dict() + assert cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_json2 == cluster_network_interface_primary_ip_prototype_cluster_network_subnet_reserved_ip_identity_cluster_network_interface_primary_ip_context_by_id_model_json + + class TestModel_EndpointGatewayReservedIPReservedIPIdentityByHref: """ Test Class for EndpointGatewayReservedIPReservedIPIdentityByHref @@ -93377,7 +95235,7 @@ def test_floating_ip_target_patch_bare_metal_server_network_interface_identity_b # Construct a json representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref model floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json = {} - floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json) @@ -93407,7 +95265,7 @@ def test_floating_ip_target_patch_bare_metal_server_network_interface_identity_b # Construct a json representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json = {} - floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json) @@ -93437,7 +95295,7 @@ def test_floating_ip_target_patch_network_interface_identity_network_interface_i # Construct a json representation of a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json = {} - floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json) @@ -93467,7 +95325,7 @@ def test_floating_ip_target_patch_network_interface_identity_network_interface_i # Construct a json representation of a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById model floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json = {} - floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json) @@ -93497,7 +95355,7 @@ def test_floating_ip_target_patch_virtual_network_interface_identity_virtual_net # Construct a json representation of a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {} - floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json) @@ -93527,7 +95385,7 @@ def test_floating_ip_target_patch_virtual_network_interface_identity_virtual_net # Construct a json representation of a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {} - floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json) @@ -93557,7 +95415,7 @@ def test_floating_ip_target_patch_virtual_network_interface_identity_virtual_net # Construct a json representation of a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {} - floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json) @@ -93587,7 +95445,7 @@ def test_floating_ip_target_prototype_bare_metal_server_network_interface_identi # Construct a json representation of a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref model floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json = {} - floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json) @@ -93617,7 +95475,7 @@ def test_floating_ip_target_prototype_bare_metal_server_network_interface_identi # Construct a json representation of a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json = {} - floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json['id'] = '0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6' # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json) @@ -93647,7 +95505,7 @@ def test_floating_ip_target_prototype_network_interface_identity_network_interfa # Construct a json representation of a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json = {} - floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json) @@ -93677,7 +95535,7 @@ def test_floating_ip_target_prototype_network_interface_identity_network_interfa # Construct a json representation of a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json = {} - floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json) @@ -93707,7 +95565,7 @@ def test_floating_ip_target_prototype_virtual_network_interface_identity_virtual # Construct a json representation of a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {} - floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json) @@ -93737,7 +95595,7 @@ def test_floating_ip_target_prototype_virtual_network_interface_identity_virtual # Construct a json representation of a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {} - floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json) @@ -93767,7 +95625,7 @@ def test_floating_ip_target_prototype_virtual_network_interface_identity_virtual # Construct a json representation of a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {} - floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json) @@ -93797,7 +95655,7 @@ def test_flow_log_collector_target_prototype_instance_identity_instance_identity # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN model flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json = {} - flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json) @@ -93827,7 +95685,7 @@ def test_flow_log_collector_target_prototype_instance_identity_instance_identity # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref model flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json = {} - flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' + flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json) @@ -93857,7 +95715,7 @@ def test_flow_log_collector_target_prototype_instance_identity_instance_identity # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById model flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json = {} - flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json) @@ -93887,7 +95745,7 @@ def test_flow_log_collector_target_prototype_instance_network_attachment_identit # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref model flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json = {} - flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' + flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref by calling from_dict on the json representation flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model = FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json) @@ -93947,7 +95805,7 @@ def test_flow_log_collector_target_prototype_network_interface_identity_network_ # Construct a json representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json = {} - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7' # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json) @@ -93977,7 +95835,7 @@ def test_flow_log_collector_target_prototype_network_interface_identity_network_ # Construct a json representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json = {} - flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '0717-10c02d81-0ecb-4dc5-897d-28392913b81e' + flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '0717-d54eb633-98ea-459d-aa00-6a8e780175a7' # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json) @@ -94187,7 +96045,7 @@ def test_flow_log_collector_target_prototype_virtual_network_interface_identity_ # Construct a json representation of a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {} - flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json) @@ -94217,7 +96075,7 @@ def test_flow_log_collector_target_prototype_virtual_network_interface_identity_ # Construct a json representation of a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {} - flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json) @@ -94247,7 +96105,7 @@ def test_flow_log_collector_target_prototype_virtual_network_interface_identity_ # Construct a json representation of a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {} - flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json) @@ -94265,6 +96123,66 @@ def test_flow_log_collector_target_prototype_virtual_network_interface_identity_ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json +class TestModel_InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref: + """ + Test Class for InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref + """ + + def test_instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref + """ + + # Construct a json representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref model + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_json = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + + # Construct a model instance of InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref by calling from_dict on the json representation + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref.from_dict(instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_json) + assert instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref by calling from_dict on the json representation + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_dict = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref.from_dict(instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_json).__dict__ + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model2 = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityByHref(**instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model == instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_json2 = instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model.to_dict() + assert instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_json2 == instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_href_model_json + + +class TestModel_InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById: + """ + Test Class for InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById + """ + + def test_instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_serialization(self): + """ + Test serialization/deserialization for InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById + """ + + # Construct a json representation of a InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById model + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_json = {} + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_json['id'] = '0717-ffc092f7-5d02-4b93-ab69-26860529b9fb' + + # Construct a model instance of InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById by calling from_dict on the json representation + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById.from_dict(instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_json) + assert instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model != False + + # Construct a model instance of InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById by calling from_dict on the json representation + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_dict = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById.from_dict(instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_json).__dict__ + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model2 = InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceClusterNetworkInterfaceIdentityClusterNetworkInterfaceIdentityById(**instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_dict) + + # Verify the model instances are equivalent + assert instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model == instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_json2 = instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model.to_dict() + assert instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_json2 == instance_cluster_network_attachment_prototype_cluster_network_interface_cluster_network_interface_identity_cluster_network_interface_identity_by_id_model_json + + class TestModel_InstanceGroupManagerActionScheduledActionGroupTarget: """ Test Class for InstanceGroupManagerActionScheduledActionGroupTarget @@ -94445,7 +96363,7 @@ def test_instance_network_attachment_prototype_virtual_network_interface_virtual # Construct a json representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {} - instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json) @@ -94475,7 +96393,7 @@ def test_instance_network_attachment_prototype_virtual_network_interface_virtual # Construct a json representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {} - instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json) @@ -94505,7 +96423,7 @@ def test_instance_network_attachment_prototype_virtual_network_interface_virtual # Construct a json representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {} - instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json) @@ -94535,7 +96453,7 @@ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN model instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json = {} - instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json) @@ -94565,7 +96483,7 @@ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref model instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json = {} - instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json) @@ -94595,7 +96513,7 @@ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById model instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json = {} - instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json) @@ -94715,7 +96633,7 @@ def test_instance_placement_target_prototype_dedicated_host_group_identity_dedic # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN model instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json = {} - instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json) @@ -94745,7 +96663,7 @@ def test_instance_placement_target_prototype_dedicated_host_group_identity_dedic # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref model instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json = {} - instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json) @@ -94775,7 +96693,7 @@ def test_instance_placement_target_prototype_dedicated_host_group_identity_dedic # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById model instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json = {} - instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' + instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json['id'] = '0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0' # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json) @@ -94895,7 +96813,7 @@ def test_instance_placement_target_prototype_placement_group_identity_placement_ # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN model instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json = {} - instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871' # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN by calling from_dict on the json representation instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json) @@ -94925,7 +96843,7 @@ def test_instance_placement_target_prototype_placement_group_identity_placement_ # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref model instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json = {} - instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871' # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref by calling from_dict on the json representation instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json) @@ -94955,7 +96873,7 @@ def test_instance_placement_target_prototype_placement_group_identity_placement_ # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById model instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json = {} - instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871' + instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json['id'] = 'r006-418fe842-a3e9-47b9-a938-1aa5bd632871' # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById by calling from_dict on the json representation instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json) @@ -94988,7 +96906,25 @@ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_off instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -95010,7 +96946,7 @@ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_off instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -95074,7 +97010,7 @@ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_off virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -95098,6 +97034,7 @@ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_off # Construct a json representation of a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment model instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json = {} instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['enable_secure_boot'] = True @@ -95149,7 +97086,25 @@ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_off instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -95171,7 +97126,7 @@ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_off instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -95230,7 +97185,7 @@ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_off network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -95245,6 +97200,7 @@ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_off # Construct a json representation of a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface model instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json = {} instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['enable_secure_boot'] = True @@ -95296,7 +97252,25 @@ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_netw instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -95318,7 +97292,7 @@ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_netw instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -95375,7 +97349,7 @@ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_netw virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -95399,6 +97373,7 @@ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_netw # Construct a json representation of a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment model instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json = {} instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['enable_secure_boot'] = True @@ -95450,7 +97425,25 @@ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_netw instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -95472,7 +97465,7 @@ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_netw instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -95524,7 +97517,7 @@ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_netw network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -95539,6 +97532,7 @@ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_netw # Construct a json representation of a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json = {} instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['enable_secure_boot'] = True @@ -95590,7 +97584,25 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -95612,7 +97624,7 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -95639,7 +97651,7 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps volume_profile_identity_model['name'] = 'general-purpose' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 @@ -95670,7 +97682,7 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -95694,6 +97706,7 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps # Construct a json representation of a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment model instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json = {} instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['enable_secure_boot'] = True @@ -95744,7 +97757,25 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -95766,7 +97797,7 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -95793,7 +97824,7 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps volume_profile_identity_model['name'] = 'general-purpose' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 @@ -95819,7 +97850,7 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -95834,6 +97865,7 @@ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snaps # Construct a json representation of a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface model instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json = {} instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['enable_secure_boot'] = True @@ -95884,7 +97916,25 @@ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_ne instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -95906,7 +97956,7 @@ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_ne instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -95948,7 +97998,7 @@ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_ne virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -95972,6 +98022,7 @@ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_ne # Construct a json representation of a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment model instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json = {} instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['enable_secure_boot'] = True @@ -96022,7 +98073,25 @@ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_ne instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -96044,7 +98113,7 @@ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_ne instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -96081,7 +98150,7 @@ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_ne network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -96096,6 +98165,7 @@ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_ne # Construct a json representation of a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface model instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json = {} instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['enable_secure_boot'] = True @@ -96146,7 +98216,25 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_insta instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -96168,7 +98256,7 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_insta instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -96232,7 +98320,7 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_insta virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -96256,6 +98344,7 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_insta # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment model instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json = {} instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['enable_secure_boot'] = True @@ -96307,7 +98396,25 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_insta instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -96329,7 +98436,7 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_insta instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -96388,7 +98495,7 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_insta network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -96403,6 +98510,7 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_insta # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface model instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json = {} instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['enable_secure_boot'] = True @@ -96454,7 +98562,25 @@ def test_instance_template_prototype_instance_template_by_image_instance_templat instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -96476,7 +98602,7 @@ def test_instance_template_prototype_instance_template_by_image_instance_templat instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -96533,7 +98659,7 @@ def test_instance_template_prototype_instance_template_by_image_instance_templat virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -96557,6 +98683,7 @@ def test_instance_template_prototype_instance_template_by_image_instance_templat # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json = {} instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['enable_secure_boot'] = True @@ -96608,7 +98735,25 @@ def test_instance_template_prototype_instance_template_by_image_instance_templat instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -96630,7 +98775,7 @@ def test_instance_template_prototype_instance_template_by_image_instance_templat instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -96682,7 +98827,7 @@ def test_instance_template_prototype_instance_template_by_image_instance_templat network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -96697,6 +98842,7 @@ def test_instance_template_prototype_instance_template_by_image_instance_templat # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface model instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json = {} instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['enable_secure_boot'] = True @@ -96748,7 +98894,25 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -96770,7 +98934,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -96797,7 +98961,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan volume_profile_identity_model['name'] = 'general-purpose' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 @@ -96828,7 +98992,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -96852,6 +99016,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment model instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json = {} instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['enable_secure_boot'] = True @@ -96902,7 +99067,25 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -96924,7 +99107,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -96951,7 +99134,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan volume_profile_identity_model['name'] = 'general-purpose' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 @@ -96977,7 +99160,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -96992,6 +99175,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_instan # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface model instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json = {} instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['enable_secure_boot'] = True @@ -97042,7 +99226,25 @@ def test_instance_template_instance_by_catalog_offering_instance_template_contex instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -97064,7 +99266,7 @@ def test_instance_template_instance_by_catalog_offering_instance_template_contex instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -97133,7 +99335,7 @@ def test_instance_template_instance_by_catalog_offering_instance_template_contex virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -97157,6 +99359,7 @@ def test_instance_template_instance_by_catalog_offering_instance_template_contex # Construct a json representation of a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment model instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json = {} instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z' instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' @@ -97212,7 +99415,25 @@ def test_instance_template_instance_by_catalog_offering_instance_template_contex instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -97234,7 +99455,7 @@ def test_instance_template_instance_by_catalog_offering_instance_template_contex instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -97298,7 +99519,7 @@ def test_instance_template_instance_by_catalog_offering_instance_template_contex network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -97313,6 +99534,7 @@ def test_instance_template_instance_by_catalog_offering_instance_template_contex # Construct a json representation of a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface model instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json = {} instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z' instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' @@ -97368,7 +99590,25 @@ def test_instance_template_instance_by_image_instance_template_context_instance_ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -97390,7 +99630,7 @@ def test_instance_template_instance_by_image_instance_template_context_instance_ instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -97452,7 +99692,7 @@ def test_instance_template_instance_by_image_instance_template_context_instance_ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -97476,6 +99716,7 @@ def test_instance_template_instance_by_image_instance_template_context_instance_ # Construct a json representation of a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment model instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json = {} instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z' instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' @@ -97531,7 +99772,25 @@ def test_instance_template_instance_by_image_instance_template_context_instance_ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -97553,7 +99812,7 @@ def test_instance_template_instance_by_image_instance_template_context_instance_ instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -97610,7 +99869,7 @@ def test_instance_template_instance_by_image_instance_template_context_instance_ network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -97625,6 +99884,7 @@ def test_instance_template_instance_by_image_instance_template_context_instance_ # Construct a json representation of a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface model instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json = {} instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z' instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' @@ -97680,7 +99940,25 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -97702,7 +99980,7 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -97734,7 +100012,7 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 @@ -97757,7 +100035,7 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context network_interface_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -97801,6 +100079,7 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context # Construct a json representation of a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment model instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json = {} instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['confidential_compute_mode'] = 'disabled' instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z' instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' @@ -97856,7 +100135,25 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype instance_availability_policy_prototype_model['host_failure'] = 'restart' - trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + cluster_network_interface_primary_ip_prototype_model = {} # ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext + cluster_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + cluster_network_interface_primary_ip_prototype_model['auto_delete'] = False + cluster_network_interface_primary_ip_prototype_model['name'] = 'my-cluster-network-subnet-reserved-ip' + + cluster_network_subnet_identity_model = {} # ClusterNetworkSubnetIdentityById + cluster_network_subnet_identity_model['id'] = '0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930' + + instance_cluster_network_attachment_prototype_cluster_network_interface_model = {} # InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment + instance_cluster_network_attachment_prototype_cluster_network_interface_model['auto_delete'] = False + instance_cluster_network_attachment_prototype_cluster_network_interface_model['name'] = 'my-cluster-network-interface' + instance_cluster_network_attachment_prototype_cluster_network_interface_model['primary_ip'] = cluster_network_interface_primary_ip_prototype_model + instance_cluster_network_attachment_prototype_cluster_network_interface_model['subnet'] = cluster_network_subnet_identity_model + + instance_cluster_network_attachment_prototype_instance_context_model = {} # InstanceClusterNetworkAttachmentPrototypeInstanceContext + instance_cluster_network_attachment_prototype_instance_context_model['cluster_network_interface'] = instance_cluster_network_attachment_prototype_cluster_network_interface_model + instance_cluster_network_attachment_prototype_instance_context_model['name'] = 'my-instance-network-attachment' + + trusted_profile_identity_model = {} # TrustedProfileIdentityById trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype @@ -97878,7 +100175,7 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context instance_profile_identity_model['name'] = 'cx2-16x32' reservation_identity_model = {} # ReservationIdentityById - reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63' + reservation_identity_model['id'] = '0717-ba49df72-37b8-43ac-98da-f8e029de0e63' instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype instance_reservation_affinity_prototype_model['policy'] = 'disabled' @@ -97910,7 +100207,7 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 @@ -97938,7 +100235,7 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + security_group_identity_model['id'] = 'r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271' subnet_identity_model = {} # SubnetIdentityById subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' @@ -97977,6 +100274,7 @@ def test_instance_template_instance_by_source_snapshot_instance_template_context # Construct a json representation of a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface model instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json = {} instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['cluster_network_attachments'] = [instance_cluster_network_attachment_prototype_instance_context_model] instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['confidential_compute_mode'] = 'disabled' instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z' instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' @@ -98150,7 +100448,7 @@ def test_load_balancer_pool_member_target_prototype_instance_identity_instance_i # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN model load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json = {} - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_crn_model_json) @@ -98180,7 +100478,7 @@ def test_load_balancer_pool_member_target_prototype_instance_identity_instance_i # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref model load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json = {} - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_1e09281b-f177-46fb-b1f1-bc152b2e391a' + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_href_model_json) @@ -98210,7 +100508,7 @@ def test_load_balancer_pool_member_target_prototype_instance_identity_instance_i # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json = {} - load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json['id'] = '0717_1e09281b-f177-46f2-b1f1-bc152b2e391a' + load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json['id'] = '0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0' # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model = LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json) @@ -98330,7 +100628,7 @@ def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_i # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN model public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json = {} - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN by calling from_dict on the json representation public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_crn_model_json) @@ -98360,7 +100658,7 @@ def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_i # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref model public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json = {} - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref by calling from_dict on the json representation public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_href_model_json) @@ -98390,7 +100688,7 @@ def test_public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_i # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json = {} - public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' + public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json['id'] = 'r006-f45e0d90-12a8-4460-8210-290ff2ab75cd' # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById by calling from_dict on the json representation public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model = PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.from_dict(public_gateway_floating_ip_prototype_floating_ip_identity_floating_ip_identity_by_id_model_json) @@ -98510,7 +100808,7 @@ def test_reserved_ip_target_prototype_virtual_network_interface_identity_virtual # Construct a json representation of a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {} - reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json) @@ -98540,7 +100838,7 @@ def test_reserved_ip_target_prototype_virtual_network_interface_identity_virtual # Construct a json representation of a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {} - reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json) @@ -98570,7 +100868,7 @@ def test_reserved_ip_target_prototype_virtual_network_interface_identity_virtual # Construct a json representation of a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {} - reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json) @@ -99020,7 +101318,7 @@ def test_share_mount_target_virtual_network_interface_prototype_virtual_network_ # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {} - share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json) @@ -99050,7 +101348,7 @@ def test_share_mount_target_virtual_network_interface_prototype_virtual_network_ # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {} - share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json) @@ -99080,7 +101378,7 @@ def test_share_mount_target_virtual_network_interface_prototype_virtual_network_ # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {} - share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0717-54eb57ee-86f2-4796-90bb-d7874e0831ef' # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json) @@ -99600,7 +101898,7 @@ def test_volume_attachment_prototype_volume_volume_prototype_instance_context_vo encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + snapshot_identity_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' # Construct a json representation of a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot model volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json = {}